From cccd8d538ede280dda01d2affc6e3048e2d0086c Mon Sep 17 00:00:00 2001 From: DPE bot Date: Tue, 6 Nov 2018 11:30:19 -0800 Subject: [PATCH] Regenerate vision client: Adds product search (#3888) * Regenerate vision client * vision proto libraries need com.google.api:api-common compile dependency --- .../cloud/vision/v1/ProductSearchGrpc.java | 2266 ++++++++++ .../proto-google-cloud-vision-v1/pom.xml | 7 +- .../v1/AddProductToProductSetRequest.java | 760 ++++ ...ddProductToProductSetRequestOrBuilder.java | 53 + .../vision/v1/AnnotateImageResponse.java | 229 + .../v1/AnnotateImageResponseOrBuilder.java | 25 + .../vision/v1/BatchOperationMetadata.java | 1184 ++++++ .../v1/BatchOperationMetadataOrBuilder.java | 79 + .../cloud/vision/v1/CreateProductRequest.java | 996 +++++ .../v1/CreateProductRequestOrBuilder.java | 80 + .../vision/v1/CreateProductSetRequest.java | 989 +++++ .../v1/CreateProductSetRequestOrBuilder.java | 78 + .../v1/CreateReferenceImageRequest.java | 1008 +++++ .../CreateReferenceImageRequestOrBuilder.java | 83 + .../cloud/vision/v1/DeleteProductRequest.java | 591 +++ .../v1/DeleteProductRequestOrBuilder.java | 31 + .../vision/v1/DeleteProductSetRequest.java | 591 +++ .../v1/DeleteProductSetRequestOrBuilder.java | 31 + .../v1/DeleteReferenceImageRequest.java | 591 +++ .../DeleteReferenceImageRequestOrBuilder.java | 31 + .../cloud/vision/v1/EntityAnnotation.java | 16 +- .../vision/v1/EntityAnnotationOrBuilder.java | 4 +- .../com/google/cloud/vision/v1/Feature.java | 17 + .../google/cloud/vision/v1/GeometryProto.java | 24 +- .../cloud/vision/v1/GetProductRequest.java | 591 +++ .../vision/v1/GetProductRequestOrBuilder.java | 31 + .../cloud/vision/v1/GetProductSetRequest.java | 591 +++ .../v1/GetProductSetRequestOrBuilder.java | 31 + .../vision/v1/GetReferenceImageRequest.java | 591 +++ .../v1/GetReferenceImageRequestOrBuilder.java | 31 + .../cloud/vision/v1/ImageAnnotatorProto.java | 383 +- .../google/cloud/vision/v1/ImageContext.java | 229 + .../vision/v1/ImageContextOrBuilder.java | 25 + .../com/google/cloud/vision/v1/ImageName.java | 235 ++ .../vision/v1/ImportProductSetsGcsSource.java | 901 ++++ .../ImportProductSetsGcsSourceOrBuilder.java | 119 + .../v1/ImportProductSetsInputConfig.java | 754 ++++ ...ImportProductSetsInputConfigOrBuilder.java | 39 + .../vision/v1/ImportProductSetsRequest.java | 813 ++++ .../v1/ImportProductSetsRequestOrBuilder.java | 54 + .../vision/v1/ImportProductSetsResponse.java | 1392 ++++++ .../ImportProductSetsResponseOrBuilder.java | 117 + .../vision/v1/ListProductSetsRequest.java | 813 ++++ .../v1/ListProductSetsRequestOrBuilder.java | 56 + .../vision/v1/ListProductSetsResponse.java | 1024 +++++ .../v1/ListProductSetsResponseOrBuilder.java | 73 + .../v1/ListProductsInProductSetRequest.java | 820 ++++ ...tProductsInProductSetRequestOrBuilder.java | 58 + .../v1/ListProductsInProductSetResponse.java | 1024 +++++ ...ProductsInProductSetResponseOrBuilder.java | 73 + .../cloud/vision/v1/ListProductsRequest.java | 820 ++++ .../v1/ListProductsRequestOrBuilder.java | 58 + .../cloud/vision/v1/ListProductsResponse.java | 1024 +++++ .../v1/ListProductsResponseOrBuilder.java | 73 + .../vision/v1/ListReferenceImagesRequest.java | 834 ++++ .../ListReferenceImagesRequestOrBuilder.java | 62 + .../v1/ListReferenceImagesResponse.java | 1091 +++++ .../ListReferenceImagesResponseOrBuilder.java | 80 + .../google/cloud/vision/v1/LocationName.java | 189 + .../com/google/cloud/vision/v1/Product.java | 2454 +++++++++++ .../google/cloud/vision/v1/ProductName.java | 212 + .../cloud/vision/v1/ProductOrBuilder.java | 169 + .../cloud/vision/v1/ProductSearchParams.java | 1268 ++++++ .../v1/ProductSearchParamsOrBuilder.java | 128 + .../cloud/vision/v1/ProductSearchProto.java | 119 + .../cloud/vision/v1/ProductSearchResults.java | 3716 +++++++++++++++++ .../v1/ProductSearchResultsOrBuilder.java | 140 + .../vision/v1/ProductSearchServiceProto.java | 555 +++ .../google/cloud/vision/v1/ProductSet.java | 1282 ++++++ .../cloud/vision/v1/ProductSetName.java | 212 + .../cloud/vision/v1/ProductSetOrBuilder.java | 118 + .../cloud/vision/v1/ReferenceImage.java | 1347 ++++++ .../vision/v1/ReferenceImageOrBuilder.java | 129 + .../RemoveProductFromProductSetRequest.java | 760 ++++ ...ProductFromProductSetRequestOrBuilder.java | 53 + .../cloud/vision/v1/UpdateProductRequest.java | 940 +++++ .../v1/UpdateProductRequestOrBuilder.java | 74 + .../vision/v1/UpdateProductSetRequest.java | 916 ++++ .../v1/UpdateProductSetRequestOrBuilder.java | 68 + .../google/cloud/vision/v1/WebDetection.java | 69 +- .../vision/v1/WebDetectionOrBuilder.java | 15 +- .../google/cloud/vision/v1/geometry.proto | 7 +- .../cloud/vision/v1/image_annotator.proto | 19 +- .../cloud/vision/v1/product_search.proto | 97 + .../vision/v1/product_search_service.proto | 834 ++++ .../cloud/vision/v1/text_annotation.proto | 3 +- .../cloud/vision/v1/web_detection.proto | 7 +- .../pom.xml | 7 +- .../pom.xml | 7 +- .../cloud/vision/v1/ProductSearchClient.java | 2546 +++++++++++ .../vision/v1/ProductSearchSettings.java | 398 ++ .../google/cloud/vision/v1/package-info.java | 33 +- .../GrpcProductSearchCallableFactory.java | 116 + .../vision/v1/stub/GrpcProductSearchStub.java | 630 +++ .../vision/v1/stub/ProductSearchStub.java | 180 + .../v1/stub/ProductSearchStubSettings.java | 1046 +++++ .../vision/v1/ImageAnnotatorClientTest.java | 5 +- .../cloud/vision/v1/MockProductSearch.java | 57 + .../vision/v1/MockProductSearchImpl.java | 330 ++ .../vision/v1/ProductSearchClientTest.java | 924 ++++ 100 files changed, 46602 insertions(+), 251 deletions(-) create mode 100644 google-api-grpc/grpc-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchGrpc.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AddProductToProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AddProductToProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/BatchOperationMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/BatchOperationMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateReferenceImageRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateReferenceImageRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteReferenceImageRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteReferenceImageRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetProductRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetProductRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetReferenceImageRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetReferenceImageRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageName.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsGcsSource.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsGcsSourceOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsInputConfig.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsInputConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesResponse.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/LocationName.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/Product.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductName.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchParams.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchParamsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchResults.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchResultsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchServiceProto.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSet.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSetName.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSetOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ReferenceImage.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ReferenceImageOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/RemoveProductFromProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/RemoveProductFromProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductSetRequest.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductSetRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/product_search.proto create mode 100644 google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/product_search_service.proto create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchSettings.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcProductSearchCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcProductSearchStub.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStub.java create mode 100644 google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStubSettings.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/MockProductSearch.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/MockProductSearchImpl.java create mode 100644 google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ProductSearchClientTest.java diff --git a/google-api-grpc/grpc-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchGrpc.java b/google-api-grpc/grpc-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchGrpc.java new file mode 100644 index 000000000000..5be9ed06337f --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchGrpc.java @@ -0,0 +1,2266 @@ +package com.google.cloud.vision.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * Manages Products and ProductSets of reference images for use in product
+ * search. It uses the following resource model:
+ * - The API has a collection of [ProductSet][google.cloud.vision.v1.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.v1.Product] resources, named
+ *   `projects/*/locations/*/products/*`
+ * - Each [Product][google.cloud.vision.v1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, named
+ *   `projects/*/locations/*/products/*/referenceImages/*`
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/vision/v1/product_search_service.proto") +public final class ProductSearchGrpc { + + private ProductSearchGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.vision.v1.ProductSearch"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_PRODUCT_SET = getCreateProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateProductSetMethod() { + return getCreateProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateProductSetMethodHelper() { + io.grpc.MethodDescriptor getCreateProductSetMethod; + if ((getCreateProductSetMethod = ProductSearchGrpc.getCreateProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getCreateProductSetMethod = ProductSearchGrpc.getCreateProductSetMethod) == null) { + ProductSearchGrpc.getCreateProductSetMethod = getCreateProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "CreateProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.CreateProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ProductSet.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("CreateProductSet")) + .build(); + } + } + } + return getCreateProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListProductSetsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_PRODUCT_SETS = getListProductSetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListProductSetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListProductSetsMethod() { + return getListProductSetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListProductSetsMethodHelper() { + io.grpc.MethodDescriptor getListProductSetsMethod; + if ((getListProductSetsMethod = ProductSearchGrpc.getListProductSetsMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getListProductSetsMethod = ProductSearchGrpc.getListProductSetsMethod) == null) { + ProductSearchGrpc.getListProductSetsMethod = getListProductSetsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "ListProductSets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ListProductSetsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ListProductSetsResponse.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("ListProductSets")) + .build(); + } + } + } + return getListProductSetsMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_PRODUCT_SET = getGetProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetProductSetMethod() { + return getGetProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetProductSetMethodHelper() { + io.grpc.MethodDescriptor getGetProductSetMethod; + if ((getGetProductSetMethod = ProductSearchGrpc.getGetProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getGetProductSetMethod = ProductSearchGrpc.getGetProductSetMethod) == null) { + ProductSearchGrpc.getGetProductSetMethod = getGetProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "GetProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.GetProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ProductSet.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("GetProductSet")) + .build(); + } + } + } + return getGetProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_PRODUCT_SET = getUpdateProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateProductSetMethod() { + return getUpdateProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateProductSetMethodHelper() { + io.grpc.MethodDescriptor getUpdateProductSetMethod; + if ((getUpdateProductSetMethod = ProductSearchGrpc.getUpdateProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getUpdateProductSetMethod = ProductSearchGrpc.getUpdateProductSetMethod) == null) { + ProductSearchGrpc.getUpdateProductSetMethod = getUpdateProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "UpdateProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.UpdateProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ProductSet.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("UpdateProductSet")) + .build(); + } + } + } + return getUpdateProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_PRODUCT_SET = getDeleteProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteProductSetMethod() { + return getDeleteProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteProductSetMethodHelper() { + io.grpc.MethodDescriptor getDeleteProductSetMethod; + if ((getDeleteProductSetMethod = ProductSearchGrpc.getDeleteProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getDeleteProductSetMethod = ProductSearchGrpc.getDeleteProductSetMethod) == null) { + ProductSearchGrpc.getDeleteProductSetMethod = getDeleteProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "DeleteProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.DeleteProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("DeleteProductSet")) + .build(); + } + } + } + return getDeleteProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateProductMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_PRODUCT = getCreateProductMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateProductMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateProductMethod() { + return getCreateProductMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateProductMethodHelper() { + io.grpc.MethodDescriptor getCreateProductMethod; + if ((getCreateProductMethod = ProductSearchGrpc.getCreateProductMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getCreateProductMethod = ProductSearchGrpc.getCreateProductMethod) == null) { + ProductSearchGrpc.getCreateProductMethod = getCreateProductMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "CreateProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.CreateProductRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.Product.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("CreateProduct")) + .build(); + } + } + } + return getCreateProductMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListProductsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_PRODUCTS = getListProductsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListProductsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListProductsMethod() { + return getListProductsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListProductsMethodHelper() { + io.grpc.MethodDescriptor getListProductsMethod; + if ((getListProductsMethod = ProductSearchGrpc.getListProductsMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getListProductsMethod = ProductSearchGrpc.getListProductsMethod) == null) { + ProductSearchGrpc.getListProductsMethod = getListProductsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "ListProducts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ListProductsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ListProductsResponse.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("ListProducts")) + .build(); + } + } + } + return getListProductsMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetProductMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_PRODUCT = getGetProductMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetProductMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetProductMethod() { + return getGetProductMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetProductMethodHelper() { + io.grpc.MethodDescriptor getGetProductMethod; + if ((getGetProductMethod = ProductSearchGrpc.getGetProductMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getGetProductMethod = ProductSearchGrpc.getGetProductMethod) == null) { + ProductSearchGrpc.getGetProductMethod = getGetProductMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "GetProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.GetProductRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.Product.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("GetProduct")) + .build(); + } + } + } + return getGetProductMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateProductMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_PRODUCT = getUpdateProductMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateProductMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateProductMethod() { + return getUpdateProductMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateProductMethodHelper() { + io.grpc.MethodDescriptor getUpdateProductMethod; + if ((getUpdateProductMethod = ProductSearchGrpc.getUpdateProductMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getUpdateProductMethod = ProductSearchGrpc.getUpdateProductMethod) == null) { + ProductSearchGrpc.getUpdateProductMethod = getUpdateProductMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "UpdateProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.UpdateProductRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.Product.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("UpdateProduct")) + .build(); + } + } + } + return getUpdateProductMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteProductMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_PRODUCT = getDeleteProductMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteProductMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteProductMethod() { + return getDeleteProductMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteProductMethodHelper() { + io.grpc.MethodDescriptor getDeleteProductMethod; + if ((getDeleteProductMethod = ProductSearchGrpc.getDeleteProductMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getDeleteProductMethod = ProductSearchGrpc.getDeleteProductMethod) == null) { + ProductSearchGrpc.getDeleteProductMethod = getDeleteProductMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "DeleteProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.DeleteProductRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("DeleteProduct")) + .build(); + } + } + } + return getDeleteProductMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateReferenceImageMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_REFERENCE_IMAGE = getCreateReferenceImageMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateReferenceImageMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateReferenceImageMethod() { + return getCreateReferenceImageMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateReferenceImageMethodHelper() { + io.grpc.MethodDescriptor getCreateReferenceImageMethod; + if ((getCreateReferenceImageMethod = ProductSearchGrpc.getCreateReferenceImageMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getCreateReferenceImageMethod = ProductSearchGrpc.getCreateReferenceImageMethod) == null) { + ProductSearchGrpc.getCreateReferenceImageMethod = getCreateReferenceImageMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "CreateReferenceImage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.CreateReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ReferenceImage.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("CreateReferenceImage")) + .build(); + } + } + } + return getCreateReferenceImageMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteReferenceImageMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_REFERENCE_IMAGE = getDeleteReferenceImageMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteReferenceImageMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteReferenceImageMethod() { + return getDeleteReferenceImageMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteReferenceImageMethodHelper() { + io.grpc.MethodDescriptor getDeleteReferenceImageMethod; + if ((getDeleteReferenceImageMethod = ProductSearchGrpc.getDeleteReferenceImageMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getDeleteReferenceImageMethod = ProductSearchGrpc.getDeleteReferenceImageMethod) == null) { + ProductSearchGrpc.getDeleteReferenceImageMethod = getDeleteReferenceImageMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "DeleteReferenceImage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.DeleteReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("DeleteReferenceImage")) + .build(); + } + } + } + return getDeleteReferenceImageMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListReferenceImagesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_REFERENCE_IMAGES = getListReferenceImagesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListReferenceImagesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListReferenceImagesMethod() { + return getListReferenceImagesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListReferenceImagesMethodHelper() { + io.grpc.MethodDescriptor getListReferenceImagesMethod; + if ((getListReferenceImagesMethod = ProductSearchGrpc.getListReferenceImagesMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getListReferenceImagesMethod = ProductSearchGrpc.getListReferenceImagesMethod) == null) { + ProductSearchGrpc.getListReferenceImagesMethod = getListReferenceImagesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "ListReferenceImages")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ListReferenceImagesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ListReferenceImagesResponse.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("ListReferenceImages")) + .build(); + } + } + } + return getListReferenceImagesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetReferenceImageMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_REFERENCE_IMAGE = getGetReferenceImageMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetReferenceImageMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetReferenceImageMethod() { + return getGetReferenceImageMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetReferenceImageMethodHelper() { + io.grpc.MethodDescriptor getGetReferenceImageMethod; + if ((getGetReferenceImageMethod = ProductSearchGrpc.getGetReferenceImageMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getGetReferenceImageMethod = ProductSearchGrpc.getGetReferenceImageMethod) == null) { + ProductSearchGrpc.getGetReferenceImageMethod = getGetReferenceImageMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "GetReferenceImage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.GetReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ReferenceImage.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("GetReferenceImage")) + .build(); + } + } + } + return getGetReferenceImageMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getAddProductToProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_ADD_PRODUCT_TO_PRODUCT_SET = getAddProductToProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getAddProductToProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getAddProductToProductSetMethod() { + return getAddProductToProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getAddProductToProductSetMethodHelper() { + io.grpc.MethodDescriptor getAddProductToProductSetMethod; + if ((getAddProductToProductSetMethod = ProductSearchGrpc.getAddProductToProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getAddProductToProductSetMethod = ProductSearchGrpc.getAddProductToProductSetMethod) == null) { + ProductSearchGrpc.getAddProductToProductSetMethod = getAddProductToProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "AddProductToProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.AddProductToProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("AddProductToProductSet")) + .build(); + } + } + } + return getAddProductToProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getRemoveProductFromProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_REMOVE_PRODUCT_FROM_PRODUCT_SET = getRemoveProductFromProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getRemoveProductFromProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getRemoveProductFromProductSetMethod() { + return getRemoveProductFromProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getRemoveProductFromProductSetMethodHelper() { + io.grpc.MethodDescriptor getRemoveProductFromProductSetMethod; + if ((getRemoveProductFromProductSetMethod = ProductSearchGrpc.getRemoveProductFromProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getRemoveProductFromProductSetMethod = ProductSearchGrpc.getRemoveProductFromProductSetMethod) == null) { + ProductSearchGrpc.getRemoveProductFromProductSetMethod = getRemoveProductFromProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "RemoveProductFromProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.RemoveProductFromProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("RemoveProductFromProductSet")) + .build(); + } + } + } + return getRemoveProductFromProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListProductsInProductSetMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_PRODUCTS_IN_PRODUCT_SET = getListProductsInProductSetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListProductsInProductSetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListProductsInProductSetMethod() { + return getListProductsInProductSetMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListProductsInProductSetMethodHelper() { + io.grpc.MethodDescriptor getListProductsInProductSetMethod; + if ((getListProductsInProductSetMethod = ProductSearchGrpc.getListProductsInProductSetMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getListProductsInProductSetMethod = ProductSearchGrpc.getListProductsInProductSetMethod) == null) { + ProductSearchGrpc.getListProductsInProductSetMethod = getListProductsInProductSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "ListProductsInProductSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ListProductsInProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.ListProductsInProductSetResponse.getDefaultInstance())) + .setSchemaDescriptor(new ProductSearchMethodDescriptorSupplier("ListProductsInProductSet")) + .build(); + } + } + } + return getListProductsInProductSetMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getImportProductSetsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_IMPORT_PRODUCT_SETS = getImportProductSetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getImportProductSetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getImportProductSetsMethod() { + return getImportProductSetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getImportProductSetsMethodHelper() { + io.grpc.MethodDescriptor getImportProductSetsMethod; + if ((getImportProductSetsMethod = ProductSearchGrpc.getImportProductSetsMethod) == null) { + synchronized (ProductSearchGrpc.class) { + if ((getImportProductSetsMethod = ProductSearchGrpc.getImportProductSetsMethod) == null) { + ProductSearchGrpc.getImportProductSetsMethod = getImportProductSetsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.vision.v1.ProductSearch", "ImportProductSets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vision.v1.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.v1.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.v1.Product] resources, named
+   *   `projects/*/locations/*/products/*`
+   * - Each [Product][google.cloud.vision.v1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, named
+   *   `projects/*/locations/*/products/*/referenceImages/*`
+   * 
+ */ + public static abstract class ProductSearchImplBase implements io.grpc.BindableService { + + /** + *
+     * Creates and returns a new ProductSet resource.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
+     *   4096 characters.
+     * 
+ */ + public void createProductSet(com.google.cloud.vision.v1.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.v1.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.v1.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.v1.UpdateProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateProductSetMethodHelper(), responseObserver); + } + + /** + *
+     * Permanently deletes a ProductSet. All Products and ReferenceImages in the
+     * ProductSet will be deleted.
+     * The actual image files are not deleted from Google Cloud Storage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public void deleteProductSet(com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.ListProductsInProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListProductsInProductSetMethodHelper(), responseObserver); + } + + /** + *
+     * Asynchronous API that imports a list of reference images to specified
+     * product sets based on a list of image information.
+     * The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the
+     * progress and results of the request.
+     * `Operation.metadata` contains `BatchOperationMetadata`. (progress)
+     * `Operation.response` contains `ImportProductSetsResponse`. (results)
+     * The input source of this method is a csv file on Google Cloud Storage.
+     * For the format of the csv file please see
+     * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].
+     * 
+ */ + public void importProductSets(com.google.cloud.vision.v1.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.v1.CreateProductSetRequest, + com.google.cloud.vision.v1.ProductSet>( + this, METHODID_CREATE_PRODUCT_SET))) + .addMethod( + getListProductSetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.ListProductSetsRequest, + com.google.cloud.vision.v1.ListProductSetsResponse>( + this, METHODID_LIST_PRODUCT_SETS))) + .addMethod( + getGetProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.GetProductSetRequest, + com.google.cloud.vision.v1.ProductSet>( + this, METHODID_GET_PRODUCT_SET))) + .addMethod( + getUpdateProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.UpdateProductSetRequest, + com.google.cloud.vision.v1.ProductSet>( + this, METHODID_UPDATE_PRODUCT_SET))) + .addMethod( + getDeleteProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.DeleteProductSetRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_PRODUCT_SET))) + .addMethod( + getCreateProductMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.CreateProductRequest, + com.google.cloud.vision.v1.Product>( + this, METHODID_CREATE_PRODUCT))) + .addMethod( + getListProductsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.ListProductsRequest, + com.google.cloud.vision.v1.ListProductsResponse>( + this, METHODID_LIST_PRODUCTS))) + .addMethod( + getGetProductMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.GetProductRequest, + com.google.cloud.vision.v1.Product>( + this, METHODID_GET_PRODUCT))) + .addMethod( + getUpdateProductMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.UpdateProductRequest, + com.google.cloud.vision.v1.Product>( + this, METHODID_UPDATE_PRODUCT))) + .addMethod( + getDeleteProductMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.DeleteProductRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_PRODUCT))) + .addMethod( + getCreateReferenceImageMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.CreateReferenceImageRequest, + com.google.cloud.vision.v1.ReferenceImage>( + this, METHODID_CREATE_REFERENCE_IMAGE))) + .addMethod( + getDeleteReferenceImageMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.DeleteReferenceImageRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_REFERENCE_IMAGE))) + .addMethod( + getListReferenceImagesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.ListReferenceImagesRequest, + com.google.cloud.vision.v1.ListReferenceImagesResponse>( + this, METHODID_LIST_REFERENCE_IMAGES))) + .addMethod( + getGetReferenceImageMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.GetReferenceImageRequest, + com.google.cloud.vision.v1.ReferenceImage>( + this, METHODID_GET_REFERENCE_IMAGE))) + .addMethod( + getAddProductToProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.AddProductToProductSetRequest, + com.google.protobuf.Empty>( + this, METHODID_ADD_PRODUCT_TO_PRODUCT_SET))) + .addMethod( + getRemoveProductFromProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.RemoveProductFromProductSetRequest, + com.google.protobuf.Empty>( + this, METHODID_REMOVE_PRODUCT_FROM_PRODUCT_SET))) + .addMethod( + getListProductsInProductSetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.ListProductsInProductSetRequest, + com.google.cloud.vision.v1.ListProductsInProductSetResponse>( + this, METHODID_LIST_PRODUCTS_IN_PRODUCT_SET))) + .addMethod( + getImportProductSetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vision.v1.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.v1.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.v1.Product] resources, named
+   *   `projects/*/locations/*/products/*`
+   * - Each [Product][google.cloud.vision.v1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.UpdateProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateProductSetMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Permanently deletes a ProductSet. All Products and ReferenceImages in the
+     * ProductSet will be deleted.
+     * The actual image files are not deleted from Google Cloud Storage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public void deleteProductSet(com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.ListProductsInProductSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListProductsInProductSetMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Asynchronous API that imports a list of reference images to specified
+     * product sets based on a list of image information.
+     * The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the
+     * progress and results of the request.
+     * `Operation.metadata` contains `BatchOperationMetadata`. (progress)
+     * `Operation.response` contains `ImportProductSetsResponse`. (results)
+     * The input source of this method is a csv file on Google Cloud Storage.
+     * For the format of the csv file please see
+     * [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].
+     * 
+ */ + public void importProductSets(com.google.cloud.vision.v1.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.v1.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.v1.Product] resources, named
+   *   `projects/*/locations/*/products/*`
+   * - Each [Product][google.cloud.vision.v1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1.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.v1.ProductSet createProductSet(com.google.cloud.vision.v1.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.v1.ListProductSetsResponse listProductSets(com.google.cloud.vision.v1.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.v1.ProductSet getProductSet(com.google.cloud.vision.v1.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.v1.ProductSet updateProductSet(com.google.cloud.vision.v1.UpdateProductSetRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateProductSetMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Permanently deletes a ProductSet. All Products and ReferenceImages in the
+     * ProductSet will be deleted.
+     * The actual image files are not deleted from Google Cloud Storage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public com.google.protobuf.Empty deleteProductSet(com.google.cloud.vision.v1.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.v1.Product createProduct(com.google.cloud.vision.v1.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.v1.ListProductsResponse listProducts(com.google.cloud.vision.v1.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.v1.Product getProduct(com.google.cloud.vision.v1.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.v1.Product updateProduct(com.google.cloud.vision.v1.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.v1.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.v1.ReferenceImage createReferenceImage(com.google.cloud.vision.v1.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.v1.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.v1.ListReferenceImagesResponse listReferenceImages(com.google.cloud.vision.v1.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.v1.ReferenceImage getReferenceImage(com.google.cloud.vision.v1.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.v1.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.v1.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.v1.ListProductsInProductSetResponse listProductsInProductSet(com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource.csv_file_uri].
+     * 
+ */ + public com.google.longrunning.Operation importProductSets(com.google.cloud.vision.v1.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.v1.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.v1.Product] resources, named
+   *   `projects/*/locations/*/products/*`
+   * - Each [Product][google.cloud.vision.v1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, named
+   *   `projects/*/locations/*/products/*/referenceImages/*`
+   * 
+ */ + public static final class ProductSearchFutureStub extends io.grpc.stub.AbstractStub { + private ProductSearchFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private ProductSearchFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProductSearchFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ProductSearchFutureStub(channel, callOptions); + } + + /** + *
+     * Creates and returns a new ProductSet resource.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
+     *   4096 characters.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createProductSet( + com.google.cloud.vision.v1.CreateProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateProductSetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists ProductSets in an unspecified order.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
+     *   than 1.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listProductSets( + com.google.cloud.vision.v1.ListProductSetsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListProductSetsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets information associated with a ProductSet.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getProductSet( + com.google.cloud.vision.v1.GetProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetProductSetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Makes changes to a ProductSet resource.
+     * Only display_name can be updated currently.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * * Returns INVALID_ARGUMENT if display_name is present in update_mask but
+     *   missing from the request or longer than 4096 characters.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateProductSet( + com.google.cloud.vision.v1.UpdateProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateProductSetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Permanently deletes a ProductSet. All Products and ReferenceImages in the
+     * ProductSet will be deleted.
+     * The actual image files are not deleted from Google Cloud Storage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the ProductSet does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteProductSet( + com.google.cloud.vision.v1.DeleteProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteProductSetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates and returns a new product resource.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
+     *   characters.
+     * * Returns INVALID_ARGUMENT if description is longer than 4096 characters.
+     * * Returns INVALID_ARGUMENT if product_category is missing or invalid.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createProduct( + com.google.cloud.vision.v1.CreateProductRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateProductMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists products in an unspecified order.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listProducts( + com.google.cloud.vision.v1.ListProductsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListProductsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets information associated with a Product.
+     * Possible errors:
+     * * Returns NOT_FOUND if the Product does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getProduct( + com.google.cloud.vision.v1.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 updateProduct( + com.google.cloud.vision.v1.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.v1.DeleteProductRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteProductMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates and returns a new ReferenceImage resource.
+     * The `bounding_poly` field is optional. If `bounding_poly` is not specified,
+     * the system will try to detect regions of interest in the image that are
+     * compatible with the product_category on the parent product. If it is
+     * specified, detection is ALWAYS skipped. The system converts polygons into
+     * non-rotated rectangles.
+     * Note that the pipeline will resize the image if the image resolution is too
+     * large to process (above 50MP).
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
+     *   characters.
+     * * Returns INVALID_ARGUMENT if the product does not exist.
+     * * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
+     *   compatible with the parent product's product_category is detected.
+     * * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createReferenceImage( + com.google.cloud.vision.v1.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.v1.DeleteReferenceImageRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteReferenceImageMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists reference images.
+     * Possible errors:
+     * * Returns NOT_FOUND if the parent product does not exist.
+     * * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
+     *   than 1.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listReferenceImages( + com.google.cloud.vision.v1.ListReferenceImagesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListReferenceImagesMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets information associated with a ReferenceImage.
+     * Possible errors:
+     * * Returns NOT_FOUND if the specified image does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getReferenceImage( + com.google.cloud.vision.v1.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.v1.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.v1.RemoveProductFromProductSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getRemoveProductFromProductSetMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists the Products in a ProductSet, in an unspecified order. If the
+     * ProductSet does not exist, the products field of the response will be
+     * empty.
+     * Possible errors:
+     * * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listProductsInProductSet( + com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource.csv_file_uri].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture importProductSets( + com.google.cloud.vision.v1.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.v1.CreateProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_PRODUCT_SETS: + serviceImpl.listProductSets((com.google.cloud.vision.v1.ListProductSetsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_PRODUCT_SET: + serviceImpl.getProductSet((com.google.cloud.vision.v1.GetProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_PRODUCT_SET: + serviceImpl.updateProductSet((com.google.cloud.vision.v1.UpdateProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_PRODUCT_SET: + serviceImpl.deleteProductSet((com.google.cloud.vision.v1.DeleteProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_PRODUCT: + serviceImpl.createProduct((com.google.cloud.vision.v1.CreateProductRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_PRODUCTS: + serviceImpl.listProducts((com.google.cloud.vision.v1.ListProductsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_PRODUCT: + serviceImpl.getProduct((com.google.cloud.vision.v1.GetProductRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_PRODUCT: + serviceImpl.updateProduct((com.google.cloud.vision.v1.UpdateProductRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_PRODUCT: + serviceImpl.deleteProduct((com.google.cloud.vision.v1.DeleteProductRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_REFERENCE_IMAGE: + serviceImpl.createReferenceImage((com.google.cloud.vision.v1.CreateReferenceImageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_REFERENCE_IMAGE: + serviceImpl.deleteReferenceImage((com.google.cloud.vision.v1.DeleteReferenceImageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_REFERENCE_IMAGES: + serviceImpl.listReferenceImages((com.google.cloud.vision.v1.ListReferenceImagesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_REFERENCE_IMAGE: + serviceImpl.getReferenceImage((com.google.cloud.vision.v1.GetReferenceImageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ADD_PRODUCT_TO_PRODUCT_SET: + serviceImpl.addProductToProductSet((com.google.cloud.vision.v1.AddProductToProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_PRODUCT_FROM_PRODUCT_SET: + serviceImpl.removeProductFromProductSet((com.google.cloud.vision.v1.RemoveProductFromProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_PRODUCTS_IN_PRODUCT_SET: + serviceImpl.listProductsInProductSet((com.google.cloud.vision.v1.ListProductsInProductSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_PRODUCT_SETS: + serviceImpl.importProductSets((com.google.cloud.vision.v1.ImportProductSetsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class ProductSearchBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ProductSearchBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.vision.v1.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/proto-google-cloud-vision-v1/pom.xml b/google-api-grpc/proto-google-cloud-vision-v1/pom.xml index a7e72c04666d..39d4bb936dcd 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/pom.xml +++ b/google-api-grpc/proto-google-cloud-vision-v1/pom.xml @@ -17,10 +17,15 @@ protobuf-java compile + + com.google.api + api-common + compile + com.google.api.grpc proto-google-common-protos compile - \ No newline at end of file + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AddProductToProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AddProductToProductSetRequest.java new file mode 100644 index 000000000000..f30bbd781cc8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AddProductToProductSetRequest.java @@ -0,0 +1,760 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `AddProductToProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.AddProductToProductSetRequest} + */ +public final class AddProductToProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_AddProductToProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_AddProductToProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.AddProductToProductSetRequest.class, com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.AddProductToProductSetRequest other = (com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.AddProductToProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.AddProductToProductSetRequest) + com.google.cloud.vision.v1.AddProductToProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_AddProductToProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_AddProductToProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.AddProductToProductSetRequest.class, com.google.cloud.vision.v1.AddProductToProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_AddProductToProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.AddProductToProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.AddProductToProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.AddProductToProductSetRequest build() { + com.google.cloud.vision.v1.AddProductToProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.AddProductToProductSetRequest buildPartial() { + com.google.cloud.vision.v1.AddProductToProductSetRequest result = new com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1.AddProductToProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.AddProductToProductSetRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.AddProductToProductSetRequest) + private static final com.google.cloud.vision.v1.AddProductToProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.AddProductToProductSetRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AddProductToProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AddProductToProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..b1a6b4ec8261 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AddProductToProductSetRequestOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface AddProductToProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/AnnotateImageResponse.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AnnotateImageResponse.java index 0f092bd9e73b..3743bd28128c 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AnnotateImageResponse.java +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AnnotateImageResponse.java @@ -175,6 +175,19 @@ private AnnotateImageResponse( break; } + case 114: { + com.google.cloud.vision.v1.ProductSearchResults.Builder subBuilder = null; + if (productSearchResults_ != null) { + subBuilder = productSearchResults_.toBuilder(); + } + productSearchResults_ = input.readMessage(com.google.cloud.vision.v1.ProductSearchResults.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(productSearchResults_); + productSearchResults_ = subBuilder.buildPartial(); + } + + break; + } case 170: { com.google.cloud.vision.v1.ImageAnnotationContext.Builder subBuilder = null; if (context_ != null) { @@ -757,6 +770,39 @@ public com.google.cloud.vision.v1.WebDetectionOrBuilder getWebDetectionOrBuilder return getWebDetection(); } + public static final int PRODUCT_SEARCH_RESULTS_FIELD_NUMBER = 14; + private com.google.cloud.vision.v1.ProductSearchResults productSearchResults_; + /** + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1.ProductSearchResults product_search_results = 14; + */ + public boolean hasProductSearchResults() { + return productSearchResults_ != null; + } + /** + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1.ProductSearchResults getProductSearchResults() { + return productSearchResults_ == null ? com.google.cloud.vision.v1.ProductSearchResults.getDefaultInstance() : productSearchResults_; + } + /** + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1.ProductSearchResultsOrBuilder getProductSearchResultsOrBuilder() { + return getProductSearchResults(); + } + public static final int ERROR_FIELD_NUMBER = 9; private com.google.rpc.Status error_; /** @@ -879,6 +925,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (webDetection_ != null) { output.writeMessage(13, getWebDetection()); } + if (productSearchResults_ != null) { + output.writeMessage(14, getProductSearchResults()); + } if (context_ != null) { output.writeMessage(21, getContext()); } @@ -938,6 +987,10 @@ public int getSerializedSize() { 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()); @@ -999,6 +1052,11 @@ public boolean equals(final java.lang.Object obj) { 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() @@ -1064,6 +1122,10 @@ public int hashCode() { 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(); @@ -1281,6 +1343,12 @@ public Builder clear() { webDetection_ = null; webDetectionBuilder_ = null; } + if (productSearchResultsBuilder_ == null) { + productSearchResults_ = null; + } else { + productSearchResults_ = null; + productSearchResultsBuilder_ = null; + } if (errorBuilder_ == null) { error_ = null; } else { @@ -1400,6 +1468,11 @@ public com.google.cloud.vision.v1.AnnotateImageResponse buildPartial() { } else { result.webDetection_ = webDetectionBuilder_.build(); } + if (productSearchResultsBuilder_ == null) { + result.productSearchResults_ = productSearchResults_; + } else { + result.productSearchResults_ = productSearchResultsBuilder_.build(); + } if (errorBuilder_ == null) { result.error_ = error_; } else { @@ -1630,6 +1703,9 @@ public Builder mergeFrom(com.google.cloud.vision.v1.AnnotateImageResponse other) if (other.hasWebDetection()) { mergeWebDetection(other.getWebDetection()); } + if (other.hasProductSearchResults()) { + mergeProductSearchResults(other.getProductSearchResults()); + } if (other.hasError()) { mergeError(other.getError()); } @@ -4348,6 +4424,159 @@ public com.google.cloud.vision.v1.WebDetectionOrBuilder getWebDetectionOrBuilder return webDetectionBuilder_; } + private com.google.cloud.vision.v1.ProductSearchResults productSearchResults_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchResults, com.google.cloud.vision.v1.ProductSearchResults.Builder, com.google.cloud.vision.v1.ProductSearchResultsOrBuilder> productSearchResultsBuilder_; + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1.ProductSearchResults product_search_results = 14; + */ + public boolean hasProductSearchResults() { + return productSearchResultsBuilder_ != null || productSearchResults_ != null; + } + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1.ProductSearchResults getProductSearchResults() { + if (productSearchResultsBuilder_ == null) { + return productSearchResults_ == null ? com.google.cloud.vision.v1.ProductSearchResults.getDefaultInstance() : productSearchResults_; + } else { + return productSearchResultsBuilder_.getMessage(); + } + } + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1.ProductSearchResults product_search_results = 14; + */ + public Builder setProductSearchResults(com.google.cloud.vision.v1.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.v1.ProductSearchResults product_search_results = 14; + */ + public Builder setProductSearchResults( + com.google.cloud.vision.v1.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.v1.ProductSearchResults product_search_results = 14; + */ + public Builder mergeProductSearchResults(com.google.cloud.vision.v1.ProductSearchResults value) { + if (productSearchResultsBuilder_ == null) { + if (productSearchResults_ != null) { + productSearchResults_ = + com.google.cloud.vision.v1.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.v1.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.v1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1.ProductSearchResults.Builder getProductSearchResultsBuilder() { + + onChanged(); + return getProductSearchResultsFieldBuilder().getBuilder(); + } + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1.ProductSearchResults product_search_results = 14; + */ + public com.google.cloud.vision.v1.ProductSearchResultsOrBuilder getProductSearchResultsOrBuilder() { + if (productSearchResultsBuilder_ != null) { + return productSearchResultsBuilder_.getMessageOrBuilder(); + } else { + return productSearchResults_ == null ? + com.google.cloud.vision.v1.ProductSearchResults.getDefaultInstance() : productSearchResults_; + } + } + /** + *
+     * If present, product search has completed successfully.
+     * 
+ * + * .google.cloud.vision.v1.ProductSearchResults product_search_results = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchResults, com.google.cloud.vision.v1.ProductSearchResults.Builder, com.google.cloud.vision.v1.ProductSearchResultsOrBuilder> + getProductSearchResultsFieldBuilder() { + if (productSearchResultsBuilder_ == null) { + productSearchResultsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchResults, com.google.cloud.vision.v1.ProductSearchResults.Builder, com.google.cloud.vision.v1.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_; diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AnnotateImageResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AnnotateImageResponseOrBuilder.java index 4bc79dc9a5a2..cb57e93c8c22 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AnnotateImageResponseOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/AnnotateImageResponseOrBuilder.java @@ -410,6 +410,31 @@ com.google.cloud.vision.v1.EntityAnnotationOrBuilder getTextAnnotationsOrBuilder */ com.google.cloud.vision.v1.WebDetectionOrBuilder getWebDetectionOrBuilder(); + /** + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1.ProductSearchResults product_search_results = 14; + */ + boolean hasProductSearchResults(); + /** + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1.ProductSearchResults product_search_results = 14; + */ + com.google.cloud.vision.v1.ProductSearchResults getProductSearchResults(); + /** + *
+   * If present, product search has completed successfully.
+   * 
+ * + * .google.cloud.vision.v1.ProductSearchResults product_search_results = 14; + */ + com.google.cloud.vision.v1.ProductSearchResultsOrBuilder getProductSearchResultsOrBuilder(); + /** *
    * If set, represents the error message for the operation.
diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/BatchOperationMetadata.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/BatchOperationMetadata.java
new file mode 100644
index 000000000000..948503093be8
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/BatchOperationMetadata.java
@@ -0,0 +1,1184 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/cloud/vision/v1/product_search_service.proto
+
+package com.google.cloud.vision.v1;
+
+/**
+ * 
+ * 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.v1.BatchOperationMetadata} + */ +public final class BatchOperationMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_BatchOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_BatchOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.BatchOperationMetadata.class, com.google.cloud.vision.v1.BatchOperationMetadata.Builder.class); + } + + /** + *
+   * Enumerates the possible states that the batch request can be in.
+   * 
+ * + * Protobuf enum {@code google.cloud.vision.v1.BatchOperationMetadata.State} + */ + public enum State + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Invalid.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + *
+     * Request is actively being processed.
+     * 
+ * + * PROCESSING = 1; + */ + PROCESSING(1), + /** + *
+     * The request is done and at least one item has been successfully
+     * processed.
+     * 
+ * + * SUCCESSFUL = 2; + */ + SUCCESSFUL(2), + /** + *
+     * The request is done and no item has been successfully processed.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + *
+     * The request is done after the longrunning.Operations.CancelOperation has
+     * been called by the user.  Any records that were processed before the
+     * cancel command are output as specified in the request.
+     * 
+ * + * CANCELLED = 4; + */ + CANCELLED(4), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Invalid.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + *
+     * Request is actively being processed.
+     * 
+ * + * PROCESSING = 1; + */ + public static final int PROCESSING_VALUE = 1; + /** + *
+     * The request is done and at least one item has been successfully
+     * processed.
+     * 
+ * + * SUCCESSFUL = 2; + */ + public static final int SUCCESSFUL_VALUE = 2; + /** + *
+     * The request is done and no item has been successfully processed.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + /** + *
+     * The request is done after the longrunning.Operations.CancelOperation has
+     * been called by the user.  Any records that were processed before the
+     * cancel command are output as specified in the request.
+     * 
+ * + * CANCELLED = 4; + */ + public static final int CANCELLED_VALUE = 4; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + public static State forNumber(int value) { + switch (value) { + case 0: return STATE_UNSPECIFIED; + case 1: return PROCESSING; + case 2: return SUCCESSFUL; + case 3: return FAILED; + case 4: return CANCELLED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + State> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.vision.v1.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.v1.BatchOperationMetadata.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + *
+   * The current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1.BatchOperationMetadata.State state = 1; + */ + public int getStateValue() { + return state_; + } + /** + *
+   * The current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1.BatchOperationMetadata.State state = 1; + */ + public com.google.cloud.vision.v1.BatchOperationMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1.BatchOperationMetadata.State result = com.google.cloud.vision.v1.BatchOperationMetadata.State.valueOf(state_); + return result == null ? com.google.cloud.vision.v1.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.v1.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.v1.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.v1.BatchOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.BatchOperationMetadata other = (com.google.cloud.vision.v1.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.v1.BatchOperationMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.BatchOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.BatchOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.BatchOperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.BatchOperationMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.BatchOperationMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.BatchOperationMetadata) + com.google.cloud.vision.v1.BatchOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_BatchOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_BatchOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.BatchOperationMetadata.class, com.google.cloud.vision.v1.BatchOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_BatchOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.BatchOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.vision.v1.BatchOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.BatchOperationMetadata build() { + com.google.cloud.vision.v1.BatchOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.BatchOperationMetadata buildPartial() { + com.google.cloud.vision.v1.BatchOperationMetadata result = new com.google.cloud.vision.v1.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.v1.BatchOperationMetadata) { + return mergeFrom((com.google.cloud.vision.v1.BatchOperationMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.BatchOperationMetadata other) { + if (other == com.google.cloud.vision.v1.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.v1.BatchOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.BatchOperationMetadata.State state = 1; + */ + public int getStateValue() { + return state_; + } + /** + *
+     * The current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1.BatchOperationMetadata.State state = 1; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + *
+     * The current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1.BatchOperationMetadata.State state = 1; + */ + public com.google.cloud.vision.v1.BatchOperationMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.vision.v1.BatchOperationMetadata.State result = com.google.cloud.vision.v1.BatchOperationMetadata.State.valueOf(state_); + return result == null ? com.google.cloud.vision.v1.BatchOperationMetadata.State.UNRECOGNIZED : result; + } + /** + *
+     * The current state of the batch operation.
+     * 
+ * + * .google.cloud.vision.v1.BatchOperationMetadata.State state = 1; + */ + public Builder setState(com.google.cloud.vision.v1.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.v1.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.v1.BatchOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.BatchOperationMetadata) + private static final com.google.cloud.vision.v1.BatchOperationMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.BatchOperationMetadata(); + } + + public static com.google.cloud.vision.v1.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.v1.BatchOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/BatchOperationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/BatchOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..8fc2606591d8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/BatchOperationMetadataOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface BatchOperationMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.BatchOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1.BatchOperationMetadata.State state = 1; + */ + int getStateValue(); + /** + *
+   * The current state of the batch operation.
+   * 
+ * + * .google.cloud.vision.v1.BatchOperationMetadata.State state = 1; + */ + com.google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/CreateProductRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductRequest.java new file mode 100644 index 000000000000..76d09e7d00e2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductRequest.java @@ -0,0 +1,996 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `CreateProduct` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.CreateProductRequest} + */ +public final class CreateProductRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = input.readMessage(com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.CreateProductRequest.class, com.google.cloud.vision.v1.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.v1.Product product_; + /** + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1.Product product = 2; + */ + public boolean hasProduct() { + return product_ != null; + } + /** + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1.Product product = 2; + */ + public com.google.cloud.vision.v1.Product getProduct() { + return product_ == null ? com.google.cloud.vision.v1.Product.getDefaultInstance() : product_; + } + /** + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1.Product product = 2; + */ + public com.google.cloud.vision.v1.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.v1.CreateProductRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.CreateProductRequest other = (com.google.cloud.vision.v1.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.v1.CreateProductRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.CreateProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.CreateProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.CreateProductRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.CreateProductRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.CreateProductRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.CreateProductRequest) + com.google.cloud.vision.v1.CreateProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.CreateProductRequest.class, com.google.cloud.vision.v1.CreateProductRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.CreateProductRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.CreateProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.CreateProductRequest build() { + com.google.cloud.vision.v1.CreateProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.CreateProductRequest buildPartial() { + com.google.cloud.vision.v1.CreateProductRequest result = new com.google.cloud.vision.v1.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.v1.CreateProductRequest) { + return mergeFrom((com.google.cloud.vision.v1.CreateProductRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.CreateProductRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.CreateProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.Product product_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.ProductOrBuilder> productBuilder_; + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 2; + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 2; + */ + public com.google.cloud.vision.v1.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null ? com.google.cloud.vision.v1.Product.getDefaultInstance() : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 2; + */ + public Builder setProduct(com.google.cloud.vision.v1.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.v1.Product product = 2; + */ + public Builder setProduct( + com.google.cloud.vision.v1.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 2; + */ + public Builder mergeProduct(com.google.cloud.vision.v1.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.vision.v1.Product.newBuilder(product_).mergeFrom(value).buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1.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.v1.Product product = 2; + */ + public com.google.cloud.vision.v1.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 2; + */ + public com.google.cloud.vision.v1.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null ? + com.google.cloud.vision.v1.Product.getDefaultInstance() : product_; + } + } + /** + *
+     * The product to create.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.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.v1.CreateProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.CreateProductRequest) + private static final com.google.cloud.vision.v1.CreateProductRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.CreateProductRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.CreateProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductRequestOrBuilder.java new file mode 100644 index 000000000000..8a3604e1a972 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductRequestOrBuilder.java @@ -0,0 +1,80 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface CreateProductRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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.v1.Product product = 2; + */ + boolean hasProduct(); + /** + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1.Product product = 2; + */ + com.google.cloud.vision.v1.Product getProduct(); + /** + *
+   * The product to create.
+   * 
+ * + * .google.cloud.vision.v1.Product product = 2; + */ + com.google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/CreateProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductSetRequest.java new file mode 100644 index 000000000000..afa57b3c0a42 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductSetRequest.java @@ -0,0 +1,989 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `CreateProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.CreateProductSetRequest} + */ +public final class CreateProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSet.Builder subBuilder = null; + if (productSet_ != null) { + subBuilder = productSet_.toBuilder(); + } + productSet_ = input.readMessage(com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.CreateProductSetRequest.class, com.google.cloud.vision.v1.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.v1.ProductSet productSet_; + /** + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 2; + */ + public boolean hasProductSet() { + return productSet_ != null; + } + /** + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1.ProductSet getProductSet() { + return productSet_ == null ? com.google.cloud.vision.v1.ProductSet.getDefaultInstance() : productSet_; + } + /** + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1.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.v1.CreateProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.CreateProductSetRequest other = (com.google.cloud.vision.v1.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.v1.CreateProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.CreateProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.CreateProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.CreateProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.CreateProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.CreateProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.CreateProductSetRequest) + com.google.cloud.vision.v1.CreateProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.CreateProductSetRequest.class, com.google.cloud.vision.v1.CreateProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.CreateProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.CreateProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.CreateProductSetRequest build() { + com.google.cloud.vision.v1.CreateProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.CreateProductSetRequest buildPartial() { + com.google.cloud.vision.v1.CreateProductSetRequest result = new com.google.cloud.vision.v1.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.v1.CreateProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1.CreateProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.CreateProductSetRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.CreateProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.ProductSet productSet_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ProductSet, com.google.cloud.vision.v1.ProductSet.Builder, com.google.cloud.vision.v1.ProductSetOrBuilder> productSetBuilder_; + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 2; + */ + public boolean hasProductSet() { + return productSetBuilder_ != null || productSet_ != null; + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1.ProductSet getProductSet() { + if (productSetBuilder_ == null) { + return productSet_ == null ? com.google.cloud.vision.v1.ProductSet.getDefaultInstance() : productSet_; + } else { + return productSetBuilder_.getMessage(); + } + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 2; + */ + public Builder setProductSet(com.google.cloud.vision.v1.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.v1.ProductSet product_set = 2; + */ + public Builder setProductSet( + com.google.cloud.vision.v1.ProductSet.Builder builderForValue) { + if (productSetBuilder_ == null) { + productSet_ = builderForValue.build(); + onChanged(); + } else { + productSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 2; + */ + public Builder mergeProductSet(com.google.cloud.vision.v1.ProductSet value) { + if (productSetBuilder_ == null) { + if (productSet_ != null) { + productSet_ = + com.google.cloud.vision.v1.ProductSet.newBuilder(productSet_).mergeFrom(value).buildPartial(); + } else { + productSet_ = value; + } + onChanged(); + } else { + productSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1.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.v1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1.ProductSet.Builder getProductSetBuilder() { + + onChanged(); + return getProductSetFieldBuilder().getBuilder(); + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 2; + */ + public com.google.cloud.vision.v1.ProductSetOrBuilder getProductSetOrBuilder() { + if (productSetBuilder_ != null) { + return productSetBuilder_.getMessageOrBuilder(); + } else { + return productSet_ == null ? + com.google.cloud.vision.v1.ProductSet.getDefaultInstance() : productSet_; + } + } + /** + *
+     * The ProductSet to create.
+     * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ProductSet, com.google.cloud.vision.v1.ProductSet.Builder, com.google.cloud.vision.v1.ProductSetOrBuilder> + getProductSetFieldBuilder() { + if (productSetBuilder_ == null) { + productSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ProductSet, com.google.cloud.vision.v1.ProductSet.Builder, com.google.cloud.vision.v1.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.v1.CreateProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.CreateProductSetRequest) + private static final com.google.cloud.vision.v1.CreateProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.CreateProductSetRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.CreateProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..586d8b4ab198 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateProductSetRequestOrBuilder.java @@ -0,0 +1,78 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface CreateProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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.v1.ProductSet product_set = 2; + */ + boolean hasProductSet(); + /** + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 2; + */ + com.google.cloud.vision.v1.ProductSet getProductSet(); + /** + *
+   * The ProductSet to create.
+   * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 2; + */ + com.google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/CreateReferenceImageRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateReferenceImageRequest.java new file mode 100644 index 000000000000..7a9fdb21ce8c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateReferenceImageRequest.java @@ -0,0 +1,1008 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `CreateReferenceImage` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.CreateReferenceImageRequest} + */ +public final class CreateReferenceImageRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ReferenceImage.Builder subBuilder = null; + if (referenceImage_ != null) { + subBuilder = referenceImage_.toBuilder(); + } + referenceImage_ = input.readMessage(com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateReferenceImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.CreateReferenceImageRequest.class, com.google.cloud.vision.v1.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.v1.ReferenceImage referenceImage_; + /** + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1.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.v1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1.ReferenceImage getReferenceImage() { + return referenceImage_ == null ? com.google.cloud.vision.v1.ReferenceImage.getDefaultInstance() : referenceImage_; + } + /** + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1.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.v1.CreateReferenceImageRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.CreateReferenceImageRequest other = (com.google.cloud.vision.v1.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.v1.CreateReferenceImageRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.CreateReferenceImageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.CreateReferenceImageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.CreateReferenceImageRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.CreateReferenceImageRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.CreateReferenceImageRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.CreateReferenceImageRequest) + com.google.cloud.vision.v1.CreateReferenceImageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateReferenceImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.CreateReferenceImageRequest.class, com.google.cloud.vision.v1.CreateReferenceImageRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_CreateReferenceImageRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.CreateReferenceImageRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.CreateReferenceImageRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.CreateReferenceImageRequest build() { + com.google.cloud.vision.v1.CreateReferenceImageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.CreateReferenceImageRequest buildPartial() { + com.google.cloud.vision.v1.CreateReferenceImageRequest result = new com.google.cloud.vision.v1.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.v1.CreateReferenceImageRequest) { + return mergeFrom((com.google.cloud.vision.v1.CreateReferenceImageRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.CreateReferenceImageRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.CreateReferenceImageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.ReferenceImage referenceImage_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ReferenceImage, com.google.cloud.vision.v1.ReferenceImage.Builder, com.google.cloud.vision.v1.ReferenceImageOrBuilder> referenceImageBuilder_; + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1.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.v1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1.ReferenceImage getReferenceImage() { + if (referenceImageBuilder_ == null) { + return referenceImage_ == null ? com.google.cloud.vision.v1.ReferenceImage.getDefaultInstance() : referenceImage_; + } else { + return referenceImageBuilder_.getMessage(); + } + } + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1.ReferenceImage reference_image = 2; + */ + public Builder setReferenceImage(com.google.cloud.vision.v1.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.v1.ReferenceImage reference_image = 2; + */ + public Builder setReferenceImage( + com.google.cloud.vision.v1.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.v1.ReferenceImage reference_image = 2; + */ + public Builder mergeReferenceImage(com.google.cloud.vision.v1.ReferenceImage value) { + if (referenceImageBuilder_ == null) { + if (referenceImage_ != null) { + referenceImage_ = + com.google.cloud.vision.v1.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.v1.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.v1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1.ReferenceImage.Builder getReferenceImageBuilder() { + + onChanged(); + return getReferenceImageFieldBuilder().getBuilder(); + } + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1.ReferenceImage reference_image = 2; + */ + public com.google.cloud.vision.v1.ReferenceImageOrBuilder getReferenceImageOrBuilder() { + if (referenceImageBuilder_ != null) { + return referenceImageBuilder_.getMessageOrBuilder(); + } else { + return referenceImage_ == null ? + com.google.cloud.vision.v1.ReferenceImage.getDefaultInstance() : referenceImage_; + } + } + /** + *
+     * The reference image to create.
+     * If an image ID is specified, it is ignored.
+     * 
+ * + * .google.cloud.vision.v1.ReferenceImage reference_image = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ReferenceImage, com.google.cloud.vision.v1.ReferenceImage.Builder, com.google.cloud.vision.v1.ReferenceImageOrBuilder> + getReferenceImageFieldBuilder() { + if (referenceImageBuilder_ == null) { + referenceImageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ReferenceImage, com.google.cloud.vision.v1.ReferenceImage.Builder, com.google.cloud.vision.v1.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.v1.CreateReferenceImageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.CreateReferenceImageRequest) + private static final com.google.cloud.vision.v1.CreateReferenceImageRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.CreateReferenceImageRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.CreateReferenceImageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateReferenceImageRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateReferenceImageRequestOrBuilder.java new file mode 100644 index 000000000000..7753fc1c1f13 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/CreateReferenceImageRequestOrBuilder.java @@ -0,0 +1,83 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface CreateReferenceImageRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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.v1.ReferenceImage reference_image = 2; + */ + boolean hasReferenceImage(); + /** + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1.ReferenceImage reference_image = 2; + */ + com.google.cloud.vision.v1.ReferenceImage getReferenceImage(); + /** + *
+   * The reference image to create.
+   * If an image ID is specified, it is ignored.
+   * 
+ * + * .google.cloud.vision.v1.ReferenceImage reference_image = 2; + */ + com.google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductRequest.java new file mode 100644 index 000000000000..4b6a8e368d88 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductRequest.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `DeleteProduct` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.DeleteProductRequest} + */ +public final class DeleteProductRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.DeleteProductRequest.class, com.google.cloud.vision.v1.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.v1.DeleteProductRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.DeleteProductRequest other = (com.google.cloud.vision.v1.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.v1.DeleteProductRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.DeleteProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.DeleteProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.DeleteProductRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.DeleteProductRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.DeleteProductRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.DeleteProductRequest) + com.google.cloud.vision.v1.DeleteProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.DeleteProductRequest.class, com.google.cloud.vision.v1.DeleteProductRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.DeleteProductRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.DeleteProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.DeleteProductRequest build() { + com.google.cloud.vision.v1.DeleteProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.DeleteProductRequest buildPartial() { + com.google.cloud.vision.v1.DeleteProductRequest result = new com.google.cloud.vision.v1.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.v1.DeleteProductRequest) { + return mergeFrom((com.google.cloud.vision.v1.DeleteProductRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.DeleteProductRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.DeleteProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.DeleteProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.DeleteProductRequest) + private static final com.google.cloud.vision.v1.DeleteProductRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.DeleteProductRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.DeleteProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductRequestOrBuilder.java new file mode 100644 index 000000000000..38f9eb809bb0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface DeleteProductRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductSetRequest.java new file mode 100644 index 000000000000..bde6a50cb27f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductSetRequest.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `DeleteProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.DeleteProductSetRequest} + */ +public final class DeleteProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.DeleteProductSetRequest.class, com.google.cloud.vision.v1.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.v1.DeleteProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.DeleteProductSetRequest other = (com.google.cloud.vision.v1.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.v1.DeleteProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.DeleteProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.DeleteProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.DeleteProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.DeleteProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.DeleteProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.DeleteProductSetRequest) + com.google.cloud.vision.v1.DeleteProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.DeleteProductSetRequest.class, com.google.cloud.vision.v1.DeleteProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.DeleteProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.DeleteProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.DeleteProductSetRequest build() { + com.google.cloud.vision.v1.DeleteProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.DeleteProductSetRequest buildPartial() { + com.google.cloud.vision.v1.DeleteProductSetRequest result = new com.google.cloud.vision.v1.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.v1.DeleteProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1.DeleteProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.DeleteProductSetRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.DeleteProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.DeleteProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.DeleteProductSetRequest) + private static final com.google.cloud.vision.v1.DeleteProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.DeleteProductSetRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.DeleteProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..be351c760797 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteProductSetRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface DeleteProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/DeleteReferenceImageRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteReferenceImageRequest.java new file mode 100644 index 000000000000..da9cf777250c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteReferenceImageRequest.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `DeleteReferenceImage` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.DeleteReferenceImageRequest} + */ +public final class DeleteReferenceImageRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteReferenceImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.DeleteReferenceImageRequest.class, com.google.cloud.vision.v1.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.v1.DeleteReferenceImageRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.DeleteReferenceImageRequest other = (com.google.cloud.vision.v1.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.v1.DeleteReferenceImageRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.DeleteReferenceImageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.DeleteReferenceImageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.DeleteReferenceImageRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.DeleteReferenceImageRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.DeleteReferenceImageRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.DeleteReferenceImageRequest) + com.google.cloud.vision.v1.DeleteReferenceImageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteReferenceImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.DeleteReferenceImageRequest.class, com.google.cloud.vision.v1.DeleteReferenceImageRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_DeleteReferenceImageRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.DeleteReferenceImageRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.DeleteReferenceImageRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.DeleteReferenceImageRequest build() { + com.google.cloud.vision.v1.DeleteReferenceImageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.DeleteReferenceImageRequest buildPartial() { + com.google.cloud.vision.v1.DeleteReferenceImageRequest result = new com.google.cloud.vision.v1.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.v1.DeleteReferenceImageRequest) { + return mergeFrom((com.google.cloud.vision.v1.DeleteReferenceImageRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.DeleteReferenceImageRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.DeleteReferenceImageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.DeleteReferenceImageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.DeleteReferenceImageRequest) + private static final com.google.cloud.vision.v1.DeleteReferenceImageRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.DeleteReferenceImageRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.DeleteReferenceImageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteReferenceImageRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteReferenceImageRequestOrBuilder.java new file mode 100644 index 000000000000..dc7b8bc2b157 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/DeleteReferenceImageRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface DeleteReferenceImageRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/EntityAnnotation.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/EntityAnnotation.java index 818dc72a602f..453c50a349d5 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/EntityAnnotation.java +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/EntityAnnotation.java @@ -313,9 +313,9 @@ public float getScore() { * image. Range [0, 1]. *
* - * float confidence = 5; + * float confidence = 5 [deprecated = true]; */ - public float getConfidence() { + @java.lang.Deprecated public float getConfidence() { return confidence_; } @@ -1382,9 +1382,9 @@ public Builder clearScore() { * image. Range [0, 1]. * * - * float confidence = 5; + * float confidence = 5 [deprecated = true]; */ - public float getConfidence() { + @java.lang.Deprecated public float getConfidence() { return confidence_; } /** @@ -1396,9 +1396,9 @@ public float getConfidence() { * image. Range [0, 1]. * * - * float confidence = 5; + * float confidence = 5 [deprecated = true]; */ - public Builder setConfidence(float value) { + @java.lang.Deprecated public Builder setConfidence(float value) { confidence_ = value; onChanged(); @@ -1413,9 +1413,9 @@ public Builder setConfidence(float value) { * image. Range [0, 1]. * * - * float confidence = 5; + * float confidence = 5 [deprecated = true]; */ - public Builder clearConfidence() { + @java.lang.Deprecated public Builder clearConfidence() { confidence_ = 0F; onChanged(); diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/EntityAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/EntityAnnotationOrBuilder.java index b28146c46922..b80b2fdbf17b 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/EntityAnnotationOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/EntityAnnotationOrBuilder.java @@ -85,9 +85,9 @@ public interface EntityAnnotationOrBuilder extends * image. Range [0, 1]. * * - * float confidence = 5; + * float confidence = 5 [deprecated = true]; */ - float getConfidence(); + @java.lang.Deprecated float getConfidence(); /** *
diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/Feature.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/Feature.java
index 89e0578825fe..e9ae669c2fdf 100644
--- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/Feature.java
+++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/Feature.java
@@ -202,6 +202,14 @@ public enum Type
      * WEB_DETECTION = 10;
      */
     WEB_DETECTION(10),
+    /**
+     * 
+     * Run Product Search.
+     * 
+ * + * PRODUCT_SEARCH = 12; + */ + PRODUCT_SEARCH(12), /** *
      * Run localizer for object detection.
@@ -306,6 +314,14 @@ public enum Type
      * 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.
@@ -345,6 +361,7 @@ public static Type forNumber(int value) {
         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;
       }
diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GeometryProto.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GeometryProto.java
index d6140a2dec70..c16c0ac27f01 100644
--- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GeometryProto.java
+++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GeometryProto.java
@@ -44,17 +44,17 @@ public static void registerAllExtensions(
   static {
     java.lang.String[] descriptorData = {
       "\n%google/cloud/vision/v1/geometry.proto\022" +
-      "\026google.cloud.vision.v1\"\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\"\207\001\n\014BoundingPoly\0220\n\010ve" +
-      "rtices\030\001 \003(\0132\036.google.cloud.vision.v1.Ve" +
-      "rtex\022E\n\023normalized_vertices\030\002 \003(\0132(.goog" +
-      "le.cloud.vision.v1.NormalizedVertex\"+\n\010P" +
-      "osition\022\t\n\001x\030\001 \001(\002\022\t\n\001y\030\002 \001(\002\022\t\n\001z\030\003 \001(\002" +
-      "Bu\n\032com.google.cloud.vision.v1B\rGeometry" +
-      "ProtoP\001Z
+ * Request message for the `GetProduct` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.GetProductRequest} + */ +public final class GetProductRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.GetProductRequest.class, com.google.cloud.vision.v1.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.v1.GetProductRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.GetProductRequest other = (com.google.cloud.vision.v1.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.v1.GetProductRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.GetProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.GetProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.GetProductRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.GetProductRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.GetProductRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.GetProductRequest) + com.google.cloud.vision.v1.GetProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.GetProductRequest.class, com.google.cloud.vision.v1.GetProductRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.GetProductRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.GetProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.GetProductRequest build() { + com.google.cloud.vision.v1.GetProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.GetProductRequest buildPartial() { + com.google.cloud.vision.v1.GetProductRequest result = new com.google.cloud.vision.v1.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.v1.GetProductRequest) { + return mergeFrom((com.google.cloud.vision.v1.GetProductRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.GetProductRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.GetProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.GetProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.GetProductRequest) + private static final com.google.cloud.vision.v1.GetProductRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.GetProductRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.GetProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetProductRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetProductRequestOrBuilder.java new file mode 100644 index 000000000000..c02f652043e4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetProductRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface GetProductRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/GetProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetProductSetRequest.java new file mode 100644 index 000000000000..94b2709e6813 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetProductSetRequest.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `GetProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.GetProductSetRequest} + */ +public final class GetProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.GetProductSetRequest.class, com.google.cloud.vision.v1.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.v1.GetProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.GetProductSetRequest other = (com.google.cloud.vision.v1.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.v1.GetProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.GetProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.GetProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.GetProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.GetProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.GetProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.GetProductSetRequest) + com.google.cloud.vision.v1.GetProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.GetProductSetRequest.class, com.google.cloud.vision.v1.GetProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.GetProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.GetProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.GetProductSetRequest build() { + com.google.cloud.vision.v1.GetProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.GetProductSetRequest buildPartial() { + com.google.cloud.vision.v1.GetProductSetRequest result = new com.google.cloud.vision.v1.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.v1.GetProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1.GetProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.GetProductSetRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.GetProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.GetProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.GetProductSetRequest) + private static final com.google.cloud.vision.v1.GetProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.GetProductSetRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.GetProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..19865e275ec2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetProductSetRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface GetProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/GetReferenceImageRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetReferenceImageRequest.java new file mode 100644 index 000000000000..16a2eb8887e4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetReferenceImageRequest.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `GetReferenceImage` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.GetReferenceImageRequest} + */ +public final class GetReferenceImageRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetReferenceImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.GetReferenceImageRequest.class, com.google.cloud.vision.v1.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.v1.GetReferenceImageRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.GetReferenceImageRequest other = (com.google.cloud.vision.v1.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.v1.GetReferenceImageRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.GetReferenceImageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.GetReferenceImageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.GetReferenceImageRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.GetReferenceImageRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.GetReferenceImageRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.GetReferenceImageRequest) + com.google.cloud.vision.v1.GetReferenceImageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetReferenceImageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetReferenceImageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.GetReferenceImageRequest.class, com.google.cloud.vision.v1.GetReferenceImageRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_GetReferenceImageRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.GetReferenceImageRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.GetReferenceImageRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.GetReferenceImageRequest build() { + com.google.cloud.vision.v1.GetReferenceImageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.GetReferenceImageRequest buildPartial() { + com.google.cloud.vision.v1.GetReferenceImageRequest result = new com.google.cloud.vision.v1.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.v1.GetReferenceImageRequest) { + return mergeFrom((com.google.cloud.vision.v1.GetReferenceImageRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.GetReferenceImageRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.GetReferenceImageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.GetReferenceImageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.GetReferenceImageRequest) + private static final com.google.cloud.vision.v1.GetReferenceImageRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.GetReferenceImageRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.GetReferenceImageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetReferenceImageRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetReferenceImageRequestOrBuilder.java new file mode 100644 index 000000000000..6520f23039f1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/GetReferenceImageRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface GetReferenceImageRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorProto.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorProto.java index d8905e5d75c2..b7c236c4ec30 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorProto.java +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorProto.java @@ -196,192 +196,197 @@ public static void registerAllExtensions( "\n,google/cloud/vision/v1/image_annotator" + ".proto\022\026google.cloud.vision.v1\032\034google/a" + "pi/annotations.proto\032%google/cloud/visio" + - "n/v1/geometry.proto\032,google/cloud/vision" + - "/v1/text_annotation.proto\032*google/cloud/" + - "vision/v1/web_detection.proto\032#google/lo" + - "ngrunning/operations.proto\032\037google/proto" + - "buf/timestamp.proto\032\027google/rpc/status.p" + - "roto\032\027google/type/color.proto\032\030google/ty" + - "pe/latlng.proto\"\363\002\n\007Feature\0222\n\004type\030\001 \001(" + - "\0162$.google.cloud.vision.v1.Feature.Type\022" + - "\023\n\013max_results\030\002 \001(\005\022\r\n\005model\030\003 \001(\t\"\217\002\n\004" + - "Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\022\n\016FACE_DETEC" + - "TION\020\001\022\026\n\022LANDMARK_DETECTION\020\002\022\022\n\016LOGO_D" + - "ETECTION\020\003\022\023\n\017LABEL_DETECTION\020\004\022\022\n\016TEXT_" + - "DETECTION\020\005\022\033\n\027DOCUMENT_TEXT_DETECTION\020\013" + - "\022\031\n\025SAFE_SEARCH_DETECTION\020\006\022\024\n\020IMAGE_PRO" + - "PERTIES\020\007\022\016\n\nCROP_HINTS\020\t\022\021\n\rWEB_DETECTI" + - "ON\020\n\022\027\n\023OBJECT_LOCALIZATION\020\023\"7\n\013ImageSo" + - "urce\022\025\n\rgcs_image_uri\030\001 \001(\t\022\021\n\timage_uri" + - "\030\002 \001(\t\"M\n\005Image\022\017\n\007content\030\001 \001(\014\0223\n\006sour" + - "ce\030\002 \001(\0132#.google.cloud.vision.v1.ImageS" + - "ource\"\307\r\n\016FaceAnnotation\022;\n\rbounding_pol" + - "y\030\001 \001(\0132$.google.cloud.vision.v1.Boundin" + - "gPoly\022>\n\020fd_bounding_poly\030\002 \001(\0132$.google" + - ".cloud.vision.v1.BoundingPoly\022B\n\tlandmar" + - "ks\030\003 \003(\0132/.google.cloud.vision.v1.FaceAn" + - "notation.Landmark\022\022\n\nroll_angle\030\004 \001(\002\022\021\n" + - "\tpan_angle\030\005 \001(\002\022\022\n\ntilt_angle\030\006 \001(\002\022\034\n\024" + - "detection_confidence\030\007 \001(\002\022\036\n\026landmarkin" + - "g_confidence\030\010 \001(\002\022:\n\016joy_likelihood\030\t \001" + - "(\0162\".google.cloud.vision.v1.Likelihood\022=" + - "\n\021sorrow_likelihood\030\n \001(\0162\".google.cloud" + - ".vision.v1.Likelihood\022<\n\020anger_likelihoo" + - "d\030\013 \001(\0162\".google.cloud.vision.v1.Likelih" + - "ood\022?\n\023surprise_likelihood\030\014 \001(\0162\".googl" + - "e.cloud.vision.v1.Likelihood\022D\n\030under_ex" + - "posed_likelihood\030\r \001(\0162\".google.cloud.vi" + - "sion.v1.Likelihood\022>\n\022blurred_likelihood" + - "\030\016 \001(\0162\".google.cloud.vision.v1.Likeliho" + - "od\022?\n\023headwear_likelihood\030\017 \001(\0162\".google" + - ".cloud.vision.v1.Likelihood\032\271\007\n\010Landmark" + - "\022B\n\004type\030\003 \001(\01624.google.cloud.vision.v1." + - "FaceAnnotation.Landmark.Type\0222\n\010position" + - "\030\004 \001(\0132 .google.cloud.vision.v1.Position" + - "\"\264\006\n\004Type\022\024\n\020UNKNOWN_LANDMARK\020\000\022\014\n\010LEFT_" + - "EYE\020\001\022\r\n\tRIGHT_EYE\020\002\022\030\n\024LEFT_OF_LEFT_EYE" + - "BROW\020\003\022\031\n\025RIGHT_OF_LEFT_EYEBROW\020\004\022\031\n\025LEF" + - "T_OF_RIGHT_EYEBROW\020\005\022\032\n\026RIGHT_OF_RIGHT_E" + - "YEBROW\020\006\022\031\n\025MIDPOINT_BETWEEN_EYES\020\007\022\014\n\010N" + - "OSE_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\014MOUT" + - "H_CENTER\020\r\022\025\n\021NOSE_BOTTOM_RIGHT\020\016\022\024\n\020NOS" + - "E_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_R" + - "IGHT_CORNER\020\022\022\034\n\030LEFT_EYE_BOTTOM_BOUNDAR" + - "Y\020\023\022\030\n\024LEFT_EYE_LEFT_CORNER\020\024\022\032\n\026RIGHT_E" + - "YE_TOP_BOUNDARY\020\025\022\032\n\026RIGHT_EYE_RIGHT_COR" + - "NER\020\026\022\035\n\031RIGHT_EYE_BOTTOM_BOUNDARY\020\027\022\031\n\025" + - "RIGHT_EYE_LEFT_CORNER\020\030\022\037\n\033LEFT_EYEBROW_" + - "UPPER_MIDPOINT\020\031\022 \n\034RIGHT_EYEBROW_UPPER_" + - "MIDPOINT\020\032\022\024\n\020LEFT_EAR_TRAGION\020\033\022\025\n\021RIGH" + - "T_EAR_TRAGION\020\034\022\022\n\016LEFT_EYE_PUPIL\020\035\022\023\n\017R" + - "IGHT_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" + - "\010Property\022\014\n\004name\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\022\024" + - "\n\014uint64_value\030\003 \001(\004\"\247\002\n\020EntityAnnotatio" + - "n\022\013\n\003mid\030\001 \001(\t\022\016\n\006locale\030\002 \001(\t\022\023\n\013descri" + - "ption\030\003 \001(\t\022\r\n\005score\030\004 \001(\002\022\022\n\nconfidence" + - "\030\005 \001(\002\022\022\n\ntopicality\030\006 \001(\002\022;\n\rbounding_p" + - "oly\030\007 \001(\0132$.google.cloud.vision.v1.Bound" + - "ingPoly\0227\n\tlocations\030\010 \003(\0132$.google.clou" + - "d.vision.v1.LocationInfo\0224\n\nproperties\030\t" + - " \003(\0132 .google.cloud.vision.v1.Property\"\231" + - "\001\n\031LocalizedObjectAnnotation\022\013\n\003mid\030\001 \001(" + - "\t\022\025\n\rlanguage_code\030\002 \001(\t\022\014\n\004name\030\003 \001(\t\022\r" + - "\n\005score\030\004 \001(\002\022;\n\rbounding_poly\030\005 \001(\0132$.g" + - "oogle.cloud.vision.v1.BoundingPoly\"\231\002\n\024S" + - "afeSearchAnnotation\0221\n\005adult\030\001 \001(\0162\".goo" + - "gle.cloud.vision.v1.Likelihood\0221\n\005spoof\030" + - "\002 \001(\0162\".google.cloud.vision.v1.Likelihoo" + - "d\0223\n\007medical\030\003 \001(\0162\".google.cloud.vision" + - ".v1.Likelihood\0224\n\010violence\030\004 \001(\0162\".googl" + - "e.cloud.vision.v1.Likelihood\0220\n\004racy\030\t \001" + - "(\0162\".google.cloud.vision.v1.Likelihood\"a" + - "\n\013LatLongRect\022(\n\013min_lat_lng\030\001 \001(\0132\023.goo" + - "gle.type.LatLng\022(\n\013max_lat_lng\030\002 \001(\0132\023.g" + - "oogle.type.LatLng\"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_fraction\030\003 \001(\002\"M\n\030DominantColo" + - "rsAnnotation\0221\n\006colors\030\001 \003(\0132!.google.cl" + - "oud.vision.v1.ColorInfo\"\\\n\017ImageProperti" + - "es\022I\n\017dominant_colors\030\001 \001(\01320.google.clo" + - "ud.vision.v1.DominantColorsAnnotation\"x\n" + - "\010CropHint\022;\n\rbounding_poly\030\001 \001(\0132$.googl" + - "e.cloud.vision.v1.BoundingPoly\022\022\n\nconfid" + - "ence\030\002 \001(\002\022\033\n\023importance_fraction\030\003 \001(\002\"" + - "K\n\023CropHintsAnnotation\0224\n\ncrop_hints\030\001 \003" + - "(\0132 .google.cloud.vision.v1.CropHint\"(\n\017" + - "CropHintsParams\022\025\n\raspect_ratios\030\001 \003(\002\"1" + - "\n\022WebDetectionParams\022\033\n\023include_geo_resu" + - "lts\030\002 \001(\010\"\360\001\n\014ImageContext\022:\n\rlat_long_r" + - "ect\030\001 \001(\0132#.google.cloud.vision.v1.LatLo" + - "ngRect\022\026\n\016language_hints\030\002 \003(\t\022B\n\021crop_h" + - "ints_params\030\004 \001(\0132\'.google.cloud.vision." + - "v1.CropHintsParams\022H\n\024web_detection_para" + - "ms\030\006 \001(\0132*.google.cloud.vision.v1.WebDet" + - "ectionParams\"\264\001\n\024AnnotateImageRequest\022,\n" + - "\005image\030\001 \001(\0132\035.google.cloud.vision.v1.Im" + - "age\0221\n\010features\030\002 \003(\0132\037.google.cloud.vis" + - "ion.v1.Feature\022;\n\rimage_context\030\003 \001(\0132$." + - "google.cloud.vision.v1.ImageContext\":\n\026I" + - "mageAnnotationContext\022\013\n\003uri\030\001 \001(\t\022\023\n\013pa" + - "ge_number\030\002 \001(\005\"\226\007\n\025AnnotateImageRespons" + - "e\022@\n\020face_annotations\030\001 \003(\0132&.google.clo" + - "ud.vision.v1.FaceAnnotation\022F\n\024landmark_" + - "annotations\030\002 \003(\0132(.google.cloud.vision." + - "v1.EntityAnnotation\022B\n\020logo_annotations\030" + - "\003 \003(\0132(.google.cloud.vision.v1.EntityAnn" + - "otation\022C\n\021label_annotations\030\004 \003(\0132(.goo" + - "gle.cloud.vision.v1.EntityAnnotation\022W\n\034" + - "localized_object_annotations\030\026 \003(\01321.goo" + - "gle.cloud.vision.v1.LocalizedObjectAnnot" + - "ation\022B\n\020text_annotations\030\005 \003(\0132(.google" + - ".cloud.vision.v1.EntityAnnotation\022D\n\024ful" + - "l_text_annotation\030\014 \001(\0132&.google.cloud.v" + - "ision.v1.TextAnnotation\022L\n\026safe_search_a" + - "nnotation\030\006 \001(\0132,.google.cloud.vision.v1" + - ".SafeSearchAnnotation\022L\n\033image_propertie" + - "s_annotation\030\010 \001(\0132\'.google.cloud.vision" + - ".v1.ImageProperties\022J\n\025crop_hints_annota" + - "tion\030\013 \001(\0132+.google.cloud.vision.v1.Crop" + - "HintsAnnotation\022;\n\rweb_detection\030\r \001(\0132$" + - ".google.cloud.vision.v1.WebDetection\022!\n\005" + - "error\030\t \001(\0132\022.google.rpc.Status\022?\n\007conte" + - "xt\030\025 \001(\0132..google.cloud.vision.v1.ImageA" + - "nnotationContext\"\223\001\n\024AnnotateFileRespons" + - "e\0229\n\014input_config\030\001 \001(\0132#.google.cloud.v" + - "ision.v1.InputConfig\022@\n\tresponses\030\002 \003(\0132" + - "-.google.cloud.vision.v1.AnnotateImageRe" + - "sponse\"\\\n\032BatchAnnotateImagesRequest\022>\n\010" + - "requests\030\001 \003(\0132,.google.cloud.vision.v1." + - "AnnotateImageRequest\"_\n\033BatchAnnotateIma" + - "gesResponse\022@\n\tresponses\030\001 \003(\0132-.google." + - "cloud.vision.v1.AnnotateImageResponse\"\202\002" + - "\n\030AsyncAnnotateFileRequest\0229\n\014input_conf" + - "ig\030\001 \001(\0132#.google.cloud.vision.v1.InputC" + - "onfig\0221\n\010features\030\002 \003(\0132\037.google.cloud.v" + - "ision.v1.Feature\022;\n\rimage_context\030\003 \001(\0132" + - "$.google.cloud.vision.v1.ImageContext\022;\n" + - "\routput_config\030\004 \001(\0132$.google.cloud.visi" + - "on.v1.OutputConfig\"X\n\031AsyncAnnotateFileR" + - "esponse\022;\n\routput_config\030\001 \001(\0132$.google." + - "cloud.vision.v1.OutputConfig\"d\n\036AsyncBat" + - "chAnnotateFilesRequest\022B\n\010requests\030\001 \003(\013" + - "20.google.cloud.vision.v1.AsyncAnnotateF" + - "ileRequest\"g\n\037AsyncBatchAnnotateFilesRes" + - "ponse\022D\n\tresponses\030\001 \003(\01321.google.cloud." + - "vision.v1.AsyncAnnotateFileResponse\"W\n\013I" + - "nputConfig\0225\n\ngcs_source\030\001 \001(\0132!.google." + - "cloud.vision.v1.GcsSource\022\021\n\tmime_type\030\002" + - " \001(\t\"c\n\014OutputConfig\022?\n\017gcs_destination\030" + - "\001 \001(\0132&.google.cloud.vision.v1.GcsDestin" + - "ation\022\022\n\nbatch_size\030\002 \001(\005\"\030\n\tGcsSource\022\013" + - "\n\003uri\030\001 \001(\t\"\035\n\016GcsDestination\022\013\n\003uri\030\001 \001" + - "(\t\"\210\002\n\021OperationMetadata\022>\n\005state\030\001 \001(\0162" + - "/.google.cloud.vision.v1.OperationMetada" + - "ta.State\022/\n\013create_time\030\005 \001(\0132\032.google.p" + - "rotobuf.Timestamp\022/\n\013update_time\030\006 \001(\0132\032" + - ".google.protobuf.Timestamp\"Q\n\005State\022\025\n\021S" + - "TATE_UNSPECIFIED\020\000\022\013\n\007CREATED\020\001\022\013\n\007RUNNI" + - "NG\020\002\022\010\n\004DONE\020\003\022\r\n\tCANCELLED\020\004*e\n\nLikelih" + - "ood\022\013\n\007UNKNOWN\020\000\022\021\n\rVERY_UNLIKELY\020\001\022\014\n\010U" + - "NLIKELY\020\002\022\014\n\010POSSIBLE\020\003\022\n\n\006LIKELY\020\004\022\017\n\013V" + - "ERY_LIKELY\020\0052\315\002\n\016ImageAnnotator\022\236\001\n\023Batc" + - "hAnnotateImages\0222.google.cloud.vision.v1" + - ".BatchAnnotateImagesRequest\0323.google.clo" + - "ud.vision.v1.BatchAnnotateImagesResponse" + - "\"\036\202\323\344\223\002\030\"\023/v1/images:annotate:\001*\022\231\001\n\027Asy" + - "ncBatchAnnotateFiles\0226.google.cloud.visi" + - "on.v1.AsyncBatchAnnotateFilesRequest\032\035.g" + - "oogle.longrunning.Operation\"\'\202\323\344\223\002!\"\034/v1" + - "/files:asyncBatchAnnotate:\001*B{\n\032com.goog" + - "le.cloud.vision.v1B\023ImageAnnotatorProtoP" + - "\001Z\n\020fd_bou" + + "nding_poly\030\002 \001(\0132$.google.cloud.vision.v" + + "1.BoundingPoly\022B\n\tlandmarks\030\003 \003(\0132/.goog" + + "le.cloud.vision.v1.FaceAnnotation.Landma" + + "rk\022\022\n\nroll_angle\030\004 \001(\002\022\021\n\tpan_angle\030\005 \001(" + + "\002\022\022\n\ntilt_angle\030\006 \001(\002\022\034\n\024detection_confi" + + "dence\030\007 \001(\002\022\036\n\026landmarking_confidence\030\010 " + + "\001(\002\022:\n\016joy_likelihood\030\t \001(\0162\".google.clo" + + "ud.vision.v1.Likelihood\022=\n\021sorrow_likeli" + + "hood\030\n \001(\0162\".google.cloud.vision.v1.Like" + + "lihood\022<\n\020anger_likelihood\030\013 \001(\0162\".googl" + + "e.cloud.vision.v1.Likelihood\022?\n\023surprise" + + "_likelihood\030\014 \001(\0162\".google.cloud.vision." + + "v1.Likelihood\022D\n\030under_exposed_likelihoo" + + "d\030\r \001(\0162\".google.cloud.vision.v1.Likelih" + + "ood\022>\n\022blurred_likelihood\030\016 \001(\0162\".google" + + ".cloud.vision.v1.Likelihood\022?\n\023headwear_" + + "likelihood\030\017 \001(\0162\".google.cloud.vision.v" + + "1.Likelihood\032\271\007\n\010Landmark\022B\n\004type\030\003 \001(\0162" + + "4.google.cloud.vision.v1.FaceAnnotation." + + "Landmark.Type\0222\n\010position\030\004 \001(\0132 .google" + + ".cloud.vision.v1.Position\"\264\006\n\004Type\022\024\n\020UN" + + "KNOWN_LANDMARK\020\000\022\014\n\010LEFT_EYE\020\001\022\r\n\tRIGHT_" + + "EYE\020\002\022\030\n\024LEFT_OF_LEFT_EYEBROW\020\003\022\031\n\025RIGHT" + + "_OF_LEFT_EYEBROW\020\004\022\031\n\025LEFT_OF_RIGHT_EYEB" + + "ROW\020\005\022\032\n\026RIGHT_OF_RIGHT_EYEBROW\020\006\022\031\n\025MID" + + "POINT_BETWEEN_EYES\020\007\022\014\n\010NOSE_TIP\020\010\022\r\n\tUP" + + "PER_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\021N" + + "OSE_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_RIGHT_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_EYE_TOP_BOUNDARY" + + "\020\025\022\032\n\026RIGHT_EYE_RIGHT_CORNER\020\026\022\035\n\031RIGHT_" + + "EYE_BOTTOM_BOUNDARY\020\027\022\031\n\025RIGHT_EYE_LEFT_" + + "CORNER\020\030\022\037\n\033LEFT_EYEBROW_UPPER_MIDPOINT\020" + + "\031\022 \n\034RIGHT_EYEBROW_UPPER_MIDPOINT\020\032\022\024\n\020L" + + "EFT_EAR_TRAGION\020\033\022\025\n\021RIGHT_EAR_TRAGION\020\034" + + "\022\022\n\016LEFT_EYE_PUPIL\020\035\022\023\n\017RIGHT_EYE_PUPIL\020" + + "\036\022\025\n\021FOREHEAD_GLABELLA\020\037\022\021\n\rCHIN_GNATHIO" + + "N\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\010Property\022\014\n\004na" + + "me\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\022\024\n\014uint64_value\030" + + "\003 \001(\004\"\253\002\n\020EntityAnnotation\022\013\n\003mid\030\001 \001(\t\022" + + "\016\n\006locale\030\002 \001(\t\022\023\n\013description\030\003 \001(\t\022\r\n\005" + + "score\030\004 \001(\002\022\026\n\nconfidence\030\005 \001(\002B\002\030\001\022\022\n\nt" + + "opicality\030\006 \001(\002\022;\n\rbounding_poly\030\007 \001(\0132$" + + ".google.cloud.vision.v1.BoundingPoly\0227\n\t" + + "locations\030\010 \003(\0132$.google.cloud.vision.v1" + + ".LocationInfo\0224\n\nproperties\030\t \003(\0132 .goog" + + "le.cloud.vision.v1.Property\"\231\001\n\031Localize" + + "dObjectAnnotation\022\013\n\003mid\030\001 \001(\t\022\025\n\rlangua" + + "ge_code\030\002 \001(\t\022\014\n\004name\030\003 \001(\t\022\r\n\005score\030\004 \001" + + "(\002\022;\n\rbounding_poly\030\005 \001(\0132$.google.cloud" + + ".vision.v1.BoundingPoly\"\231\002\n\024SafeSearchAn" + + "notation\0221\n\005adult\030\001 \001(\0162\".google.cloud.v" + + "ision.v1.Likelihood\0221\n\005spoof\030\002 \001(\0162\".goo" + + "gle.cloud.vision.v1.Likelihood\0223\n\007medica" + + "l\030\003 \001(\0162\".google.cloud.vision.v1.Likelih" + + "ood\0224\n\010violence\030\004 \001(\0162\".google.cloud.vis" + + "ion.v1.Likelihood\0220\n\004racy\030\t \001(\0162\".google" + + ".cloud.vision.v1.Likelihood\"a\n\013LatLongRe" + + "ct\022(\n\013min_lat_lng\030\001 \001(\0132\023.google.type.La" + + "tLng\022(\n\013max_lat_lng\030\002 \001(\0132\023.google.type." + + "LatLng\"U\n\tColorInfo\022!\n\005color\030\001 \001(\0132\022.goo" + + "gle.type.Color\022\r\n\005score\030\002 \001(\002\022\026\n\016pixel_f" + + "raction\030\003 \001(\002\"M\n\030DominantColorsAnnotatio" + + "n\0221\n\006colors\030\001 \003(\0132!.google.cloud.vision." + + "v1.ColorInfo\"\\\n\017ImageProperties\022I\n\017domin" + + "ant_colors\030\001 \001(\01320.google.cloud.vision.v" + + "1.DominantColorsAnnotation\"x\n\010CropHint\022;" + + "\n\rbounding_poly\030\001 \001(\0132$.google.cloud.vis" + + "ion.v1.BoundingPoly\022\022\n\nconfidence\030\002 \001(\002\022" + + "\033\n\023importance_fraction\030\003 \001(\002\"K\n\023CropHint" + + "sAnnotation\0224\n\ncrop_hints\030\001 \003(\0132 .google" + + ".cloud.vision.v1.CropHint\"(\n\017CropHintsPa" + + "rams\022\025\n\raspect_ratios\030\001 \003(\002\"1\n\022WebDetect" + + "ionParams\022\033\n\023include_geo_results\030\002 \001(\010\"\274" + + "\002\n\014ImageContext\022:\n\rlat_long_rect\030\001 \001(\0132#" + + ".google.cloud.vision.v1.LatLongRect\022\026\n\016l" + + "anguage_hints\030\002 \003(\t\022B\n\021crop_hints_params" + + "\030\004 \001(\0132\'.google.cloud.vision.v1.CropHint" + + "sParams\022J\n\025product_search_params\030\005 \001(\0132+" + + ".google.cloud.vision.v1.ProductSearchPar" + + "ams\022H\n\024web_detection_params\030\006 \001(\0132*.goog" + + "le.cloud.vision.v1.WebDetectionParams\"\264\001" + + "\n\024AnnotateImageRequest\022,\n\005image\030\001 \001(\0132\035." + + "google.cloud.vision.v1.Image\0221\n\010features" + + "\030\002 \003(\0132\037.google.cloud.vision.v1.Feature\022" + + ";\n\rimage_context\030\003 \001(\0132$.google.cloud.vi" + + "sion.v1.ImageContext\":\n\026ImageAnnotationC" + + "ontext\022\013\n\003uri\030\001 \001(\t\022\023\n\013page_number\030\002 \001(\005" + + "\"\344\007\n\025AnnotateImageResponse\022@\n\020face_annot" + + "ations\030\001 \003(\0132&.google.cloud.vision.v1.Fa" + + "ceAnnotation\022F\n\024landmark_annotations\030\002 \003" + + "(\0132(.google.cloud.vision.v1.EntityAnnota" + + "tion\022B\n\020logo_annotations\030\003 \003(\0132(.google." + + "cloud.vision.v1.EntityAnnotation\022C\n\021labe" + + "l_annotations\030\004 \003(\0132(.google.cloud.visio" + + "n.v1.EntityAnnotation\022W\n\034localized_objec" + + "t_annotations\030\026 \003(\01321.google.cloud.visio" + + "n.v1.LocalizedObjectAnnotation\022B\n\020text_a" + + "nnotations\030\005 \003(\0132(.google.cloud.vision.v" + + "1.EntityAnnotation\022D\n\024full_text_annotati" + + "on\030\014 \001(\0132&.google.cloud.vision.v1.TextAn" + + "notation\022L\n\026safe_search_annotation\030\006 \001(\013" + + "2,.google.cloud.vision.v1.SafeSearchAnno" + + "tation\022L\n\033image_properties_annotation\030\010 " + + "\001(\0132\'.google.cloud.vision.v1.ImageProper" + + "ties\022J\n\025crop_hints_annotation\030\013 \001(\0132+.go" + + "ogle.cloud.vision.v1.CropHintsAnnotation" + + "\022;\n\rweb_detection\030\r \001(\0132$.google.cloud.v" + + "ision.v1.WebDetection\022L\n\026product_search_" + + "results\030\016 \001(\0132,.google.cloud.vision.v1.P" + + "roductSearchResults\022!\n\005error\030\t \001(\0132\022.goo" + + "gle.rpc.Status\022?\n\007context\030\025 \001(\0132..google" + + ".cloud.vision.v1.ImageAnnotationContext\"" + + "\223\001\n\024AnnotateFileResponse\0229\n\014input_config" + + "\030\001 \001(\0132#.google.cloud.vision.v1.InputCon" + + "fig\022@\n\tresponses\030\002 \003(\0132-.google.cloud.vi" + + "sion.v1.AnnotateImageResponse\"\\\n\032BatchAn" + + "notateImagesRequest\022>\n\010requests\030\001 \003(\0132,." + + "google.cloud.vision.v1.AnnotateImageRequ" + + "est\"_\n\033BatchAnnotateImagesResponse\022@\n\tre" + + "sponses\030\001 \003(\0132-.google.cloud.vision.v1.A" + + "nnotateImageResponse\"\202\002\n\030AsyncAnnotateFi" + + "leRequest\0229\n\014input_config\030\001 \001(\0132#.google" + + ".cloud.vision.v1.InputConfig\0221\n\010features" + + "\030\002 \003(\0132\037.google.cloud.vision.v1.Feature\022" + + ";\n\rimage_context\030\003 \001(\0132$.google.cloud.vi" + + "sion.v1.ImageContext\022;\n\routput_config\030\004 " + + "\001(\0132$.google.cloud.vision.v1.OutputConfi" + + "g\"X\n\031AsyncAnnotateFileResponse\022;\n\routput" + + "_config\030\001 \001(\0132$.google.cloud.vision.v1.O" + + "utputConfig\"d\n\036AsyncBatchAnnotateFilesRe" + + "quest\022B\n\010requests\030\001 \003(\01320.google.cloud.v" + + "ision.v1.AsyncAnnotateFileRequest\"g\n\037Asy" + + "ncBatchAnnotateFilesResponse\022D\n\tresponse" + + "s\030\001 \003(\01321.google.cloud.vision.v1.AsyncAn" + + "notateFileResponse\"W\n\013InputConfig\0225\n\ngcs" + + "_source\030\001 \001(\0132!.google.cloud.vision.v1.G" + + "csSource\022\021\n\tmime_type\030\002 \001(\t\"c\n\014OutputCon" + + "fig\022?\n\017gcs_destination\030\001 \001(\0132&.google.cl" + + "oud.vision.v1.GcsDestination\022\022\n\nbatch_si" + + "ze\030\002 \001(\005\"\030\n\tGcsSource\022\013\n\003uri\030\001 \001(\t\"\035\n\016Gc" + + "sDestination\022\013\n\003uri\030\001 \001(\t\"\210\002\n\021OperationM" + + "etadata\022>\n\005state\030\001 \001(\0162/.google.cloud.vi" + + "sion.v1.OperationMetadata.State\022/\n\013creat" + + "e_time\030\005 \001(\0132\032.google.protobuf.Timestamp" + + "\022/\n\013update_time\030\006 \001(\0132\032.google.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\010UNLIKELY\020\002\022\014\n\010POSS" + + "IBLE\020\003\022\n\n\006LIKELY\020\004\022\017\n\013VERY_LIKELY\020\0052\315\002\n\016" + + "ImageAnnotator\022\236\001\n\023BatchAnnotateImages\0222" + + ".google.cloud.vision.v1.BatchAnnotateIma" + + "gesRequest\0323.google.cloud.vision.v1.Batc" + + "hAnnotateImagesResponse\"\036\202\323\344\223\002\030\"\023/v1/ima" + + "ges:annotate:\001*\022\231\001\n\027AsyncBatchAnnotateFi" + + "les\0226.google.cloud.vision.v1.AsyncBatchA" + + "nnotateFilesRequest\032\035.google.longrunning" + + ".Operation\"\'\202\323\344\223\002!\"\034/v1/files:asyncBatch" + + "Annotate:\001*B{\n\032com.google.cloud.vision.v" + + "1B\023ImageAnnotatorProtoP\001Z + * Parameters for product search. + *
+ * + * .google.cloud.vision.v1.ProductSearchParams product_search_params = 5; + */ + public boolean hasProductSearchParams() { + return productSearchParams_ != null; + } + /** + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1.ProductSearchParams getProductSearchParams() { + return productSearchParams_ == null ? com.google.cloud.vision.v1.ProductSearchParams.getDefaultInstance() : productSearchParams_; + } + /** + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1.ProductSearchParamsOrBuilder getProductSearchParamsOrBuilder() { + return getProductSearchParams(); + } + public static final int WEB_DETECTION_PARAMS_FIELD_NUMBER = 6; private com.google.cloud.vision.v1.WebDetectionParams webDetectionParams_; /** @@ -326,6 +372,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (cropHintsParams_ != null) { output.writeMessage(4, getCropHintsParams()); } + if (productSearchParams_ != null) { + output.writeMessage(5, getProductSearchParams()); + } if (webDetectionParams_ != null) { output.writeMessage(6, getWebDetectionParams()); } @@ -354,6 +403,10 @@ public int getSerializedSize() { 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()); @@ -386,6 +439,11 @@ public boolean equals(final java.lang.Object obj) { 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() @@ -414,6 +472,10 @@ public int hashCode() { 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(); @@ -569,6 +631,12 @@ public Builder clear() { cropHintsParams_ = null; cropHintsParamsBuilder_ = null; } + if (productSearchParamsBuilder_ == null) { + productSearchParams_ = null; + } else { + productSearchParams_ = null; + productSearchParamsBuilder_ = null; + } if (webDetectionParamsBuilder_ == null) { webDetectionParams_ = null; } else { @@ -618,6 +686,11 @@ public com.google.cloud.vision.v1.ImageContext buildPartial() { } else { result.cropHintsParams_ = cropHintsParamsBuilder_.build(); } + if (productSearchParamsBuilder_ == null) { + result.productSearchParams_ = productSearchParams_; + } else { + result.productSearchParams_ = productSearchParamsBuilder_.build(); + } if (webDetectionParamsBuilder_ == null) { result.webDetectionParams_ = webDetectionParams_; } else { @@ -688,6 +761,9 @@ public Builder mergeFrom(com.google.cloud.vision.v1.ImageContext other) { if (other.hasCropHintsParams()) { mergeCropHintsParams(other.getCropHintsParams()); } + if (other.hasProductSearchParams()) { + mergeProductSearchParams(other.getProductSearchParams()); + } if (other.hasWebDetectionParams()) { mergeWebDetectionParams(other.getWebDetectionParams()); } @@ -1220,6 +1296,159 @@ public com.google.cloud.vision.v1.CropHintsParamsOrBuilder getCropHintsParamsOrB return cropHintsParamsBuilder_; } + private com.google.cloud.vision.v1.ProductSearchParams productSearchParams_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchParams, com.google.cloud.vision.v1.ProductSearchParams.Builder, com.google.cloud.vision.v1.ProductSearchParamsOrBuilder> productSearchParamsBuilder_; + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1.ProductSearchParams product_search_params = 5; + */ + public boolean hasProductSearchParams() { + return productSearchParamsBuilder_ != null || productSearchParams_ != null; + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1.ProductSearchParams getProductSearchParams() { + if (productSearchParamsBuilder_ == null) { + return productSearchParams_ == null ? com.google.cloud.vision.v1.ProductSearchParams.getDefaultInstance() : productSearchParams_; + } else { + return productSearchParamsBuilder_.getMessage(); + } + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1.ProductSearchParams product_search_params = 5; + */ + public Builder setProductSearchParams(com.google.cloud.vision.v1.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.v1.ProductSearchParams product_search_params = 5; + */ + public Builder setProductSearchParams( + com.google.cloud.vision.v1.ProductSearchParams.Builder builderForValue) { + if (productSearchParamsBuilder_ == null) { + productSearchParams_ = builderForValue.build(); + onChanged(); + } else { + productSearchParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1.ProductSearchParams product_search_params = 5; + */ + public Builder mergeProductSearchParams(com.google.cloud.vision.v1.ProductSearchParams value) { + if (productSearchParamsBuilder_ == null) { + if (productSearchParams_ != null) { + productSearchParams_ = + com.google.cloud.vision.v1.ProductSearchParams.newBuilder(productSearchParams_).mergeFrom(value).buildPartial(); + } else { + productSearchParams_ = value; + } + onChanged(); + } else { + productSearchParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1.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.v1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1.ProductSearchParams.Builder getProductSearchParamsBuilder() { + + onChanged(); + return getProductSearchParamsFieldBuilder().getBuilder(); + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1.ProductSearchParams product_search_params = 5; + */ + public com.google.cloud.vision.v1.ProductSearchParamsOrBuilder getProductSearchParamsOrBuilder() { + if (productSearchParamsBuilder_ != null) { + return productSearchParamsBuilder_.getMessageOrBuilder(); + } else { + return productSearchParams_ == null ? + com.google.cloud.vision.v1.ProductSearchParams.getDefaultInstance() : productSearchParams_; + } + } + /** + *
+     * Parameters for product search.
+     * 
+ * + * .google.cloud.vision.v1.ProductSearchParams product_search_params = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchParams, com.google.cloud.vision.v1.ProductSearchParams.Builder, com.google.cloud.vision.v1.ProductSearchParamsOrBuilder> + getProductSearchParamsFieldBuilder() { + if (productSearchParamsBuilder_ == null) { + productSearchParamsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchParams, com.google.cloud.vision.v1.ProductSearchParams.Builder, com.google.cloud.vision.v1.ProductSearchParamsOrBuilder>( + getProductSearchParams(), + getParentForChildren(), + isClean()); + productSearchParams_ = null; + } + return productSearchParamsBuilder_; + } + private com.google.cloud.vision.v1.WebDetectionParams webDetectionParams_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.WebDetectionParams, com.google.cloud.vision.v1.WebDetectionParams.Builder, com.google.cloud.vision.v1.WebDetectionParamsOrBuilder> webDetectionParamsBuilder_; diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageContextOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageContextOrBuilder.java index 8d9c20f89b4b..a3baba9ce71c 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageContextOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageContextOrBuilder.java @@ -120,6 +120,31 @@ public interface ImageContextOrBuilder extends */ com.google.cloud.vision.v1.CropHintsParamsOrBuilder getCropHintsParamsOrBuilder(); + /** + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1.ProductSearchParams product_search_params = 5; + */ + boolean hasProductSearchParams(); + /** + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1.ProductSearchParams product_search_params = 5; + */ + com.google.cloud.vision.v1.ProductSearchParams getProductSearchParams(); + /** + *
+   * Parameters for product search.
+   * 
+ * + * .google.cloud.vision.v1.ProductSearchParams product_search_params = 5; + */ + com.google.cloud.vision.v1.ProductSearchParamsOrBuilder getProductSearchParamsOrBuilder(); + /** *
    * Parameters for web detection.
diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageName.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageName.java
new file mode 100644
index 000000000000..a8f8bfbe5687
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageName.java
@@ -0,0 +1,235 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.cloud.vision.v1;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceName;
+import java.util.Map;
+import java.util.ArrayList;
+import java.util.List;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+@javax.annotation.Generated("by GAPIC protoc plugin")
+public class ImageName implements ResourceName {
+
+  private static final PathTemplate PATH_TEMPLATE =
+      PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/products/{product}/referenceImages/{image}");
+
+  private volatile Map fieldValuesMap;
+
+  private final String project;
+  private final String location;
+  private final String product;
+  private final String image;
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getLocation() {
+    return location;
+  }
+
+  public String getProduct() {
+    return product;
+  }
+
+  public String getImage() {
+    return image;
+  }
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  private ImageName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    location = Preconditions.checkNotNull(builder.getLocation());
+    product = Preconditions.checkNotNull(builder.getProduct());
+    image = Preconditions.checkNotNull(builder.getImage());
+  }
+
+  public static ImageName of(String project, String location, String product, String image) {
+    return newBuilder()
+      .setProject(project)
+      .setLocation(location)
+      .setProduct(product)
+      .setImage(image)
+      .build();
+  }
+
+  public static String format(String project, String location, String product, String image) {
+    return newBuilder()
+      .setProject(project)
+      .setLocation(location)
+      .setProduct(product)
+      .setImage(image)
+      .build()
+      .toString();
+  }
+
+  public static ImageName parse(String formattedString) {
+    if (formattedString.isEmpty()) {
+      return null;
+    }
+    Map matchMap =
+        PATH_TEMPLATE.validatedMatch(formattedString, "ImageName.parse: formattedString not in valid format");
+    return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("product"), matchMap.get("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 (ImageName 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("image", image);
+          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, "image", image);
+  }
+
+  /** Builder for ImageName. */
+  public static class Builder {
+
+    private String project;
+    private String location;
+    private String product;
+    private String image;
+
+    public String getProject() {
+      return project;
+    }
+
+    public String getLocation() {
+      return location;
+    }
+
+    public String getProduct() {
+      return product;
+    }
+
+    public String getImage() {
+      return image;
+    }
+
+    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 setImage(String image) {
+      this.image = image;
+      return this;
+    }
+
+    private Builder() {
+    }
+
+    private Builder(ImageName imageName) {
+      project = imageName.project;
+      location = imageName.location;
+      product = imageName.product;
+      image = imageName.image;
+    }
+
+    public ImageName build() {
+      return new ImageName(this);
+    }
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof ImageName) {
+      ImageName that = (ImageName) o;
+      return (this.project.equals(that.project))
+          && (this.location.equals(that.location))
+          && (this.product.equals(that.product))
+          && (this.image.equals(that.image));
+    }
+    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 ^= image.hashCode();
+    return h;
+  }
+}
+
diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsGcsSource.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsGcsSource.java
new file mode 100644
index 000000000000..377f4c192593
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsGcsSource.java
@@ -0,0 +1,901 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/cloud/vision/v1/product_search_service.proto
+
+package com.google.cloud.vision.v1;
+
+/**
+ * 
+ * The Google Cloud Storage location for a csv file which preserves a list of
+ * ImportProductSetRequests in each line.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ImportProductSetsGcsSource} + */ +public final class ImportProductSetsGcsSource extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsGcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsGcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ImportProductSetsGcsSource.class, com.google.cloud.vision.v1.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.v1.Product.display_name], the
+   * `product-category` column refers to
+   * [product_category][google.cloud.vision.v1.Product.product_category], and the
+   * `labels` column refers to [product_labels][google.cloud.vision.v1.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.v1.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.v1.Product.display_name], the
+   * `product-category` column refers to
+   * [product_category][google.cloud.vision.v1.Product.product_category], and the
+   * `labels` column refers to [product_labels][google.cloud.vision.v1.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.v1.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.v1.ImportProductSetsGcsSource)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ImportProductSetsGcsSource other = (com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ImportProductSetsGcsSource} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ImportProductSetsGcsSource) + com.google.cloud.vision.v1.ImportProductSetsGcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsGcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsGcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ImportProductSetsGcsSource.class, com.google.cloud.vision.v1.ImportProductSetsGcsSource.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsGcsSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ImportProductSetsGcsSource getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ImportProductSetsGcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ImportProductSetsGcsSource build() { + com.google.cloud.vision.v1.ImportProductSetsGcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ImportProductSetsGcsSource buildPartial() { + com.google.cloud.vision.v1.ImportProductSetsGcsSource result = new com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource) { + return mergeFrom((com.google.cloud.vision.v1.ImportProductSetsGcsSource)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ImportProductSetsGcsSource other) { + if (other == com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.Product.display_name], the
+     * `product-category` column refers to
+     * [product_category][google.cloud.vision.v1.Product.product_category], and the
+     * `labels` column refers to [product_labels][google.cloud.vision.v1.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.v1.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.v1.Product.display_name], the
+     * `product-category` column refers to
+     * [product_category][google.cloud.vision.v1.Product.product_category], and the
+     * `labels` column refers to [product_labels][google.cloud.vision.v1.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.v1.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.v1.Product.display_name], the
+     * `product-category` column refers to
+     * [product_category][google.cloud.vision.v1.Product.product_category], and the
+     * `labels` column refers to [product_labels][google.cloud.vision.v1.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.v1.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.v1.Product.display_name], the
+     * `product-category` column refers to
+     * [product_category][google.cloud.vision.v1.Product.product_category], and the
+     * `labels` column refers to [product_labels][google.cloud.vision.v1.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.v1.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.v1.Product.display_name], the
+     * `product-category` column refers to
+     * [product_category][google.cloud.vision.v1.Product.product_category], and the
+     * `labels` column refers to [product_labels][google.cloud.vision.v1.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.v1.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.v1.ImportProductSetsGcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ImportProductSetsGcsSource) + private static final com.google.cloud.vision.v1.ImportProductSetsGcsSource DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ImportProductSetsGcsSource(); + } + + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsGcsSourceOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsGcsSourceOrBuilder.java new file mode 100644 index 000000000000..9c4d69c88fd2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsGcsSourceOrBuilder.java @@ -0,0 +1,119 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ImportProductSetsGcsSourceOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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.v1.Product.display_name], the
+   * `product-category` column refers to
+   * [product_category][google.cloud.vision.v1.Product.product_category], and the
+   * `labels` column refers to [product_labels][google.cloud.vision.v1.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.v1.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.v1.Product.display_name], the
+   * `product-category` column refers to
+   * [product_category][google.cloud.vision.v1.Product.product_category], and the
+   * `labels` column refers to [product_labels][google.cloud.vision.v1.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.v1.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-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsInputConfig.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsInputConfig.java new file mode 100644 index 000000000000..16b39bbde391 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsInputConfig.java @@ -0,0 +1,754 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * The input content for the `ImportProductSets` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ImportProductSetsInputConfig} + */ +public final class ImportProductSetsInputConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = ((com.google.cloud.vision.v1.ImportProductSetsGcsSource) source_).toBuilder(); + } + source_ = + input.readMessage(com.google.cloud.vision.v1.ImportProductSetsGcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ImportProductSetsInputConfig.class, com.google.cloud.vision.v1.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.v1.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.v1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1.ImportProductSetsGcsSource getGcsSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.vision.v1.ImportProductSetsGcsSource) source_; + } + return com.google.cloud.vision.v1.ImportProductSetsGcsSource.getDefaultInstance(); + } + /** + *
+   * The Google Cloud Storage location for a csv file which preserves a list
+   * of ImportProductSetRequests in each line.
+   * 
+ * + * .google.cloud.vision.v1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1.ImportProductSetsGcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.vision.v1.ImportProductSetsGcsSource) source_; + } + return com.google.cloud.vision.v1.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.v1.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.v1.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.v1.ImportProductSetsInputConfig)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ImportProductSetsInputConfig other = (com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ImportProductSetsInputConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ImportProductSetsInputConfig) + com.google.cloud.vision.v1.ImportProductSetsInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ImportProductSetsInputConfig.class, com.google.cloud.vision.v1.ImportProductSetsInputConfig.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ImportProductSetsInputConfig getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ImportProductSetsInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ImportProductSetsInputConfig build() { + com.google.cloud.vision.v1.ImportProductSetsInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ImportProductSetsInputConfig buildPartial() { + com.google.cloud.vision.v1.ImportProductSetsInputConfig result = new com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig) { + return mergeFrom((com.google.cloud.vision.v1.ImportProductSetsInputConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ImportProductSetsInputConfig other) { + if (other == com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource, com.google.cloud.vision.v1.ImportProductSetsGcsSource.Builder, com.google.cloud.vision.v1.ImportProductSetsGcsSourceOrBuilder> gcsSourceBuilder_; + /** + *
+     * The Google Cloud Storage location for a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1.ImportProductSetsGcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.vision.v1.ImportProductSetsGcsSource) source_; + } + return com.google.cloud.vision.v1.ImportProductSetsGcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.vision.v1.ImportProductSetsGcsSource.getDefaultInstance(); + } + } + /** + *
+     * The Google Cloud Storage location for a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1.ImportProductSetsGcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource gcs_source = 1; + */ + public Builder setGcsSource( + com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource gcs_source = 1; + */ + public Builder mergeGcsSource(com.google.cloud.vision.v1.ImportProductSetsGcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1 && + source_ != com.google.cloud.vision.v1.ImportProductSetsGcsSource.getDefaultInstance()) { + source_ = com.google.cloud.vision.v1.ImportProductSetsGcsSource.newBuilder((com.google.cloud.vision.v1.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.v1.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.v1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1.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.v1.ImportProductSetsGcsSource gcs_source = 1; + */ + public com.google.cloud.vision.v1.ImportProductSetsGcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 1) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.vision.v1.ImportProductSetsGcsSource) source_; + } + return com.google.cloud.vision.v1.ImportProductSetsGcsSource.getDefaultInstance(); + } + } + /** + *
+     * The Google Cloud Storage location for a csv file which preserves a list
+     * of ImportProductSetRequests in each line.
+     * 
+ * + * .google.cloud.vision.v1.ImportProductSetsGcsSource gcs_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ImportProductSetsGcsSource, com.google.cloud.vision.v1.ImportProductSetsGcsSource.Builder, com.google.cloud.vision.v1.ImportProductSetsGcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.vision.v1.ImportProductSetsGcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ImportProductSetsGcsSource, com.google.cloud.vision.v1.ImportProductSetsGcsSource.Builder, com.google.cloud.vision.v1.ImportProductSetsGcsSourceOrBuilder>( + (com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ImportProductSetsInputConfig) + private static final com.google.cloud.vision.v1.ImportProductSetsInputConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ImportProductSetsInputConfig(); + } + + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsInputConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsInputConfigOrBuilder.java new file mode 100644 index 000000000000..6a39ef57d7ac --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsInputConfigOrBuilder.java @@ -0,0 +1,39 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ImportProductSetsInputConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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.v1.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.v1.ImportProductSetsGcsSource gcs_source = 1; + */ + com.google.cloud.vision.v1.ImportProductSetsGcsSource getGcsSource(); + /** + *
+   * The Google Cloud Storage location for a csv file which preserves a list
+   * of ImportProductSetRequests in each line.
+   * 
+ * + * .google.cloud.vision.v1.ImportProductSetsGcsSource gcs_source = 1; + */ + com.google.cloud.vision.v1.ImportProductSetsGcsSourceOrBuilder getGcsSourceOrBuilder(); + + public com.google.cloud.vision.v1.ImportProductSetsInputConfig.SourceCase getSourceCase(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsRequest.java new file mode 100644 index 000000000000..ae8ba5a8cf6d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsRequest.java @@ -0,0 +1,813 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `ImportProductSets` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ImportProductSetsRequest} + */ +public final class ImportProductSetsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = input.readMessage(com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ImportProductSetsRequest.class, com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig inputConfig_; + /** + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1.ImportProductSetsInputConfig input_config = 2; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1.ImportProductSetsInputConfig getInputConfig() { + return inputConfig_ == null ? com.google.cloud.vision.v1.ImportProductSetsInputConfig.getDefaultInstance() : inputConfig_; + } + /** + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1.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.v1.ImportProductSetsRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ImportProductSetsRequest other = (com.google.cloud.vision.v1.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.v1.ImportProductSetsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ImportProductSetsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ImportProductSetsRequest) + com.google.cloud.vision.v1.ImportProductSetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ImportProductSetsRequest.class, com.google.cloud.vision.v1.ImportProductSetsRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ImportProductSetsRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ImportProductSetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ImportProductSetsRequest build() { + com.google.cloud.vision.v1.ImportProductSetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ImportProductSetsRequest buildPartial() { + com.google.cloud.vision.v1.ImportProductSetsRequest result = new com.google.cloud.vision.v1.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.v1.ImportProductSetsRequest) { + return mergeFrom((com.google.cloud.vision.v1.ImportProductSetsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ImportProductSetsRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.ImportProductSetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig inputConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ImportProductSetsInputConfig, com.google.cloud.vision.v1.ImportProductSetsInputConfig.Builder, com.google.cloud.vision.v1.ImportProductSetsInputConfigOrBuilder> inputConfigBuilder_; + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1.ImportProductSetsInputConfig input_config = 2; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1.ImportProductSetsInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null ? com.google.cloud.vision.v1.ImportProductSetsInputConfig.getDefaultInstance() : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1.ImportProductSetsInputConfig input_config = 2; + */ + public Builder setInputConfig(com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig input_config = 2; + */ + public Builder setInputConfig( + com.google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig input_config = 2; + */ + public Builder mergeInputConfig(com.google.cloud.vision.v1.ImportProductSetsInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.vision.v1.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.v1.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.v1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1.ImportProductSetsInputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1.ImportProductSetsInputConfig input_config = 2; + */ + public com.google.cloud.vision.v1.ImportProductSetsInputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null ? + com.google.cloud.vision.v1.ImportProductSetsInputConfig.getDefaultInstance() : inputConfig_; + } + } + /** + *
+     * The input content for the list of requests.
+     * 
+ * + * .google.cloud.vision.v1.ImportProductSetsInputConfig input_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ImportProductSetsInputConfig, com.google.cloud.vision.v1.ImportProductSetsInputConfig.Builder, com.google.cloud.vision.v1.ImportProductSetsInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ImportProductSetsInputConfig, com.google.cloud.vision.v1.ImportProductSetsInputConfig.Builder, com.google.cloud.vision.v1.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.v1.ImportProductSetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ImportProductSetsRequest) + private static final com.google.cloud.vision.v1.ImportProductSetsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ImportProductSetsRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsRequestOrBuilder.java new file mode 100644 index 000000000000..2ce59bf66ba4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsRequestOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ImportProductSetsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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.v1.ImportProductSetsInputConfig input_config = 2; + */ + boolean hasInputConfig(); + /** + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1.ImportProductSetsInputConfig input_config = 2; + */ + com.google.cloud.vision.v1.ImportProductSetsInputConfig getInputConfig(); + /** + *
+   * The input content for the list of requests.
+   * 
+ * + * .google.cloud.vision.v1.ImportProductSetsInputConfig input_config = 2; + */ + com.google.cloud.vision.v1.ImportProductSetsInputConfigOrBuilder getInputConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsResponse.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsResponse.java new file mode 100644 index 000000000000..f1b4beee4aae --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsResponse.java @@ -0,0 +1,1392 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * 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.v1.ImportProductSetsResponse} + */ +public final class ImportProductSetsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ImportProductSetsResponse.class, com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public java.util.List getReferenceImagesList() { + return referenceImages_; + } + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesOrBuilderList() { + return referenceImages_; + } + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public int getReferenceImagesCount() { + return referenceImages_.size(); + } + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.ReferenceImage getReferenceImages(int index) { + return referenceImages_.get(index); + } + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.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.v1.ImportProductSetsResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ImportProductSetsResponse other = (com.google.cloud.vision.v1.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.v1.ImportProductSetsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ImportProductSetsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ImportProductSetsResponse) + com.google.cloud.vision.v1.ImportProductSetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ImportProductSetsResponse.class, com.google.cloud.vision.v1.ImportProductSetsResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ImportProductSetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ImportProductSetsResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ImportProductSetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ImportProductSetsResponse build() { + com.google.cloud.vision.v1.ImportProductSetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ImportProductSetsResponse buildPartial() { + com.google.cloud.vision.v1.ImportProductSetsResponse result = new com.google.cloud.vision.v1.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.v1.ImportProductSetsResponse) { + return mergeFrom((com.google.cloud.vision.v1.ImportProductSetsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ImportProductSetsResponse other) { + if (other == com.google.cloud.vision.v1.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.v1.ImportProductSetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.ReferenceImage, com.google.cloud.vision.v1.ReferenceImage.Builder, com.google.cloud.vision.v1.ReferenceImageOrBuilder> referenceImagesBuilder_; + + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1.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.v1.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.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public Builder setReferenceImages( + int index, com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public Builder setReferenceImages( + int index, com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages(com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + int index, com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + int index, com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.ReferenceImage.Builder getReferenceImagesBuilder( + int index) { + return getReferenceImagesFieldBuilder().getBuilder(index); + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.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.v1.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.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.ReferenceImage.Builder addReferenceImagesBuilder() { + return getReferenceImagesFieldBuilder().addBuilder( + com.google.cloud.vision.v1.ReferenceImage.getDefaultInstance()); + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.ReferenceImage.Builder addReferenceImagesBuilder( + int index) { + return getReferenceImagesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1.ReferenceImage.getDefaultInstance()); + } + /** + *
+     * The list of reference_images that are imported successfully.
+     * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesBuilderList() { + return getReferenceImagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ReferenceImage, com.google.cloud.vision.v1.ReferenceImage.Builder, com.google.cloud.vision.v1.ReferenceImageOrBuilder> + getReferenceImagesFieldBuilder() { + if (referenceImagesBuilder_ == null) { + referenceImagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ReferenceImage, com.google.cloud.vision.v1.ReferenceImage.Builder, com.google.cloud.vision.v1.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.v1.ImportProductSetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ImportProductSetsResponse) + private static final com.google.cloud.vision.v1.ImportProductSetsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ImportProductSetsResponse(); + } + + public static com.google.cloud.vision.v1.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.v1.ImportProductSetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsResponseOrBuilder.java new file mode 100644 index 000000000000..1a85174ad21d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImportProductSetsResponseOrBuilder.java @@ -0,0 +1,117 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ImportProductSetsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.ImportProductSetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + java.util.List + getReferenceImagesList(); + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + com.google.cloud.vision.v1.ReferenceImage getReferenceImages(int index); + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + int getReferenceImagesCount(); + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + java.util.List + getReferenceImagesOrBuilderList(); + /** + *
+   * The list of reference_images that are imported successfully.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + com.google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsRequest.java new file mode 100644 index 000000000000..a52217c5fe43 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsRequest.java @@ -0,0 +1,813 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `ListProductSets` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ListProductSetsRequest} + */ +public final class ListProductSetsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductSetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListProductSetsRequest.class, com.google.cloud.vision.v1.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.v1.ListProductSetsRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ListProductSetsRequest other = (com.google.cloud.vision.v1.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.v1.ListProductSetsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductSetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductSetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductSetsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ListProductSetsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ListProductSetsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ListProductSetsRequest) + com.google.cloud.vision.v1.ListProductSetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductSetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductSetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListProductSetsRequest.class, com.google.cloud.vision.v1.ListProductSetsRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductSetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductSetsRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ListProductSetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductSetsRequest build() { + com.google.cloud.vision.v1.ListProductSetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductSetsRequest buildPartial() { + com.google.cloud.vision.v1.ListProductSetsRequest result = new com.google.cloud.vision.v1.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.v1.ListProductSetsRequest) { + return mergeFrom((com.google.cloud.vision.v1.ListProductSetsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ListProductSetsRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.ListProductSetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.ListProductSetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ListProductSetsRequest) + private static final com.google.cloud.vision.v1.ListProductSetsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ListProductSetsRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.ListProductSetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsRequestOrBuilder.java new file mode 100644 index 000000000000..e9deeec296b3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsRequestOrBuilder.java @@ -0,0 +1,56 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ListProductSetsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsResponse.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsResponse.java new file mode 100644 index 000000000000..672cee835a4b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsResponse.java @@ -0,0 +1,1024 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Response message for the `ListProductSets` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ListProductSetsResponse} + */ +public final class ListProductSetsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductSetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListProductSetsResponse.class, com.google.cloud.vision.v1.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.v1.ProductSet product_sets = 1; + */ + public java.util.List getProductSetsList() { + return productSets_; + } + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + public java.util.List + getProductSetsOrBuilderList() { + return productSets_; + } + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + public int getProductSetsCount() { + return productSets_.size(); + } + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1.ProductSet getProductSets(int index) { + return productSets_.get(index); + } + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1.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.v1.ListProductSetsResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ListProductSetsResponse other = (com.google.cloud.vision.v1.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.v1.ListProductSetsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductSetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductSetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductSetsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ListProductSetsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ListProductSetsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ListProductSetsResponse) + com.google.cloud.vision.v1.ListProductSetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductSetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductSetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListProductSetsResponse.class, com.google.cloud.vision.v1.ListProductSetsResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductSetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductSetsResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ListProductSetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductSetsResponse build() { + com.google.cloud.vision.v1.ListProductSetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductSetsResponse buildPartial() { + com.google.cloud.vision.v1.ListProductSetsResponse result = new com.google.cloud.vision.v1.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.v1.ListProductSetsResponse) { + return mergeFrom((com.google.cloud.vision.v1.ListProductSetsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ListProductSetsResponse other) { + if (other == com.google.cloud.vision.v1.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.v1.ListProductSetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.ProductSet, com.google.cloud.vision.v1.ProductSet.Builder, com.google.cloud.vision.v1.ProductSetOrBuilder> productSetsBuilder_; + + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1.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.v1.ProductSet product_sets = 1; + */ + public int getProductSetsCount() { + if (productSetsBuilder_ == null) { + return productSets_.size(); + } else { + return productSetsBuilder_.getCount(); + } + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1.ProductSet getProductSets(int index) { + if (productSetsBuilder_ == null) { + return productSets_.get(index); + } else { + return productSetsBuilder_.getMessage(index); + } + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + public Builder setProductSets( + int index, com.google.cloud.vision.v1.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.v1.ProductSet product_sets = 1; + */ + public Builder setProductSets( + int index, com.google.cloud.vision.v1.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.v1.ProductSet product_sets = 1; + */ + public Builder addProductSets(com.google.cloud.vision.v1.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.v1.ProductSet product_sets = 1; + */ + public Builder addProductSets( + int index, com.google.cloud.vision.v1.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.v1.ProductSet product_sets = 1; + */ + public Builder addProductSets( + com.google.cloud.vision.v1.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.v1.ProductSet product_sets = 1; + */ + public Builder addProductSets( + int index, com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1.ProductSet.Builder getProductSetsBuilder( + int index) { + return getProductSetsFieldBuilder().getBuilder(index); + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1.ProductSetOrBuilder getProductSetsOrBuilder( + int index) { + if (productSetsBuilder_ == null) { + return productSets_.get(index); } else { + return productSetsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1.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.v1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1.ProductSet.Builder addProductSetsBuilder() { + return getProductSetsFieldBuilder().addBuilder( + com.google.cloud.vision.v1.ProductSet.getDefaultInstance()); + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + public com.google.cloud.vision.v1.ProductSet.Builder addProductSetsBuilder( + int index) { + return getProductSetsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1.ProductSet.getDefaultInstance()); + } + /** + *
+     * List of ProductSets.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + public java.util.List + getProductSetsBuilderList() { + return getProductSetsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ProductSet, com.google.cloud.vision.v1.ProductSet.Builder, com.google.cloud.vision.v1.ProductSetOrBuilder> + getProductSetsFieldBuilder() { + if (productSetsBuilder_ == null) { + productSetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ProductSet, com.google.cloud.vision.v1.ProductSet.Builder, com.google.cloud.vision.v1.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.v1.ListProductSetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ListProductSetsResponse) + private static final com.google.cloud.vision.v1.ListProductSetsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ListProductSetsResponse(); + } + + public static com.google.cloud.vision.v1.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.v1.ListProductSetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsResponseOrBuilder.java new file mode 100644 index 000000000000..1ffd69f4a258 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductSetsResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ListProductSetsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.ListProductSetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + java.util.List + getProductSetsList(); + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + com.google.cloud.vision.v1.ProductSet getProductSets(int index); + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + int getProductSetsCount(); + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + java.util.List + getProductSetsOrBuilderList(); + /** + *
+   * List of ProductSets.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSet product_sets = 1; + */ + com.google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetRequest.java new file mode 100644 index 000000000000..dfe4d60ad63a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetRequest.java @@ -0,0 +1,820 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `ListProductsInProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ListProductsInProductSetRequest} + */ +public final class ListProductsInProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsInProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsInProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListProductsInProductSetRequest.class, com.google.cloud.vision.v1.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.v1.ListProductsInProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ListProductsInProductSetRequest other = (com.google.cloud.vision.v1.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.v1.ListProductsInProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsInProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsInProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsInProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsInProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ListProductsInProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ListProductsInProductSetRequest) + com.google.cloud.vision.v1.ListProductsInProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsInProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsInProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListProductsInProductSetRequest.class, com.google.cloud.vision.v1.ListProductsInProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsInProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductsInProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ListProductsInProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductsInProductSetRequest build() { + com.google.cloud.vision.v1.ListProductsInProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductsInProductSetRequest buildPartial() { + com.google.cloud.vision.v1.ListProductsInProductSetRequest result = new com.google.cloud.vision.v1.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.v1.ListProductsInProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1.ListProductsInProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ListProductsInProductSetRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.ListProductsInProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.ListProductsInProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ListProductsInProductSetRequest) + private static final com.google.cloud.vision.v1.ListProductsInProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ListProductsInProductSetRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.ListProductsInProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..39c8a93a1b97 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetRequestOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ListProductsInProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetResponse.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetResponse.java new file mode 100644 index 000000000000..2d16e63322e9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetResponse.java @@ -0,0 +1,1024 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Response message for the `ListProductsInProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ListProductsInProductSetResponse} + */ +public final class ListProductsInProductSetResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsInProductSetResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsInProductSetResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListProductsInProductSetResponse.class, com.google.cloud.vision.v1.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.v1.Product products = 1; + */ + public java.util.List getProductsList() { + return products_; + } + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public int getProductsCount() { + return products_.size(); + } + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.Product getProducts(int index) { + return products_.get(index); + } + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.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.v1.ListProductsInProductSetResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ListProductsInProductSetResponse other = (com.google.cloud.vision.v1.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.v1.ListProductsInProductSetResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsInProductSetResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsInProductSetResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsInProductSetResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsInProductSetResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ListProductsInProductSetResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ListProductsInProductSetResponse) + com.google.cloud.vision.v1.ListProductsInProductSetResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsInProductSetResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsInProductSetResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListProductsInProductSetResponse.class, com.google.cloud.vision.v1.ListProductsInProductSetResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsInProductSetResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductsInProductSetResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ListProductsInProductSetResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductsInProductSetResponse build() { + com.google.cloud.vision.v1.ListProductsInProductSetResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductsInProductSetResponse buildPartial() { + com.google.cloud.vision.v1.ListProductsInProductSetResponse result = new com.google.cloud.vision.v1.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.v1.ListProductsInProductSetResponse) { + return mergeFrom((com.google.cloud.vision.v1.ListProductsInProductSetResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ListProductsInProductSetResponse other) { + if (other == com.google.cloud.vision.v1.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.v1.ListProductsInProductSetResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.ProductOrBuilder> productsBuilder_; + + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1.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.v1.Product products = 1; + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.vision.v1.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.v1.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.vision.v1.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.v1.Product products = 1; + */ + public Builder addProducts(com.google.cloud.vision.v1.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.v1.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.vision.v1.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.v1.Product products = 1; + */ + public Builder addProducts( + com.google.cloud.vision.v1.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.v1.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.Product.Builder getProductsBuilder( + int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.ProductOrBuilder getProductsOrBuilder( + int index) { + if (productsBuilder_ == null) { + return products_.get(index); } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1.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.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder().addBuilder( + com.google.cloud.vision.v1.Product.getDefaultInstance()); + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.Product.Builder addProductsBuilder( + int index) { + return getProductsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1.Product.getDefaultInstance()); + } + /** + *
+     * The list of Products.
+     * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public java.util.List + getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.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.v1.ListProductsInProductSetResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ListProductsInProductSetResponse) + private static final com.google.cloud.vision.v1.ListProductsInProductSetResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ListProductsInProductSetResponse(); + } + + public static com.google.cloud.vision.v1.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.v1.ListProductsInProductSetResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetResponseOrBuilder.java new file mode 100644 index 000000000000..1608b9cf1807 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsInProductSetResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ListProductsInProductSetResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.ListProductsInProductSetResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + java.util.List + getProductsList(); + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + com.google.cloud.vision.v1.Product getProducts(int index); + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + int getProductsCount(); + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + java.util.List + getProductsOrBuilderList(); + /** + *
+   * The list of Products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + com.google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/ListProductsRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsRequest.java new file mode 100644 index 000000000000..ab62a0f1a9c8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsRequest.java @@ -0,0 +1,820 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `ListProducts` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ListProductsRequest} + */ +public final class ListProductsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListProductsRequest.class, com.google.cloud.vision.v1.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.v1.ListProductsRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ListProductsRequest other = (com.google.cloud.vision.v1.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.v1.ListProductsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ListProductsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ListProductsRequest) + com.google.cloud.vision.v1.ListProductsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListProductsRequest.class, com.google.cloud.vision.v1.ListProductsRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductsRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ListProductsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductsRequest build() { + com.google.cloud.vision.v1.ListProductsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductsRequest buildPartial() { + com.google.cloud.vision.v1.ListProductsRequest result = new com.google.cloud.vision.v1.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.v1.ListProductsRequest) { + return mergeFrom((com.google.cloud.vision.v1.ListProductsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ListProductsRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.ListProductsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.ListProductsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ListProductsRequest) + private static final com.google.cloud.vision.v1.ListProductsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ListProductsRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.ListProductsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsRequestOrBuilder.java new file mode 100644 index 000000000000..5538b413b0bd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsRequestOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ListProductsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/ListProductsResponse.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsResponse.java new file mode 100644 index 000000000000..6bdfc15b097a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsResponse.java @@ -0,0 +1,1024 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Response message for the `ListProducts` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ListProductsResponse} + */ +public final class ListProductsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListProductsResponse.class, com.google.cloud.vision.v1.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.v1.Product products = 1; + */ + public java.util.List getProductsList() { + return products_; + } + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public int getProductsCount() { + return products_.size(); + } + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.Product getProducts(int index) { + return products_.get(index); + } + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.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.v1.ListProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ListProductsResponse other = (com.google.cloud.vision.v1.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.v1.ListProductsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ListProductsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ListProductsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ListProductsResponse) + com.google.cloud.vision.v1.ListProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListProductsResponse.class, com.google.cloud.vision.v1.ListProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductsResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ListProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductsResponse build() { + com.google.cloud.vision.v1.ListProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListProductsResponse buildPartial() { + com.google.cloud.vision.v1.ListProductsResponse result = new com.google.cloud.vision.v1.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.v1.ListProductsResponse) { + return mergeFrom((com.google.cloud.vision.v1.ListProductsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ListProductsResponse other) { + if (other == com.google.cloud.vision.v1.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.v1.ListProductsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.ProductOrBuilder> productsBuilder_; + + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1.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.v1.Product products = 1; + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.vision.v1.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.v1.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.vision.v1.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.v1.Product products = 1; + */ + public Builder addProducts(com.google.cloud.vision.v1.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.v1.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.vision.v1.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.v1.Product products = 1; + */ + public Builder addProducts( + com.google.cloud.vision.v1.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.v1.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.Product.Builder getProductsBuilder( + int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.ProductOrBuilder getProductsOrBuilder( + int index) { + if (productsBuilder_ == null) { + return products_.get(index); } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1.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.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder().addBuilder( + com.google.cloud.vision.v1.Product.getDefaultInstance()); + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public com.google.cloud.vision.v1.Product.Builder addProductsBuilder( + int index) { + return getProductsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1.Product.getDefaultInstance()); + } + /** + *
+     * List of products.
+     * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + public java.util.List + getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.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.v1.ListProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ListProductsResponse) + private static final com.google.cloud.vision.v1.ListProductsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ListProductsResponse(); + } + + public static com.google.cloud.vision.v1.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.v1.ListProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsResponseOrBuilder.java new file mode 100644 index 000000000000..69c65b3b2590 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListProductsResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ListProductsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.ListProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + java.util.List + getProductsList(); + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + com.google.cloud.vision.v1.Product getProducts(int index); + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + int getProductsCount(); + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + java.util.List + getProductsOrBuilderList(); + /** + *
+   * List of products.
+   * 
+ * + * repeated .google.cloud.vision.v1.Product products = 1; + */ + com.google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesRequest.java new file mode 100644 index 000000000000..3dca1b843ab6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesRequest.java @@ -0,0 +1,834 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `ListReferenceImages` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ListReferenceImagesRequest} + */ +public final class ListReferenceImagesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListReferenceImagesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListReferenceImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListReferenceImagesRequest.class, com.google.cloud.vision.v1.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.v1.ListReferenceImagesRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ListReferenceImagesRequest other = (com.google.cloud.vision.v1.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.v1.ListReferenceImagesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListReferenceImagesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListReferenceImagesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListReferenceImagesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ListReferenceImagesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ListReferenceImagesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ListReferenceImagesRequest) + com.google.cloud.vision.v1.ListReferenceImagesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListReferenceImagesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListReferenceImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListReferenceImagesRequest.class, com.google.cloud.vision.v1.ListReferenceImagesRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListReferenceImagesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListReferenceImagesRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ListReferenceImagesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListReferenceImagesRequest build() { + com.google.cloud.vision.v1.ListReferenceImagesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListReferenceImagesRequest buildPartial() { + com.google.cloud.vision.v1.ListReferenceImagesRequest result = new com.google.cloud.vision.v1.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.v1.ListReferenceImagesRequest) { + return mergeFrom((com.google.cloud.vision.v1.ListReferenceImagesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ListReferenceImagesRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.ListReferenceImagesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.ListReferenceImagesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ListReferenceImagesRequest) + private static final com.google.cloud.vision.v1.ListReferenceImagesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ListReferenceImagesRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.ListReferenceImagesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesRequestOrBuilder.java new file mode 100644 index 000000000000..d143ffc6436d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesRequestOrBuilder.java @@ -0,0 +1,62 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ListReferenceImagesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesResponse.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesResponse.java new file mode 100644 index 000000000000..3c4145f1f27e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesResponse.java @@ -0,0 +1,1091 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Response message for the `ListReferenceImages` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ListReferenceImagesResponse} + */ +public final class ListReferenceImagesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListReferenceImagesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListReferenceImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListReferenceImagesResponse.class, com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public java.util.List getReferenceImagesList() { + return referenceImages_; + } + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesOrBuilderList() { + return referenceImages_; + } + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public int getReferenceImagesCount() { + return referenceImages_.size(); + } + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.ReferenceImage getReferenceImages(int index) { + return referenceImages_.get(index); + } + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.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.v1.ListReferenceImagesResponse)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ListReferenceImagesResponse other = (com.google.cloud.vision.v1.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.v1.ListReferenceImagesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListReferenceImagesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListReferenceImagesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ListReferenceImagesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ListReferenceImagesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ListReferenceImagesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ListReferenceImagesResponse) + com.google.cloud.vision.v1.ListReferenceImagesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListReferenceImagesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListReferenceImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ListReferenceImagesResponse.class, com.google.cloud.vision.v1.ListReferenceImagesResponse.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ListReferenceImagesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListReferenceImagesResponse getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ListReferenceImagesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListReferenceImagesResponse build() { + com.google.cloud.vision.v1.ListReferenceImagesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ListReferenceImagesResponse buildPartial() { + com.google.cloud.vision.v1.ListReferenceImagesResponse result = new com.google.cloud.vision.v1.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.v1.ListReferenceImagesResponse) { + return mergeFrom((com.google.cloud.vision.v1.ListReferenceImagesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ListReferenceImagesResponse other) { + if (other == com.google.cloud.vision.v1.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.v1.ListReferenceImagesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.ReferenceImage, com.google.cloud.vision.v1.ReferenceImage.Builder, com.google.cloud.vision.v1.ReferenceImageOrBuilder> referenceImagesBuilder_; + + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1.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.v1.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.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public Builder setReferenceImages( + int index, com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public Builder setReferenceImages( + int index, com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages(com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + int index, com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + com.google.cloud.vision.v1.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.v1.ReferenceImage reference_images = 1; + */ + public Builder addReferenceImages( + int index, com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.ReferenceImage.Builder getReferenceImagesBuilder( + int index) { + return getReferenceImagesFieldBuilder().getBuilder(index); + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.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.v1.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.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.ReferenceImage.Builder addReferenceImagesBuilder() { + return getReferenceImagesFieldBuilder().addBuilder( + com.google.cloud.vision.v1.ReferenceImage.getDefaultInstance()); + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public com.google.cloud.vision.v1.ReferenceImage.Builder addReferenceImagesBuilder( + int index) { + return getReferenceImagesFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1.ReferenceImage.getDefaultInstance()); + } + /** + *
+     * The list of reference images.
+     * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + public java.util.List + getReferenceImagesBuilderList() { + return getReferenceImagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ReferenceImage, com.google.cloud.vision.v1.ReferenceImage.Builder, com.google.cloud.vision.v1.ReferenceImageOrBuilder> + getReferenceImagesFieldBuilder() { + if (referenceImagesBuilder_ == null) { + referenceImagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ReferenceImage, com.google.cloud.vision.v1.ReferenceImage.Builder, com.google.cloud.vision.v1.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.v1.ListReferenceImagesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ListReferenceImagesResponse) + private static final com.google.cloud.vision.v1.ListReferenceImagesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ListReferenceImagesResponse(); + } + + public static com.google.cloud.vision.v1.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.v1.ListReferenceImagesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesResponseOrBuilder.java new file mode 100644 index 000000000000..5c6c11619611 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ListReferenceImagesResponseOrBuilder.java @@ -0,0 +1,80 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ListReferenceImagesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.ListReferenceImagesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + java.util.List + getReferenceImagesList(); + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + com.google.cloud.vision.v1.ReferenceImage getReferenceImages(int index); + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + int getReferenceImagesCount(); + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + java.util.List + getReferenceImagesOrBuilderList(); + /** + *
+   * The list of reference images.
+   * 
+ * + * repeated .google.cloud.vision.v1.ReferenceImage reference_images = 1; + */ + com.google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/LocationName.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/LocationName.java new file mode 100644 index 000000000000..d47e6eaead1c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/LocationName.java @@ -0,0 +1,189 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.cloud.vision.v1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LocationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public static LocationName of(String project, String location) { + return newBuilder() + .setProject(project) + .setLocation(location) + .build(); + } + + public static String format(String project, String location) { + return newBuilder() + .setProject(project) + .setLocation(location) + .build() + .toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location); + } + + /** Builder for LocationName. */ + public static class Builder { + + private String project; + private String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder() { + } + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LocationName) { + LocationName that = (LocationName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/Product.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/Product.java new file mode 100644 index 000000000000..6cd436cbf7f2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/Product.java @@ -0,0 +1,2454 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * A Product contains ReferenceImages.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.Product} + */ +public final class Product extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_Product_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.Product.class, com.google.cloud.vision.v1.Product.Builder.class); + } + + public interface KeyValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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.v1.Product.KeyValue} + */ + public static final class KeyValue extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_Product_KeyValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_Product_KeyValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.Product.KeyValue.class, com.google.cloud.vision.v1.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.v1.Product.KeyValue)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.Product.KeyValue other = (com.google.cloud.vision.v1.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.v1.Product.KeyValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.Product.KeyValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.Product.KeyValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.Product.KeyValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.Product.KeyValue) + com.google.cloud.vision.v1.Product.KeyValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_Product_KeyValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_Product_KeyValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.Product.KeyValue.class, com.google.cloud.vision.v1.Product.KeyValue.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_Product_KeyValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.Product.KeyValue getDefaultInstanceForType() { + return com.google.cloud.vision.v1.Product.KeyValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.Product.KeyValue build() { + com.google.cloud.vision.v1.Product.KeyValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.Product.KeyValue buildPartial() { + com.google.cloud.vision.v1.Product.KeyValue result = new com.google.cloud.vision.v1.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.v1.Product.KeyValue) { + return mergeFrom((com.google.cloud.vision.v1.Product.KeyValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.Product.KeyValue other) { + if (other == com.google.cloud.vision.v1.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.v1.Product.KeyValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.Product.KeyValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.Product.KeyValue) + private static final com.google.cloud.vision.v1.Product.KeyValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.Product.KeyValue(); + } + + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1.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.v1.Product)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.Product other = (com.google.cloud.vision.v1.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.v1.Product parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.Product parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.Product parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.Product parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.Product parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.Product} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.Product) + com.google.cloud.vision.v1.ProductOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_Product_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.Product.class, com.google.cloud.vision.v1.Product.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_Product_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.Product getDefaultInstanceForType() { + return com.google.cloud.vision.v1.Product.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.Product build() { + com.google.cloud.vision.v1.Product result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.Product buildPartial() { + com.google.cloud.vision.v1.Product result = new com.google.cloud.vision.v1.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.v1.Product) { + return mergeFrom((com.google.cloud.vision.v1.Product)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.Product other) { + if (other == com.google.cloud.vision.v1.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.v1.Product parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.Product.KeyValue, com.google.cloud.vision.v1.Product.KeyValue.Builder, com.google.cloud.vision.v1.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.v1.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.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public Builder setProductLabels( + int index, com.google.cloud.vision.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public Builder setProductLabels( + int index, com.google.cloud.vision.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public Builder addProductLabels(com.google.cloud.vision.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public Builder addProductLabels( + int index, com.google.cloud.vision.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public Builder addProductLabels( + com.google.cloud.vision.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public Builder addProductLabels( + int index, com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1.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.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1.Product.KeyValue.Builder addProductLabelsBuilder() { + return getProductLabelsFieldBuilder().addBuilder( + com.google.cloud.vision.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public com.google.cloud.vision.v1.Product.KeyValue.Builder addProductLabelsBuilder( + int index) { + return getProductLabelsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1.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.v1.Product.KeyValue product_labels = 5; + */ + public java.util.List + getProductLabelsBuilderList() { + return getProductLabelsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.Product.KeyValue, com.google.cloud.vision.v1.Product.KeyValue.Builder, com.google.cloud.vision.v1.Product.KeyValueOrBuilder> + getProductLabelsFieldBuilder() { + if (productLabelsBuilder_ == null) { + productLabelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.Product.KeyValue, com.google.cloud.vision.v1.Product.KeyValue.Builder, com.google.cloud.vision.v1.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.v1.Product) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.Product) + private static final com.google.cloud.vision.v1.Product DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.Product(); + } + + public static com.google.cloud.vision.v1.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.v1.Product getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductName.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductName.java new file mode 100644 index 000000000000..be53c8aee3bd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductName.java @@ -0,0 +1,212 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.cloud.vision.v1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ProductName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/products/{product}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String product; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProduct() { + return product; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProductName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + product = Preconditions.checkNotNull(builder.getProduct()); + } + + public static ProductName of(String project, String location, String product) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProduct(product) + .build(); + } + + public static String format(String project, String location, String product) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProduct(product) + .build() + .toString(); + } + + public static ProductName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProductName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("product")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ProductName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("product", product); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location, "product", product); + } + + /** Builder for ProductName. */ + public static class Builder { + + private String project; + private String location; + private String product; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProduct() { + return product; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setProduct(String product) { + this.product = product; + return this; + } + + private Builder() { + } + + private Builder(ProductName productName) { + project = productName.project; + location = productName.location; + product = productName.product; + } + + public ProductName build() { + return new ProductName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProductName) { + ProductName that = (ProductName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.product.equals(that.product)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= product.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductOrBuilder.java new file mode 100644 index 000000000000..18114314a32f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductOrBuilder.java @@ -0,0 +1,169 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ProductOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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.v1.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.v1.Product.KeyValue product_labels = 5; + */ + com.google.cloud.vision.v1.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.v1.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.v1.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.v1.Product.KeyValue product_labels = 5; + */ + com.google.cloud.vision.v1.Product.KeyValueOrBuilder getProductLabelsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchParams.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchParams.java new file mode 100644 index 000000000000..c20afd420e69 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchParams.java @@ -0,0 +1,1268 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Parameters for a product search request.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ProductSearchParams} + */ +public final class ProductSearchParams extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = input.readMessage(com.google.cloud.vision.v1.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.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ProductSearchParams.class, com.google.cloud.vision.v1.ProductSearchParams.Builder.class); + } + + private int bitField0_; + public static final int BOUNDING_POLY_FIELD_NUMBER = 9; + private com.google.cloud.vision.v1.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.v1.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.v1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null ? com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1.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.v1.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.v1.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.v1.ProductSearchParams)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ProductSearchParams other = (com.google.cloud.vision.v1.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.v1.ProductSearchParams parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSearchParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSearchParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSearchParams parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ProductSearchParams parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ProductSearchParams} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ProductSearchParams) + com.google.cloud.vision.v1.ProductSearchParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ProductSearchParams.class, com.google.cloud.vision.v1.ProductSearchParams.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchParams_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSearchParams getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ProductSearchParams.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSearchParams build() { + com.google.cloud.vision.v1.ProductSearchParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSearchParams buildPartial() { + com.google.cloud.vision.v1.ProductSearchParams result = new com.google.cloud.vision.v1.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.v1.ProductSearchParams) { + return mergeFrom((com.google.cloud.vision.v1.ProductSearchParams)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ProductSearchParams other) { + if (other == com.google.cloud.vision.v1.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.v1.ProductSearchParams parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.ProductSearchParams) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.vision.v1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.BoundingPoly, com.google.cloud.vision.v1.BoundingPoly.Builder, com.google.cloud.vision.v1.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.v1.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.v1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null ? com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_poly = 9; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_poly = 9; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_poly = 9; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1.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.v1.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.v1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_poly = 9; + */ + public com.google.cloud.vision.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null ? + com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_poly = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.BoundingPoly, com.google.cloud.vision.v1.BoundingPoly.Builder, com.google.cloud.vision.v1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.BoundingPoly, com.google.cloud.vision.v1.BoundingPoly.Builder, com.google.cloud.vision.v1.BoundingPolyOrBuilder>( + getBoundingPoly(), + getParentForChildren(), + isClean()); + boundingPoly_ = null; + } + return boundingPolyBuilder_; + } + + private java.lang.Object productSet_ = ""; + /** + *
+     * The resource name of a [ProductSet][google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.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.v1.ProductSearchParams) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ProductSearchParams) + private static final com.google.cloud.vision.v1.ProductSearchParams DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ProductSearchParams(); + } + + public static com.google.cloud.vision.v1.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.v1.ProductSearchParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchParamsOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchParamsOrBuilder.java new file mode 100644 index 000000000000..3e76cf66448a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchParamsOrBuilder.java @@ -0,0 +1,128 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search.proto + +package com.google.cloud.vision.v1; + +public interface ProductSearchParamsOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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.v1.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.v1.BoundingPoly bounding_poly = 9; + */ + com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_poly = 9; + */ + com.google.cloud.vision.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); + + /** + *
+   * The resource name of a [ProductSet][google.cloud.vision.v1.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.v1.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-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchProto.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchProto.java new file mode 100644 index 000000000000..7c75837fd0ce --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchProto.java @@ -0,0 +1,119 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search.proto + +package com.google.cloud.vision.v1; + +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_v1_ProductSearchParams_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ProductSearchParams_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ProductSearchResults_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ProductSearchResults_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ProductSearchResults_Result_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ProductSearchResults_Result_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ProductSearchResults_GroupedResult_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_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 = { + "\n+google/cloud/vision/v1/product_search." + + "proto\022\026google.cloud.vision.v1\032\034google/ap" + + "i/annotations.proto\032%google/cloud/vision" + + "/v1/geometry.proto\0323google/cloud/vision/" + + "v1/product_search_service.proto\032\037google/" + + "protobuf/timestamp.proto\"\223\001\n\023ProductSear" + + "chParams\022;\n\rbounding_poly\030\t \001(\0132$.google" + + ".cloud.vision.v1.BoundingPoly\022\023\n\013product" + + "_set\030\006 \001(\t\022\032\n\022product_categories\030\007 \003(\t\022\016" + + "\n\006filter\030\010 \001(\t\"\330\003\n\024ProductSearchResults\022" + + ".\n\nindex_time\030\002 \001(\0132\032.google.protobuf.Ti" + + "mestamp\022D\n\007results\030\005 \003(\01323.google.cloud." + + "vision.v1.ProductSearchResults.Result\022[\n" + + "\027product_grouped_results\030\006 \003(\0132:.google." + + "cloud.vision.v1.ProductSearchResults.Gro" + + "upedResult\032X\n\006Result\0220\n\007product\030\001 \001(\0132\037." + + "google.cloud.vision.v1.Product\022\r\n\005score\030" + + "\002 \001(\002\022\r\n\005image\030\003 \001(\t\032\222\001\n\rGroupedResult\022;" + + "\n\rbounding_poly\030\001 \001(\0132$.google.cloud.vis" + + "ion.v1.BoundingPoly\022D\n\007results\030\002 \003(\01323.g" + + "oogle.cloud.vision.v1.ProductSearchResul" + + "ts.ResultBz\n\032com.google.cloud.vision.v1B" + + "\022ProductSearchProtoP\001Z + * Results for a product search request. + *
+ * + * Protobuf type {@code google.cloud.vision.v1.ProductSearchResults} + */ +public final class ProductSearchResults extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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(); + mutable_bitField0_ |= 0x00000002; + } + results_.add( + input.readMessage(com.google.cloud.vision.v1.ProductSearchResults.Result.parser(), extensionRegistry)); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + productGroupedResults_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + productGroupedResults_.add( + input.readMessage(com.google.cloud.vision.v1.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.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ProductSearchResults.class, com.google.cloud.vision.v1.ProductSearchResults.Builder.class); + } + + public interface ResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.ProductSearchResults.Result) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + boolean hasProduct(); + /** + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + com.google.cloud.vision.v1.Product getProduct(); + /** + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result} + */ + public static final class Result extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = input.readMessage(com.google.cloud.vision.v1.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.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_Result_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_Result_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ProductSearchResults.Result.class, com.google.cloud.vision.v1.ProductSearchResults.Result.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1.Product product_; + /** + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public boolean hasProduct() { + return product_ != null; + } + /** + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public com.google.cloud.vision.v1.Product getProduct() { + return product_ == null ? com.google.cloud.vision.v1.Product.getDefaultInstance() : product_; + } + /** + *
+     * The Product.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ProductSearchResults.Result other = (com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.ProductSearchResults.Result} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ProductSearchResults.Result) + com.google.cloud.vision.v1.ProductSearchResults.ResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_Result_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_Result_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ProductSearchResults.Result.class, com.google.cloud.vision.v1.ProductSearchResults.Result.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_Result_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSearchResults.Result getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ProductSearchResults.Result.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSearchResults.Result build() { + com.google.cloud.vision.v1.ProductSearchResults.Result result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSearchResults.Result buildPartial() { + com.google.cloud.vision.v1.ProductSearchResults.Result result = new com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result) { + return mergeFrom((com.google.cloud.vision.v1.ProductSearchResults.Result)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ProductSearchResults.Result other) { + if (other == com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.ProductSearchResults.Result) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1.Product product_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.ProductOrBuilder> productBuilder_; + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public com.google.cloud.vision.v1.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null ? com.google.cloud.vision.v1.Product.getDefaultInstance() : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public Builder setProduct(com.google.cloud.vision.v1.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.v1.Product product = 1; + */ + public Builder setProduct( + com.google.cloud.vision.v1.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public Builder mergeProduct(com.google.cloud.vision.v1.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.vision.v1.Product.newBuilder(product_).mergeFrom(value).buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public com.google.cloud.vision.v1.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public com.google.cloud.vision.v1.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null ? + com.google.cloud.vision.v1.Product.getDefaultInstance() : product_; + } + } + /** + *
+       * The Product.
+       * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ProductSearchResults.Result) + private static final com.google.cloud.vision.v1.ProductSearchResults.Result DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ProductSearchResults.Result(); + } + + public static com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GroupedResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.ProductSearchResults.GroupedResult) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The bounding polygon around the product detected in the query image.
+     * 
+ * + * .google.cloud.vision.v1.BoundingPoly bounding_poly = 1; + */ + boolean hasBoundingPoly(); + /** + *
+     * The bounding polygon around the product detected in the query image.
+     * 
+ * + * .google.cloud.vision.v1.BoundingPoly bounding_poly = 1; + */ + com.google.cloud.vision.v1.BoundingPoly getBoundingPoly(); + /** + *
+     * The bounding polygon around the product detected in the query image.
+     * 
+ * + * .google.cloud.vision.v1.BoundingPoly bounding_poly = 1; + */ + com.google.cloud.vision.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); + + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + java.util.List + getResultsList(); + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + com.google.cloud.vision.v1.ProductSearchResults.Result getResults(int index); + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + int getResultsCount(); + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + java.util.List + getResultsOrBuilderList(); + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + com.google.cloud.vision.v1.ProductSearchResults.ResultOrBuilder getResultsOrBuilder( + int index); + } + /** + *
+   * Information about the products similar to a single product in a query
+   * image.
+   * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ProductSearchResults.GroupedResult} + */ + public static final class GroupedResult extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = input.readMessage(com.google.cloud.vision.v1.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(); + mutable_bitField0_ |= 0x00000002; + } + results_.add( + input.readMessage(com.google.cloud.vision.v1.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.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_GroupedResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_GroupedResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ProductSearchResults.GroupedResult.class, com.google.cloud.vision.v1.ProductSearchResults.GroupedResult.Builder.class); + } + + private int bitField0_; + public static final int BOUNDING_POLY_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1.BoundingPoly boundingPoly_; + /** + *
+     * The bounding polygon around the product detected in the query image.
+     * 
+ * + * .google.cloud.vision.v1.BoundingPoly bounding_poly = 1; + */ + public boolean hasBoundingPoly() { + return boundingPoly_ != null; + } + /** + *
+     * The bounding polygon around the product detected in the query image.
+     * 
+ * + * .google.cloud.vision.v1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null ? com.google.cloud.vision.v1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } + /** + *
+     * The bounding polygon around the product detected in the query image.
+     * 
+ * + * .google.cloud.vision.v1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 2; + */ + public java.util.List getResultsList() { + return results_; + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + public java.util.List + getResultsOrBuilderList() { + return results_; + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + public int getResultsCount() { + return results_.size(); + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + public com.google.cloud.vision.v1.ProductSearchResults.Result getResults(int index) { + return results_.get(index); + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + public com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ProductSearchResults.GroupedResult other = (com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.ProductSearchResults.GroupedResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ProductSearchResults.GroupedResult) + com.google.cloud.vision.v1.ProductSearchResults.GroupedResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_GroupedResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_GroupedResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ProductSearchResults.GroupedResult.class, com.google.cloud.vision.v1.ProductSearchResults.GroupedResult.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_GroupedResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSearchResults.GroupedResult getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ProductSearchResults.GroupedResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSearchResults.GroupedResult build() { + com.google.cloud.vision.v1.ProductSearchResults.GroupedResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSearchResults.GroupedResult buildPartial() { + com.google.cloud.vision.v1.ProductSearchResults.GroupedResult result = new com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult) { + return mergeFrom((com.google.cloud.vision.v1.ProductSearchResults.GroupedResult)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ProductSearchResults.GroupedResult other) { + if (other == com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.ProductSearchResults.GroupedResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.vision.v1.BoundingPoly boundingPoly_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.BoundingPoly, com.google.cloud.vision.v1.BoundingPoly.Builder, com.google.cloud.vision.v1.BoundingPolyOrBuilder> boundingPolyBuilder_; + /** + *
+       * The bounding polygon around the product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1.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.v1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null ? com.google.cloud.vision.v1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } else { + return boundingPolyBuilder_.getMessage(); + } + } + /** + *
+       * The bounding polygon around the product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1.BoundingPoly bounding_poly = 1; + */ + public Builder setBoundingPoly(com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_poly = 1; + */ + public Builder setBoundingPoly( + com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_poly = 1; + */ + public Builder mergeBoundingPoly(com.google.cloud.vision.v1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.vision.v1.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.v1.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.v1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1.BoundingPoly.Builder getBoundingPolyBuilder() { + + onChanged(); + return getBoundingPolyFieldBuilder().getBuilder(); + } + /** + *
+       * The bounding polygon around the product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1.BoundingPoly bounding_poly = 1; + */ + public com.google.cloud.vision.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null ? + com.google.cloud.vision.v1.BoundingPoly.getDefaultInstance() : boundingPoly_; + } + } + /** + *
+       * The bounding polygon around the product detected in the query image.
+       * 
+ * + * .google.cloud.vision.v1.BoundingPoly bounding_poly = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.BoundingPoly, com.google.cloud.vision.v1.BoundingPoly.Builder, com.google.cloud.vision.v1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.BoundingPoly, com.google.cloud.vision.v1.BoundingPoly.Builder, com.google.cloud.vision.v1.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(results_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchResults.Result, com.google.cloud.vision.v1.ProductSearchResults.Result.Builder, com.google.cloud.vision.v1.ProductSearchResults.ResultOrBuilder> resultsBuilder_; + + /** + *
+       * List of results, one for each product match.
+       * 
+ * + * repeated .google.cloud.vision.v1.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.v1.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.v1.ProductSearchResults.Result results = 2; + */ + public com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 2; + */ + public Builder setResults( + int index, com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 2; + */ + public Builder setResults( + int index, com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 2; + */ + public Builder addResults(com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 2; + */ + public Builder addResults( + int index, com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 2; + */ + public Builder addResults( + com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 2; + */ + public Builder addResults( + int index, com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 2; + */ + 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.v1.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.v1.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.v1.ProductSearchResults.Result results = 2; + */ + public com.google.cloud.vision.v1.ProductSearchResults.Result.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + *
+       * List of results, one for each product match.
+       * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + public com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 2; + */ + public java.util.List + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + *
+       * List of results, one for each product match.
+       * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + public com.google.cloud.vision.v1.ProductSearchResults.Result.Builder addResultsBuilder() { + return getResultsFieldBuilder().addBuilder( + com.google.cloud.vision.v1.ProductSearchResults.Result.getDefaultInstance()); + } + /** + *
+       * List of results, one for each product match.
+       * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + public com.google.cloud.vision.v1.ProductSearchResults.Result.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1.ProductSearchResults.Result.getDefaultInstance()); + } + /** + *
+       * List of results, one for each product match.
+       * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 2; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchResults.Result, com.google.cloud.vision.v1.ProductSearchResults.Result.Builder, com.google.cloud.vision.v1.ProductSearchResults.ResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchResults.Result, com.google.cloud.vision.v1.ProductSearchResults.Result.Builder, com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ProductSearchResults.GroupedResult) + private static final com.google.cloud.vision.v1.ProductSearchResults.GroupedResult DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ProductSearchResults.GroupedResult(); + } + + public static com.google.cloud.vision.v1.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.v1.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.v1.ProductSearchResults.Result results = 5; + */ + public java.util.List getResultsList() { + return results_; + } + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 5; + */ + public java.util.List + getResultsOrBuilderList() { + return results_; + } + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 5; + */ + public int getResultsCount() { + return results_.size(); + } + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1.ProductSearchResults.Result getResults(int index) { + return results_.get(index); + } + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1.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.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public java.util.List + 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.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public com.google.cloud.vision.v1.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.v1.ProductSearchResults)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ProductSearchResults other = (com.google.cloud.vision.v1.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.v1.ProductSearchResults parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSearchResults parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSearchResults parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSearchResults parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ProductSearchResults parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ProductSearchResults} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ProductSearchResults) + com.google.cloud.vision.v1.ProductSearchResultsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ProductSearchResults.class, com.google.cloud.vision.v1.ProductSearchResults.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchProto.internal_static_google_cloud_vision_v1_ProductSearchResults_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSearchResults getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ProductSearchResults.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSearchResults build() { + com.google.cloud.vision.v1.ProductSearchResults result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSearchResults buildPartial() { + com.google.cloud.vision.v1.ProductSearchResults result = new com.google.cloud.vision.v1.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.v1.ProductSearchResults) { + return mergeFrom((com.google.cloud.vision.v1.ProductSearchResults)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ProductSearchResults other) { + if (other == com.google.cloud.vision.v1.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.v1.ProductSearchResults parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result, com.google.cloud.vision.v1.ProductSearchResults.Result.Builder, com.google.cloud.vision.v1.ProductSearchResults.ResultOrBuilder> resultsBuilder_; + + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.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.v1.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.v1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 5; + */ + public Builder setResults( + int index, com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 5; + */ + public Builder setResults( + int index, com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 5; + */ + public Builder addResults(com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 5; + */ + public Builder addResults( + int index, com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 5; + */ + public Builder addResults( + com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 5; + */ + public Builder addResults( + int index, com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1.ProductSearchResults.Result.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 5; + */ + public java.util.List + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1.ProductSearchResults.Result.Builder addResultsBuilder() { + return getResultsFieldBuilder().addBuilder( + com.google.cloud.vision.v1.ProductSearchResults.Result.getDefaultInstance()); + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 5; + */ + public com.google.cloud.vision.v1.ProductSearchResults.Result.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1.ProductSearchResults.Result.getDefaultInstance()); + } + /** + *
+     * List of results, one for each product match.
+     * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 5; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchResults.Result, com.google.cloud.vision.v1.ProductSearchResults.Result.Builder, com.google.cloud.vision.v1.ProductSearchResults.ResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchResults.Result, com.google.cloud.vision.v1.ProductSearchResults.Result.Builder, com.google.cloud.vision.v1.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(productGroupedResults_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchResults.GroupedResult, com.google.cloud.vision.v1.ProductSearchResults.GroupedResult.Builder, com.google.cloud.vision.v1.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.v1.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.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public Builder setProductGroupedResults( + int index, com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public Builder setProductGroupedResults( + int index, com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public Builder addProductGroupedResults(com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public Builder addProductGroupedResults( + int index, com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public Builder addProductGroupedResults( + com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public Builder addProductGroupedResults( + int index, com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public Builder addAllProductGroupedResults( + java.lang.Iterable 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.v1.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.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public java.util.List + 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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public com.google.cloud.vision.v1.ProductSearchResults.GroupedResult.Builder addProductGroupedResultsBuilder() { + return getProductGroupedResultsFieldBuilder().addBuilder( + com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public com.google.cloud.vision.v1.ProductSearchResults.GroupedResult.Builder addProductGroupedResultsBuilder( + int index) { + return getProductGroupedResultsFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + public java.util.List + getProductGroupedResultsBuilderList() { + return getProductGroupedResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchResults.GroupedResult, com.google.cloud.vision.v1.ProductSearchResults.GroupedResult.Builder, com.google.cloud.vision.v1.ProductSearchResults.GroupedResultOrBuilder> + getProductGroupedResultsFieldBuilder() { + if (productGroupedResultsBuilder_ == null) { + productGroupedResultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.ProductSearchResults.GroupedResult, com.google.cloud.vision.v1.ProductSearchResults.GroupedResult.Builder, com.google.cloud.vision.v1.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.v1.ProductSearchResults) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ProductSearchResults) + private static final com.google.cloud.vision.v1.ProductSearchResults DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ProductSearchResults(); + } + + public static com.google.cloud.vision.v1.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.v1.ProductSearchResults getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchResultsOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchResultsOrBuilder.java new file mode 100644 index 000000000000..3c81d01105ff --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchResultsOrBuilder.java @@ -0,0 +1,140 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search.proto + +package com.google.cloud.vision.v1; + +public interface ProductSearchResultsOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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.v1.ProductSearchResults.Result results = 5; + */ + java.util.List + getResultsList(); + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 5; + */ + com.google.cloud.vision.v1.ProductSearchResults.Result getResults(int index); + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 5; + */ + int getResultsCount(); + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 5; + */ + java.util.List + getResultsOrBuilderList(); + /** + *
+   * List of results, one for each product match.
+   * 
+ * + * repeated .google.cloud.vision.v1.ProductSearchResults.Result results = 5; + */ + com.google.cloud.vision.v1.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.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + com.google.cloud.vision.v1.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.v1.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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + java.util.List + 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.v1.ProductSearchResults.GroupedResult product_grouped_results = 6; + */ + com.google.cloud.vision.v1.ProductSearchResults.GroupedResultOrBuilder getProductGroupedResultsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchServiceProto.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchServiceProto.java new file mode 100644 index 000000000000..19ff0745d635 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSearchServiceProto.java @@ -0,0 +1,555 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +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_v1_Product_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_Product_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_Product_KeyValue_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_Product_KeyValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ProductSet_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ProductSet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ReferenceImage_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ReferenceImage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_CreateProductRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_CreateProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ListProductsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ListProductsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ListProductsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ListProductsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_GetProductRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_GetProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_UpdateProductRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_UpdateProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_DeleteProductRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_DeleteProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_CreateProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_CreateProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ListProductSetsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ListProductSetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ListProductSetsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ListProductSetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_GetProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_GetProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_UpdateProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_UpdateProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_DeleteProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_DeleteProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_CreateReferenceImageRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_CreateReferenceImageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ListReferenceImagesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ListReferenceImagesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ListReferenceImagesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ListReferenceImagesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_GetReferenceImageRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_GetReferenceImageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_DeleteReferenceImageRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_DeleteReferenceImageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_AddProductToProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_AddProductToProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_RemoveProductFromProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_RemoveProductFromProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ListProductsInProductSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ListProductsInProductSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ListProductsInProductSetResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ListProductsInProductSetResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ImportProductSetsGcsSource_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ImportProductSetsGcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ImportProductSetsInputConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ImportProductSetsInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ImportProductSetsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ImportProductSetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_ImportProductSetsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_ImportProductSetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vision_v1_BatchOperationMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vision_v1_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 = { + "\n3google/cloud/vision/v1/product_search_" + + "service.proto\022\026google.cloud.vision.v1\032\034g" + + "oogle/api/annotations.proto\032%google/clou" + + "d/vision/v1/geometry.proto\032#google/longr" + + "unning/operations.proto\032\033google/protobuf" + + "/empty.proto\032 google/protobuf/field_mask" + + ".proto\032\037google/protobuf/timestamp.proto\032" + + "\027google/rpc/status.proto\"\306\001\n\007Product\022\014\n\004" + + "name\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022\023\n\013desc" + + "ription\030\003 \001(\t\022\030\n\020product_category\030\004 \001(\t\022" + + "@\n\016product_labels\030\005 \003(\0132(.google.cloud.v" + + "ision.v1.Product.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\n" + + "index_time\030\003 \001(\0132\032.google.protobuf.Times" + + "tamp\022\'\n\013index_error\030\004 \001(\0132\022.google.rpc.S" + + "tatus\"i\n\016ReferenceImage\022\014\n\004name\030\001 \001(\t\022\013\n" + + "\003uri\030\002 \001(\t\022<\n\016bounding_polys\030\003 \003(\0132$.goo" + + "gle.cloud.vision.v1.BoundingPoly\"l\n\024Crea" + + "teProductRequest\022\016\n\006parent\030\001 \001(\t\0220\n\007prod" + + "uct\030\002 \001(\0132\037.google.cloud.vision.v1.Produ" + + "ct\022\022\n\nproduct_id\030\003 \001(\t\"L\n\023ListProductsRe" + + "quest\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\"b\n\024ListProductsResp" + + "onse\0221\n\010products\030\001 \003(\0132\037.google.cloud.vi" + + "sion.v1.Product\022\027\n\017next_page_token\030\002 \001(\t" + + "\"!\n\021GetProductRequest\022\014\n\004name\030\001 \001(\t\"y\n\024U" + + "pdateProductRequest\0220\n\007product\030\001 \001(\0132\037.g" + + "oogle.cloud.vision.v1.Product\022/\n\013update_" + + "mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"$" + + "\n\024DeleteProductRequest\022\014\n\004name\030\001 \001(\t\"z\n\027" + + "CreateProductSetRequest\022\016\n\006parent\030\001 \001(\t\022" + + "7\n\013product_set\030\002 \001(\0132\".google.cloud.visi" + + "on.v1.ProductSet\022\026\n\016product_set_id\030\003 \001(\t" + + "\"O\n\026ListProductSetsRequest\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\"l\n\027ListProductSetsResponse\0228\n\014product_" + + "sets\030\001 \003(\0132\".google.cloud.vision.v1.Prod" + + "uctSet\022\027\n\017next_page_token\030\002 \001(\t\"$\n\024GetPr" + + "oductSetRequest\022\014\n\004name\030\001 \001(\t\"\203\001\n\027Update" + + "ProductSetRequest\0227\n\013product_set\030\001 \001(\0132\"" + + ".google.cloud.vision.v1.ProductSet\022/\n\013up" + + "date_mask\030\002 \001(\0132\032.google.protobuf.FieldM" + + "ask\"\'\n\027DeleteProductSetRequest\022\014\n\004name\030\001" + + " \001(\t\"\212\001\n\033CreateReferenceImageRequest\022\016\n\006" + + "parent\030\001 \001(\t\022?\n\017reference_image\030\002 \001(\0132&." + + "google.cloud.vision.v1.ReferenceImage\022\032\n" + + "\022reference_image_id\030\003 \001(\t\"S\n\032ListReferen" + + "ceImagesRequest\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\"\213\001\n\033ListR" + + "eferenceImagesResponse\022@\n\020reference_imag" + + "es\030\001 \003(\0132&.google.cloud.vision.v1.Refere" + + "nceImage\022\021\n\tpage_size\030\002 \001(\005\022\027\n\017next_page" + + "_token\030\003 \001(\t\"(\n\030GetReferenceImageRequest" + + "\022\014\n\004name\030\001 \001(\t\"+\n\033DeleteReferenceImageRe" + + "quest\022\014\n\004name\030\001 \001(\t\">\n\035AddProductToProdu" + + "ctSetRequest\022\014\n\004name\030\001 \001(\t\022\017\n\007product\030\002 " + + "\001(\t\"C\n\"RemoveProductFromProductSetReques" + + "t\022\014\n\004name\030\001 \001(\t\022\017\n\007product\030\002 \001(\t\"V\n\037List" + + "ProductsInProductSetRequest\022\014\n\004name\030\001 \001(" + + "\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t" + + "\"n\n ListProductsInProductSetResponse\0221\n\010" + + "products\030\001 \003(\0132\037.google.cloud.vision.v1." + + "Product\022\027\n\017next_page_token\030\002 \001(\t\"2\n\032Impo" + + "rtProductSetsGcsSource\022\024\n\014csv_file_uri\030\001" + + " \001(\t\"r\n\034ImportProductSetsInputConfig\022H\n\n" + + "gcs_source\030\001 \001(\01322.google.cloud.vision.v" + + "1.ImportProductSetsGcsSourceH\000B\010\n\006source" + + "\"v\n\030ImportProductSetsRequest\022\016\n\006parent\030\001" + + " \001(\t\022J\n\014input_config\030\002 \001(\01324.google.clou" + + "d.vision.v1.ImportProductSetsInputConfig" + + "\"\203\001\n\031ImportProductSetsResponse\022@\n\020refere" + + "nce_images\030\001 \003(\0132&.google.cloud.vision.v" + + "1.ReferenceImage\022$\n\010statuses\030\002 \003(\0132\022.goo" + + "gle.rpc.Status\"\227\002\n\026BatchOperationMetadat" + + "a\022C\n\005state\030\001 \001(\01624.google.cloud.vision.v" + + "1.BatchOperationMetadata.State\022/\n\013submit" + + "_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022" + + ",\n\010end_time\030\003 \001(\0132\032.google.protobuf.Time" + + "stamp\"Y\n\005State\022\025\n\021STATE_UNSPECIFIED\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\317\030\n\rProductSearch\022\255\001\n\020C" + + "reateProductSet\022/.google.cloud.vision.v1" + + ".CreateProductSetRequest\032\".google.cloud." + + "vision.v1.ProductSet\"D\202\323\344\223\002>\"//v1/{paren" + + "t=projects/*/locations/*}/productSets:\013p" + + "roduct_set\022\253\001\n\017ListProductSets\022..google." + + "cloud.vision.v1.ListProductSetsRequest\032/" + + ".google.cloud.vision.v1.ListProductSetsR" + + "esponse\"7\202\323\344\223\0021\022//v1/{parent=projects/*/" + + "locations/*}/productSets\022\232\001\n\rGetProductS" + + "et\022,.google.cloud.vision.v1.GetProductSe" + + "tRequest\032\".google.cloud.vision.v1.Produc" + + "tSet\"7\202\323\344\223\0021\022//v1/{name=projects/*/locat" + + "ions/*/productSets/*}\022\271\001\n\020UpdateProductS" + + "et\022/.google.cloud.vision.v1.UpdateProduc" + + "tSetRequest\032\".google.cloud.vision.v1.Pro" + + "ductSet\"P\202\323\344\223\002J2;/v1/{product_set.name=p" + + "rojects/*/locations/*/productSets/*}:\013pr" + + "oduct_set\022\224\001\n\020DeleteProductSet\022/.google." + + "cloud.vision.v1.DeleteProductSetRequest\032" + + "\026.google.protobuf.Empty\"7\202\323\344\223\0021*//v1/{na" + + "me=projects/*/locations/*/productSets/*}" + + "\022\235\001\n\rCreateProduct\022,.google.cloud.vision" + + ".v1.CreateProductRequest\032\037.google.cloud." + + "vision.v1.Product\"=\202\323\344\223\0027\",/v1/{parent=p" + + "rojects/*/locations/*}/products:\007product" + + "\022\237\001\n\014ListProducts\022+.google.cloud.vision." + + "v1.ListProductsRequest\032,.google.cloud.vi" + + "sion.v1.ListProductsResponse\"4\202\323\344\223\002.\022,/v" + + "1/{parent=projects/*/locations/*}/produc" + + "ts\022\216\001\n\nGetProduct\022).google.cloud.vision." + + "v1.GetProductRequest\032\037.google.cloud.visi" + + "on.v1.Product\"4\202\323\344\223\002.\022,/v1/{name=project" + + "s/*/locations/*/products/*}\022\245\001\n\rUpdatePr" + + "oduct\022,.google.cloud.vision.v1.UpdatePro" + + "ductRequest\032\037.google.cloud.vision.v1.Pro" + + "duct\"E\202\323\344\223\002?24/v1/{product.name=projects" + + "/*/locations/*/products/*}:\007product\022\213\001\n\r" + + "DeleteProduct\022,.google.cloud.vision.v1.D" + + "eleteProductRequest\032\026.google.protobuf.Em" + + "pty\"4\202\323\344\223\002.*,/v1/{name=projects/*/locati" + + "ons/*/products/*}\022\314\001\n\024CreateReferenceIma" + + "ge\0223.google.cloud.vision.v1.CreateRefere" + + "nceImageRequest\032&.google.cloud.vision.v1" + + ".ReferenceImage\"W\202\323\344\223\002Q\">/v1/{parent=pro" + + "jects/*/locations/*/products/*}/referenc" + + "eImages:\017reference_image\022\253\001\n\024DeleteRefer" + + "enceImage\0223.google.cloud.vision.v1.Delet" + + "eReferenceImageRequest\032\026.google.protobuf" + + ".Empty\"F\202\323\344\223\002@*>/v1/{name=projects/*/loc" + + "ations/*/products/*/referenceImages/*}\022\306" + + "\001\n\023ListReferenceImages\0222.google.cloud.vi" + + "sion.v1.ListReferenceImagesRequest\0323.goo" + + "gle.cloud.vision.v1.ListReferenceImagesR" + + "esponse\"F\202\323\344\223\002@\022>/v1/{parent=projects/*/" + + "locations/*/products/*}/referenceImages\022" + + "\265\001\n\021GetReferenceImage\0220.google.cloud.vis" + + "ion.v1.GetReferenceImageRequest\032&.google" + + ".cloud.vision.v1.ReferenceImage\"F\202\323\344\223\002@\022" + + ">/v1/{name=projects/*/locations/*/produc" + + "ts/*/referenceImages/*}\022\256\001\n\026AddProductTo" + + "ProductSet\0225.google.cloud.vision.v1.AddP" + + "roductToProductSetRequest\032\026.google.proto" + + "buf.Empty\"E\202\323\344\223\002?\":/v1/{name=projects/*/" + + "locations/*/productSets/*}:addProduct:\001*" + + "\022\273\001\n\033RemoveProductFromProductSet\022:.googl" + + "e.cloud.vision.v1.RemoveProductFromProdu" + + "ctSetRequest\032\026.google.protobuf.Empty\"H\202\323" + + "\344\223\002B\"=/v1/{name=projects/*/locations/*/p" + + "roductSets/*}:removeProduct:\001*\022\317\001\n\030ListP" + + "roductsInProductSet\0227.google.cloud.visio" + + "n.v1.ListProductsInProductSetRequest\0328.g" + + "oogle.cloud.vision.v1.ListProductsInProd" + + "uctSetResponse\"@\202\323\344\223\002:\0228/v1/{name=projec" + + "ts/*/locations/*/productSets/*}/products" + + "\022\247\001\n\021ImportProductSets\0220.google.cloud.vi" + + "sion.v1.ImportProductSetsRequest\032\035.googl" + + "e.longrunning.Operation\"A\202\323\344\223\002;\"6/v1/{pa" + + "rent=projects/*/locations/*}/productSets" + + ":import:\001*B\201\001\n\032com.google.cloud.vision.v" + + "1B\031ProductSearchServiceProtoP\001Z + * 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.v1.ProductSet} + */ +public final class ProductSet extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ProductSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ProductSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ProductSet.class, com.google.cloud.vision.v1.ProductSet.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The resource name of the ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + *
+   * The user-provided name for this ProductSet. Must not be empty. Must be at
+   * most 4096 characters long.
+   * 
+ * + * string display_name = 2; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + *
+   * The user-provided name for this ProductSet. Must not be empty. Must be at
+   * most 4096 characters long.
+   * 
+ * + * string display_name = 2; + */ + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp indexTime_; + /** + *
+   * Output only. The time at which this ProductSet was last indexed. Query
+   * results will reflect all updates before this time. If this ProductSet has
+   * never been indexed, this field is 0.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public boolean hasIndexTime() { + return indexTime_ != null; + } + /** + *
+   * Output only. The time at which this ProductSet was last indexed. Query
+   * results will reflect all updates before this time. If this ProductSet has
+   * never been indexed, this field is 0.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public com.google.protobuf.Timestamp getIndexTime() { + return indexTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : indexTime_; + } + /** + *
+   * Output only. The time at which this ProductSet was last indexed. Query
+   * results will reflect all updates before this time. If this ProductSet has
+   * never been indexed, this field is 0.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getIndexTimeOrBuilder() { + return getIndexTime(); + } + + public static final int INDEX_ERROR_FIELD_NUMBER = 4; + private com.google.rpc.Status indexError_; + /** + *
+   * Output only. If there was an error with indexing the product set, the field
+   * is populated.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.rpc.Status index_error = 4; + */ + public boolean hasIndexError() { + return indexError_ != null; + } + /** + *
+   * Output only. If there was an error with indexing the product set, the field
+   * is populated.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.rpc.Status index_error = 4; + */ + public com.google.rpc.Status getIndexError() { + return indexError_ == null ? com.google.rpc.Status.getDefaultInstance() : indexError_; + } + /** + *
+   * Output only. If there was an error with indexing the product set, the field
+   * is populated.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.rpc.Status index_error = 4; + */ + public com.google.rpc.StatusOrBuilder getIndexErrorOrBuilder() { + return getIndexError(); + } + + private byte memoizedIsInitialized = -1; + @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.v1.ProductSet)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ProductSet other = (com.google.cloud.vision.v1.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.v1.ProductSet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ProductSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ProductSet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ProductSet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ProductSet) + com.google.cloud.vision.v1.ProductSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ProductSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ProductSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ProductSet.class, com.google.cloud.vision.v1.ProductSet.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ProductSet_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSet getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ProductSet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSet build() { + com.google.cloud.vision.v1.ProductSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ProductSet buildPartial() { + com.google.cloud.vision.v1.ProductSet result = new com.google.cloud.vision.v1.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.v1.ProductSet) { + return mergeFrom((com.google.cloud.vision.v1.ProductSet)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ProductSet other) { + if (other == com.google.cloud.vision.v1.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.v1.ProductSet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.ProductSet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name of the ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name of the ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name of the ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the ProductSet.
+     * Format is:
+     * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + *
+     * The user-provided name for this ProductSet. Must not be empty. Must be at
+     * most 4096 characters long.
+     * 
+ * + * string display_name = 2; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The user-provided name for this ProductSet. Must not be empty. Must be at
+     * most 4096 characters long.
+     * 
+ * + * string display_name = 2; + */ + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The user-provided name for this ProductSet. Must not be empty. Must be at
+     * most 4096 characters long.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + *
+     * The user-provided name for this ProductSet. Must not be empty. Must be at
+     * most 4096 characters long.
+     * 
+ * + * string display_name = 2; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + *
+     * The user-provided name for this ProductSet. Must not be empty. Must be at
+     * most 4096 characters long.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp indexTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> indexTimeBuilder_; + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public boolean hasIndexTime() { + return indexTimeBuilder_ != null || indexTime_ != null; + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public com.google.protobuf.Timestamp getIndexTime() { + if (indexTimeBuilder_ == null) { + return indexTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : indexTime_; + } else { + return indexTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public Builder setIndexTime(com.google.protobuf.Timestamp value) { + if (indexTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + indexTime_ = value; + onChanged(); + } else { + indexTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public Builder setIndexTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (indexTimeBuilder_ == null) { + indexTime_ = builderForValue.build(); + onChanged(); + } else { + indexTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public Builder mergeIndexTime(com.google.protobuf.Timestamp value) { + if (indexTimeBuilder_ == null) { + if (indexTime_ != null) { + indexTime_ = + com.google.protobuf.Timestamp.newBuilder(indexTime_).mergeFrom(value).buildPartial(); + } else { + indexTime_ = value; + } + onChanged(); + } else { + indexTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public Builder clearIndexTime() { + if (indexTimeBuilder_ == null) { + indexTime_ = null; + onChanged(); + } else { + indexTime_ = null; + indexTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getIndexTimeBuilder() { + + onChanged(); + return getIndexTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getIndexTimeOrBuilder() { + if (indexTimeBuilder_ != null) { + return indexTimeBuilder_.getMessageOrBuilder(); + } else { + return indexTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : indexTime_; + } + } + /** + *
+     * Output only. The time at which this ProductSet was last indexed. Query
+     * results will reflect all updates before this time. If this ProductSet has
+     * never been indexed, this field is 0.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getIndexTimeFieldBuilder() { + if (indexTimeBuilder_ == null) { + indexTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getIndexTime(), + getParentForChildren(), + isClean()); + indexTime_ = null; + } + return indexTimeBuilder_; + } + + private com.google.rpc.Status indexError_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> indexErrorBuilder_; + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public boolean hasIndexError() { + return indexErrorBuilder_ != null || indexError_ != null; + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public com.google.rpc.Status getIndexError() { + if (indexErrorBuilder_ == null) { + return indexError_ == null ? com.google.rpc.Status.getDefaultInstance() : indexError_; + } else { + return indexErrorBuilder_.getMessage(); + } + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public Builder setIndexError(com.google.rpc.Status value) { + if (indexErrorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + indexError_ = value; + onChanged(); + } else { + indexErrorBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public Builder setIndexError( + com.google.rpc.Status.Builder builderForValue) { + if (indexErrorBuilder_ == null) { + indexError_ = builderForValue.build(); + onChanged(); + } else { + indexErrorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public Builder mergeIndexError(com.google.rpc.Status value) { + if (indexErrorBuilder_ == null) { + if (indexError_ != null) { + indexError_ = + com.google.rpc.Status.newBuilder(indexError_).mergeFrom(value).buildPartial(); + } else { + indexError_ = value; + } + onChanged(); + } else { + indexErrorBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public Builder clearIndexError() { + if (indexErrorBuilder_ == null) { + indexError_ = null; + onChanged(); + } else { + indexError_ = null; + indexErrorBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public com.google.rpc.Status.Builder getIndexErrorBuilder() { + + onChanged(); + return getIndexErrorFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + public com.google.rpc.StatusOrBuilder getIndexErrorOrBuilder() { + if (indexErrorBuilder_ != null) { + return indexErrorBuilder_.getMessageOrBuilder(); + } else { + return indexError_ == null ? + com.google.rpc.Status.getDefaultInstance() : indexError_; + } + } + /** + *
+     * Output only. If there was an error with indexing the product set, the field
+     * is populated.
+     * This field is ignored when creating a ProductSet.
+     * 
+ * + * .google.rpc.Status index_error = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getIndexErrorFieldBuilder() { + if (indexErrorBuilder_ == null) { + indexErrorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getIndexError(), + getParentForChildren(), + isClean()); + indexError_ = null; + } + return indexErrorBuilder_; + } + @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.v1.ProductSet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ProductSet) + private static final com.google.cloud.vision.v1.ProductSet DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ProductSet(); + } + + public static com.google.cloud.vision.v1.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.v1.ProductSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSetName.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSetName.java new file mode 100644 index 000000000000..f2073776bab4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSetName.java @@ -0,0 +1,212 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.cloud.vision.v1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ProductSetName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/productSets/{product_set}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String productSet; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProductSet() { + return productSet; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProductSetName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + productSet = Preconditions.checkNotNull(builder.getProductSet()); + } + + public static ProductSetName of(String project, String location, String productSet) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProductSet(productSet) + .build(); + } + + public static String format(String project, String location, String productSet) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProductSet(productSet) + .build() + .toString(); + } + + public static ProductSetName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProductSetName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("product_set")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ProductSetName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("productSet", productSet); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location, "product_set", productSet); + } + + /** Builder for ProductSetName. */ + public static class Builder { + + private String project; + private String location; + private String productSet; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProductSet() { + return productSet; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setProductSet(String productSet) { + this.productSet = productSet; + return this; + } + + private Builder() { + } + + private Builder(ProductSetName productSetName) { + project = productSetName.project; + location = productSetName.location; + productSet = productSetName.productSet; + } + + public ProductSetName build() { + return new ProductSetName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProductSetName) { + ProductSetName that = (ProductSetName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.productSet.equals(that.productSet)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= productSet.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSetOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSetOrBuilder.java new file mode 100644 index 000000000000..d9fd8e8c985f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ProductSetOrBuilder.java @@ -0,0 +1,118 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ProductSetOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.ProductSet) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The resource name of the ProductSet.
+   * Format is:
+   * `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The user-provided name for this ProductSet. Must not be empty. Must be at
+   * most 4096 characters long.
+   * 
+ * + * string display_name = 2; + */ + java.lang.String getDisplayName(); + /** + *
+   * The user-provided name for this ProductSet. Must not be empty. Must be at
+   * most 4096 characters long.
+   * 
+ * + * string display_name = 2; + */ + com.google.protobuf.ByteString + getDisplayNameBytes(); + + /** + *
+   * Output only. The time at which this ProductSet was last indexed. Query
+   * results will reflect all updates before this time. If this ProductSet has
+   * never been indexed, this field is 0.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + boolean hasIndexTime(); + /** + *
+   * Output only. The time at which this ProductSet was last indexed. Query
+   * results will reflect all updates before this time. If this ProductSet has
+   * never been indexed, this field is 0.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + com.google.protobuf.Timestamp getIndexTime(); + /** + *
+   * Output only. The time at which this ProductSet was last indexed. Query
+   * results will reflect all updates before this time. If this ProductSet has
+   * never been indexed, this field is 0.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.protobuf.Timestamp index_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getIndexTimeOrBuilder(); + + /** + *
+   * Output only. If there was an error with indexing the product set, the field
+   * is populated.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.rpc.Status index_error = 4; + */ + boolean hasIndexError(); + /** + *
+   * Output only. If there was an error with indexing the product set, the field
+   * is populated.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.rpc.Status index_error = 4; + */ + com.google.rpc.Status getIndexError(); + /** + *
+   * Output only. If there was an error with indexing the product set, the field
+   * is populated.
+   * This field is ignored when creating a ProductSet.
+   * 
+ * + * .google.rpc.Status index_error = 4; + */ + com.google.rpc.StatusOrBuilder getIndexErrorOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ReferenceImage.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ReferenceImage.java new file mode 100644 index 000000000000..a78ebbc9f4f1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ReferenceImage.java @@ -0,0 +1,1347 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * A `ReferenceImage` represents a product image and its associated metadata,
+ * such as bounding boxes.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.ReferenceImage} + */ +public final class ReferenceImage extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ReferenceImage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ReferenceImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ReferenceImage.class, com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1.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.v1.ReferenceImage)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.ReferenceImage other = (com.google.cloud.vision.v1.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.v1.ReferenceImage parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ReferenceImage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ReferenceImage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.ReferenceImage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.ReferenceImage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ReferenceImage} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.ReferenceImage) + com.google.cloud.vision.v1.ReferenceImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ReferenceImage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ReferenceImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.ReferenceImage.class, com.google.cloud.vision.v1.ReferenceImage.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_ReferenceImage_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ReferenceImage getDefaultInstanceForType() { + return com.google.cloud.vision.v1.ReferenceImage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.ReferenceImage build() { + com.google.cloud.vision.v1.ReferenceImage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.ReferenceImage buildPartial() { + com.google.cloud.vision.v1.ReferenceImage result = new com.google.cloud.vision.v1.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.v1.ReferenceImage) { + return mergeFrom((com.google.cloud.vision.v1.ReferenceImage)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.ReferenceImage other) { + if (other == com.google.cloud.vision.v1.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.v1.ReferenceImage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.BoundingPoly, com.google.cloud.vision.v1.BoundingPoly.Builder, com.google.cloud.vision.v1.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.v1.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.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public Builder setBoundingPolys( + int index, com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public Builder setBoundingPolys( + int index, com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public Builder addBoundingPolys(com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public Builder addBoundingPolys( + int index, com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public Builder addBoundingPolys( + com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public Builder addBoundingPolys( + int index, com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1.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.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1.BoundingPoly.Builder addBoundingPolysBuilder() { + return getBoundingPolysFieldBuilder().addBuilder( + com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public com.google.cloud.vision.v1.BoundingPoly.Builder addBoundingPolysBuilder( + int index) { + return getBoundingPolysFieldBuilder().addBuilder( + index, com.google.cloud.vision.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + public java.util.List + getBoundingPolysBuilderList() { + return getBoundingPolysFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.BoundingPoly, com.google.cloud.vision.v1.BoundingPoly.Builder, com.google.cloud.vision.v1.BoundingPolyOrBuilder> + getBoundingPolysFieldBuilder() { + if (boundingPolysBuilder_ == null) { + boundingPolysBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vision.v1.BoundingPoly, com.google.cloud.vision.v1.BoundingPoly.Builder, com.google.cloud.vision.v1.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.v1.ReferenceImage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ReferenceImage) + private static final com.google.cloud.vision.v1.ReferenceImage DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.ReferenceImage(); + } + + public static com.google.cloud.vision.v1.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.v1.ReferenceImage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ReferenceImageOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ReferenceImageOrBuilder.java new file mode 100644 index 000000000000..de2358423ba4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ReferenceImageOrBuilder.java @@ -0,0 +1,129 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface ReferenceImageOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + com.google.cloud.vision.v1.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.v1.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.v1.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.v1.BoundingPoly bounding_polys = 3; + */ + com.google.cloud.vision.v1.BoundingPolyOrBuilder getBoundingPolysOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/RemoveProductFromProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/RemoveProductFromProductSetRequest.java new file mode 100644 index 000000000000..2b7d87517b26 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/RemoveProductFromProductSetRequest.java @@ -0,0 +1,760 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `RemoveProductFromProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.RemoveProductFromProductSetRequest} + */ +public final class RemoveProductFromProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_RemoveProductFromProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_RemoveProductFromProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.RemoveProductFromProductSetRequest.class, com.google.cloud.vision.v1.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.v1.RemoveProductFromProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.RemoveProductFromProductSetRequest other = (com.google.cloud.vision.v1.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.v1.RemoveProductFromProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.RemoveProductFromProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.RemoveProductFromProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.RemoveProductFromProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.RemoveProductFromProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.RemoveProductFromProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.RemoveProductFromProductSetRequest) + com.google.cloud.vision.v1.RemoveProductFromProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_RemoveProductFromProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_RemoveProductFromProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.RemoveProductFromProductSetRequest.class, com.google.cloud.vision.v1.RemoveProductFromProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_RemoveProductFromProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.RemoveProductFromProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.RemoveProductFromProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.RemoveProductFromProductSetRequest build() { + com.google.cloud.vision.v1.RemoveProductFromProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.RemoveProductFromProductSetRequest buildPartial() { + com.google.cloud.vision.v1.RemoveProductFromProductSetRequest result = new com.google.cloud.vision.v1.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.v1.RemoveProductFromProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1.RemoveProductFromProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.RemoveProductFromProductSetRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.RemoveProductFromProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.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.v1.RemoveProductFromProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.RemoveProductFromProductSetRequest) + private static final com.google.cloud.vision.v1.RemoveProductFromProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.RemoveProductFromProductSetRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.RemoveProductFromProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/RemoveProductFromProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/RemoveProductFromProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..335f19c3e17b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/RemoveProductFromProductSetRequestOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface RemoveProductFromProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductRequest.java new file mode 100644 index 000000000000..eef1ad1a03b7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductRequest.java @@ -0,0 +1,940 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `UpdateProduct` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.UpdateProductRequest} + */ +public final class UpdateProductRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = input.readMessage(com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_UpdateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_UpdateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.UpdateProductRequest.class, com.google.cloud.vision.v1.UpdateProductRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1.Product product_; + /** + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1.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.v1.Product product = 1; + */ + public com.google.cloud.vision.v1.Product getProduct() { + return product_ == null ? com.google.cloud.vision.v1.Product.getDefaultInstance() : product_; + } + /** + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public com.google.cloud.vision.v1.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.v1.UpdateProductRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.UpdateProductRequest other = (com.google.cloud.vision.v1.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.v1.UpdateProductRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.UpdateProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.UpdateProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.UpdateProductRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.UpdateProductRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.UpdateProductRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.UpdateProductRequest) + com.google.cloud.vision.v1.UpdateProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_UpdateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_UpdateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.UpdateProductRequest.class, com.google.cloud.vision.v1.UpdateProductRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_UpdateProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.UpdateProductRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.UpdateProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.UpdateProductRequest build() { + com.google.cloud.vision.v1.UpdateProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.UpdateProductRequest buildPartial() { + com.google.cloud.vision.v1.UpdateProductRequest result = new com.google.cloud.vision.v1.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.v1.UpdateProductRequest) { + return mergeFrom((com.google.cloud.vision.v1.UpdateProductRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.UpdateProductRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.UpdateProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.UpdateProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1.Product product_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.ProductOrBuilder> productBuilder_; + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1.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.v1.Product product = 1; + */ + public com.google.cloud.vision.v1.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null ? com.google.cloud.vision.v1.Product.getDefaultInstance() : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public Builder setProduct(com.google.cloud.vision.v1.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.v1.Product product = 1; + */ + public Builder setProduct( + com.google.cloud.vision.v1.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.v1.Product product = 1; + */ + public Builder mergeProduct(com.google.cloud.vision.v1.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.vision.v1.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.v1.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.v1.Product product = 1; + */ + public com.google.cloud.vision.v1.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + public com.google.cloud.vision.v1.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null ? + com.google.cloud.vision.v1.Product.getDefaultInstance() : product_; + } + } + /** + *
+     * The Product resource which replaces the one on the server.
+     * product.name is immutable.
+     * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.Product, com.google.cloud.vision.v1.Product.Builder, com.google.cloud.vision.v1.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.v1.UpdateProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.UpdateProductRequest) + private static final com.google.cloud.vision.v1.UpdateProductRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.UpdateProductRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.UpdateProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductRequestOrBuilder.java new file mode 100644 index 000000000000..f3cc3714cf3f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductRequestOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface UpdateProductRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.UpdateProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + boolean hasProduct(); + /** + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + com.google.cloud.vision.v1.Product getProduct(); + /** + *
+   * The Product resource which replaces the one on the server.
+   * product.name is immutable.
+   * 
+ * + * .google.cloud.vision.v1.Product product = 1; + */ + com.google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductSetRequest.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductSetRequest.java new file mode 100644 index 000000000000..bf92ed459f8c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductSetRequest.java @@ -0,0 +1,916 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +/** + *
+ * Request message for the `UpdateProductSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.vision.v1.UpdateProductSetRequest} + */ +public final class UpdateProductSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.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.v1.ProductSet.Builder subBuilder = null; + if (productSet_ != null) { + subBuilder = productSet_.toBuilder(); + } + productSet_ = input.readMessage(com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_UpdateProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_UpdateProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.UpdateProductSetRequest.class, com.google.cloud.vision.v1.UpdateProductSetRequest.Builder.class); + } + + public static final int PRODUCT_SET_FIELD_NUMBER = 1; + private com.google.cloud.vision.v1.ProductSet productSet_; + /** + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 1; + */ + public boolean hasProductSet() { + return productSet_ != null; + } + /** + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1.ProductSet getProductSet() { + return productSet_ == null ? com.google.cloud.vision.v1.ProductSet.getDefaultInstance() : productSet_; + } + /** + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1.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.v1.UpdateProductSetRequest)) { + return super.equals(obj); + } + com.google.cloud.vision.v1.UpdateProductSetRequest other = (com.google.cloud.vision.v1.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.v1.UpdateProductSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.UpdateProductSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.UpdateProductSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.vision.v1.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.v1.UpdateProductSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.UpdateProductSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.UpdateProductSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.UpdateProductSetRequest) + com.google.cloud.vision.v1.UpdateProductSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_UpdateProductSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vision.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_UpdateProductSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vision.v1.UpdateProductSetRequest.class, com.google.cloud.vision.v1.UpdateProductSetRequest.Builder.class); + } + + // Construct using com.google.cloud.vision.v1.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.v1.ProductSearchServiceProto.internal_static_google_cloud_vision_v1_UpdateProductSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vision.v1.UpdateProductSetRequest getDefaultInstanceForType() { + return com.google.cloud.vision.v1.UpdateProductSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vision.v1.UpdateProductSetRequest build() { + com.google.cloud.vision.v1.UpdateProductSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vision.v1.UpdateProductSetRequest buildPartial() { + com.google.cloud.vision.v1.UpdateProductSetRequest result = new com.google.cloud.vision.v1.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.v1.UpdateProductSetRequest) { + return mergeFrom((com.google.cloud.vision.v1.UpdateProductSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vision.v1.UpdateProductSetRequest other) { + if (other == com.google.cloud.vision.v1.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.v1.UpdateProductSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.vision.v1.UpdateProductSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.vision.v1.ProductSet productSet_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ProductSet, com.google.cloud.vision.v1.ProductSet.Builder, com.google.cloud.vision.v1.ProductSetOrBuilder> productSetBuilder_; + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1.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.v1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1.ProductSet getProductSet() { + if (productSetBuilder_ == null) { + return productSet_ == null ? com.google.cloud.vision.v1.ProductSet.getDefaultInstance() : productSet_; + } else { + return productSetBuilder_.getMessage(); + } + } + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 1; + */ + public Builder setProductSet(com.google.cloud.vision.v1.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.v1.ProductSet product_set = 1; + */ + public Builder setProductSet( + com.google.cloud.vision.v1.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.v1.ProductSet product_set = 1; + */ + public Builder mergeProductSet(com.google.cloud.vision.v1.ProductSet value) { + if (productSetBuilder_ == null) { + if (productSet_ != null) { + productSet_ = + com.google.cloud.vision.v1.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.v1.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.v1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1.ProductSet.Builder getProductSetBuilder() { + + onChanged(); + return getProductSetFieldBuilder().getBuilder(); + } + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 1; + */ + public com.google.cloud.vision.v1.ProductSetOrBuilder getProductSetOrBuilder() { + if (productSetBuilder_ != null) { + return productSetBuilder_.getMessageOrBuilder(); + } else { + return productSet_ == null ? + com.google.cloud.vision.v1.ProductSet.getDefaultInstance() : productSet_; + } + } + /** + *
+     * The ProductSet resource which replaces the one on the server.
+     * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ProductSet, com.google.cloud.vision.v1.ProductSet.Builder, com.google.cloud.vision.v1.ProductSetOrBuilder> + getProductSetFieldBuilder() { + if (productSetBuilder_ == null) { + productSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vision.v1.ProductSet, com.google.cloud.vision.v1.ProductSet.Builder, com.google.cloud.vision.v1.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.v1.UpdateProductSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.UpdateProductSetRequest) + private static final com.google.cloud.vision.v1.UpdateProductSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.vision.v1.UpdateProductSetRequest(); + } + + public static com.google.cloud.vision.v1.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.v1.UpdateProductSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductSetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductSetRequestOrBuilder.java new file mode 100644 index 000000000000..4cc37c6ed397 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/UpdateProductSetRequestOrBuilder.java @@ -0,0 +1,68 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vision/v1/product_search_service.proto + +package com.google.cloud.vision.v1; + +public interface UpdateProductSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.UpdateProductSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 1; + */ + boolean hasProductSet(); + /** + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 1; + */ + com.google.cloud.vision.v1.ProductSet getProductSet(); + /** + *
+   * The ProductSet resource which replaces the one on the server.
+   * 
+ * + * .google.cloud.vision.v1.ProductSet product_set = 1; + */ + com.google.cloud.vision.v1.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-v1/src/main/java/com/google/cloud/vision/v1/WebDetection.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/WebDetection.java index 81fa78395241..94c20bd84aa8 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/WebDetection.java +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/WebDetection.java @@ -4701,7 +4701,8 @@ public com.google.cloud.vision.v1.WebDetection.WebImageOrBuilder getVisuallySimi private java.util.List bestGuessLabels_; /** *
-   * Best guess text labels for the request image.
+   * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -4711,7 +4712,8 @@ public java.util.List getBestG } /** *
-   * Best guess text labels for the request image.
+   * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -4722,7 +4724,8 @@ public java.util.List getBestG } /** *
-   * Best guess text labels for the request image.
+   * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -4732,7 +4735,8 @@ public int getBestGuessLabelsCount() { } /** *
-   * Best guess text labels for the request image.
+   * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -4742,7 +4746,8 @@ public com.google.cloud.vision.v1.WebDetection.WebLabel getBestGuessLabels(int i } /** *
-   * Best guess text labels for the request image.
+   * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7002,7 +7007,8 @@ private void ensureBestGuessLabelsIsMutable() { /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7016,7 +7022,8 @@ public java.util.List getBestG } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7030,7 +7037,8 @@ public int getBestGuessLabelsCount() { } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7044,7 +7052,8 @@ public com.google.cloud.vision.v1.WebDetection.WebLabel getBestGuessLabels(int i } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7065,7 +7074,8 @@ public Builder setBestGuessLabels( } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7083,7 +7093,8 @@ public Builder setBestGuessLabels( } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7103,7 +7114,8 @@ public Builder addBestGuessLabels(com.google.cloud.vision.v1.WebDetection.WebLab } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7124,7 +7136,8 @@ public Builder addBestGuessLabels( } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7142,7 +7155,8 @@ public Builder addBestGuessLabels( } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7160,7 +7174,8 @@ public Builder addBestGuessLabels( } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7179,7 +7194,8 @@ public Builder addAllBestGuessLabels( } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7196,7 +7212,8 @@ public Builder clearBestGuessLabels() { } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7213,7 +7230,8 @@ public Builder removeBestGuessLabels(int index) { } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7224,7 +7242,8 @@ public com.google.cloud.vision.v1.WebDetection.WebLabel.Builder getBestGuessLabe } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7238,7 +7257,8 @@ public com.google.cloud.vision.v1.WebDetection.WebLabelOrBuilder getBestGuessLab } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7253,7 +7273,8 @@ public com.google.cloud.vision.v1.WebDetection.WebLabelOrBuilder getBestGuessLab } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7264,7 +7285,8 @@ public com.google.cloud.vision.v1.WebDetection.WebLabel.Builder addBestGuessLabe } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -7276,7 +7298,8 @@ public com.google.cloud.vision.v1.WebDetection.WebLabel.Builder addBestGuessLabe } /** *
-     * Best guess text labels for the request image.
+     * 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.v1.WebDetection.WebLabel best_guess_labels = 8; diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/WebDetectionOrBuilder.java b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/WebDetectionOrBuilder.java index 777ed846fc26..62d8fc8fc4d5 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/WebDetectionOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/WebDetectionOrBuilder.java @@ -244,7 +244,8 @@ com.google.cloud.vision.v1.WebDetection.WebImageOrBuilder getVisuallySimilarImag /** *
-   * Best guess text labels for the request image.
+   * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -253,7 +254,8 @@ com.google.cloud.vision.v1.WebDetection.WebImageOrBuilder getVisuallySimilarImag getBestGuessLabelsList(); /** *
-   * Best guess text labels for the request image.
+   * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -261,7 +263,8 @@ com.google.cloud.vision.v1.WebDetection.WebImageOrBuilder getVisuallySimilarImag com.google.cloud.vision.v1.WebDetection.WebLabel getBestGuessLabels(int index); /** *
-   * Best guess text labels for the request image.
+   * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -269,7 +272,8 @@ com.google.cloud.vision.v1.WebDetection.WebImageOrBuilder getVisuallySimilarImag int getBestGuessLabelsCount(); /** *
-   * Best guess text labels for the request image.
+   * 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.v1.WebDetection.WebLabel best_guess_labels = 8; @@ -278,7 +282,8 @@ com.google.cloud.vision.v1.WebDetection.WebImageOrBuilder getVisuallySimilarImag getBestGuessLabelsOrBuilderList(); /** *
-   * Best guess text labels for the request image.
+   * 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.v1.WebDetection.WebLabel best_guess_labels = 8; diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/geometry.proto b/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/geometry.proto index 57e3e246873f..4b9ad8bb4906 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/geometry.proto +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/geometry.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google Inc. +// 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. @@ -11,11 +11,14 @@ // WITHOUT 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.v1; +import "google/api/annotations.proto"; + option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1;vision"; option java_multiple_files = true; @@ -43,7 +46,7 @@ message NormalizedVertex { // Y coordinate. float y = 2; -}; +} // A bounding polygon for the detected image annotation. message BoundingPoly { diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/image_annotator.proto b/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/image_annotator.proto index f8d820849799..a7235f7a1adb 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/image_annotator.proto +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/image_annotator.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google Inc. +// 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. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -18,6 +19,7 @@ package google.cloud.vision.v1; import "google/api/annotations.proto"; import "google/cloud/vision/v1/geometry.proto"; +import "google/cloud/vision/v1/product_search.proto"; import "google/cloud/vision/v1/text_annotation.proto"; import "google/cloud/vision/v1/web_detection.proto"; import "google/longrunning/operations.proto"; @@ -33,6 +35,7 @@ option java_outer_classname = "ImageAnnotatorProto"; option java_package = "com.google.cloud.vision.v1"; 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. @@ -51,8 +54,7 @@ service ImageAnnotator { // `google.longrunning.Operations` interface. // `Operation.metadata` contains `OperationMetadata` (metadata). // `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). - rpc AsyncBatchAnnotateFiles(AsyncBatchAnnotateFilesRequest) - returns (google.longrunning.Operation) { + rpc AsyncBatchAnnotateFiles(AsyncBatchAnnotateFilesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/files:asyncBatchAnnotate" body: "*" @@ -104,6 +106,9 @@ message Feature { // Run web detection. WEB_DETECTION = 10; + // Run Product Search. + PRODUCT_SEARCH = 12; + // Run localizer for object detection. OBJECT_LOCALIZATION = 19; } @@ -388,7 +393,7 @@ message EntityAnnotation { // For example, for an image in which the "Eiffel Tower" entity is detected, // this field represents the confidence that there is a tower in the query // image. Range [0, 1]. - float confidence = 5; + float 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 @@ -550,6 +555,9 @@ message ImageContext { // 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; } @@ -617,6 +625,9 @@ message AnnotateImageResponse { // 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. diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/product_search.proto b/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/product_search.proto new file mode 100644 index 000000000000..347ff029c982 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/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.v1; + +import "google/api/annotations.proto"; +import "google/cloud/vision/v1/geometry.proto"; +import "google/cloud/vision/v1/product_search_service.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1;vision"; +option java_multiple_files = true; +option java_outer_classname = "ProductSearchProto"; +option java_package = "com.google.cloud.vision.v1"; +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.v1.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-v1/src/main/proto/google/cloud/vision/v1/product_search_service.proto b/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/product_search_service.proto new file mode 100644 index 000000000000..f8ae08e33c84 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/product_search_service.proto @@ -0,0 +1,834 @@ +// 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.v1; + +import "google/api/annotations.proto"; +import "google/cloud/vision/v1/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/v1;vision"; +option java_multiple_files = true; +option java_outer_classname = "ProductSearchServiceProto"; +option java_package = "com.google.cloud.vision.v1"; +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.v1.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.v1.Product] resources, named +// `projects/*/locations/*/products/*` +// +// - Each [Product][google.cloud.vision.v1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1.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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{product_set.name=projects/*/locations/*/productSets/*}" + body: "product_set" + }; + } + + // Permanently deletes a ProductSet. All Products and ReferenceImages in the + // ProductSet will be deleted. + // + // The actual image files are not deleted from Google Cloud Storage. + // + // Possible errors: + // + // * Returns NOT_FOUND if the ProductSet does not exist. + rpc DeleteProductSet(DeleteProductSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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.v1.ImportProductSetsGcsSource.csv_file_uri]. + rpc ImportProductSets(ImportProductSetsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{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 field is 0. + // + // This field is ignored when creating a ProductSet. + google.protobuf.Timestamp index_time = 3; + + // Output only. If there was an error with indexing the product set, the field + // is populated. + // + // This field is ignored when creating a ProductSet. + google.rpc.Status index_error = 4; +} + +// A `ReferenceImage` represents a product image and its associated metadata, +// such as bounding boxes. +message ReferenceImage { + // The resource name of the reference image. + // + // Format is: + // + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + // + // This field is ignored when creating a reference image. + string name = 1; + + // The Google Cloud Storage URI of the reference image. + // + // The URI must start with `gs://`. + // + // Required. + string uri = 2; + + // Bounding polygons around the areas of interest in the reference image. + // Optional. If this field is empty, the system will try to detect regions of + // interest. At most 10 bounding polygons will be used. + // + // The provided shape is converted into a non-rotated rectangle. Once + // converted, the small edge of the rectangle must be greater than or equal + // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 + // is not). + repeated BoundingPoly bounding_polys = 3; +} + +// Request message for the `CreateProduct` method. +message CreateProductRequest { + // The project in which the Product should be created. + // + // Format is + // `projects/PROJECT_ID/locations/LOC_ID`. + string parent = 1; + + // The product to create. + Product product = 2; + + // A user-supplied resource id for this Product. If set, the server will + // attempt to use this value as the resource id. If it is already in use, an + // error is returned with code ALREADY_EXISTS. Must be at most 128 characters + // long. It cannot contain the character `/`. + string product_id = 3; +} + +// Request message for the `ListProducts` method. +message ListProductsRequest { + // The project OR ProductSet from which Products should be listed. + // + // Format: + // `projects/PROJECT_ID/locations/LOC_ID` + string parent = 1; + + // The maximum number of items to return. Default 10, maximum 100. + int32 page_size = 2; + + // The next_page_token returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for the `ListProducts` method. +message ListProductsResponse { + // List of products. + repeated Product products = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request message for the `GetProduct` method. +message GetProductRequest { + // Resource name of the Product to get. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + string name = 1; +} + +// Request message for the `UpdateProduct` method. +message UpdateProductRequest { + // The Product resource which replaces the one on the server. + // product.name is immutable. + Product product = 1; + + // The [FieldMask][google.protobuf.FieldMask] that specifies which fields + // to update. + // If update_mask isn't specified, all mutable fields are to be updated. + // Valid mask paths include `product_labels`, `display_name`, and + // `description`. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for the `DeleteProduct` method. +message DeleteProductRequest { + // Resource name of product to delete. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + string name = 1; +} + +// Request message for the `CreateProductSet` method. +message CreateProductSetRequest { + // The project in which the ProductSet should be created. + // + // Format is `projects/PROJECT_ID/locations/LOC_ID`. + string parent = 1; + + // The ProductSet to create. + ProductSet product_set = 2; + + // A user-supplied resource id for this ProductSet. If set, the server will + // attempt to use this value as the resource id. If it is already in use, an + // error is returned with code ALREADY_EXISTS. Must be at most 128 characters + // long. It cannot contain the character `/`. + string product_set_id = 3; +} + +// Request message for the `ListProductSets` method. +message ListProductSetsRequest { + // The project from which ProductSets should be listed. + // + // Format is `projects/PROJECT_ID/locations/LOC_ID`. + string parent = 1; + + // The maximum number of items to return. Default 10, maximum 100. + int32 page_size = 2; + + // The next_page_token returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for the `ListProductSets` method. +message ListProductSetsResponse { + // List of ProductSets. + repeated ProductSet product_sets = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request message for the `GetProductSet` method. +message GetProductSetRequest { + // Resource name of the ProductSet to get. + // + // Format is: + // `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` + string name = 1; +} + +// Request message for the `UpdateProductSet` method. +message UpdateProductSetRequest { + // The ProductSet resource which replaces the one on the server. + ProductSet product_set = 1; + + // The [FieldMask][google.protobuf.FieldMask] that specifies which fields to + // update. + // If update_mask isn't specified, all mutable fields are to be updated. + // Valid mask path is `display_name`. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for the `DeleteProductSet` method. +message DeleteProductSetRequest { + // Resource name of the ProductSet to delete. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + string name = 1; +} + +// Request message for the `CreateReferenceImage` method. +message CreateReferenceImageRequest { + // Resource name of the product in which to create the reference image. + // + // Format is + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + string parent = 1; + + // The reference image to create. + // If an image ID is specified, it is ignored. + ReferenceImage reference_image = 2; + + // A user-supplied resource id for the ReferenceImage to be added. If set, + // the server will attempt to use this value as the resource id. If it is + // already in use, an error is returned with code ALREADY_EXISTS. Must be at + // most 128 characters long. It cannot contain the character `/`. + string reference_image_id = 3; +} + +// Request message for the `ListReferenceImages` method. +message ListReferenceImagesRequest { + // Resource name of the product containing the reference images. + // + // Format is + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + string parent = 1; + + // The maximum number of items to return. Default 10, maximum 100. + int32 page_size = 2; + + // A token identifying a page of results to be returned. This is the value + // of `nextPageToken` returned in a previous reference image list request. + // + // Defaults to the first page if not specified. + string page_token = 3; +} + +// Response message for the `ListReferenceImages` method. +message ListReferenceImagesResponse { + // The list of reference images. + repeated ReferenceImage reference_images = 1; + + // The maximum number of items to return. Default 10, maximum 100. + int32 page_size = 2; + + // The next_page_token returned from a previous List request, if any. + string next_page_token = 3; +} + +// Request message for the `GetReferenceImage` method. +message GetReferenceImageRequest { + // The resource name of the ReferenceImage to get. + // + // Format is: + // + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + string name = 1; +} + +// Request message for the `DeleteReferenceImage` method. +message DeleteReferenceImageRequest { + // The resource name of the reference image to delete. + // + // Format is: + // + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + string name = 1; +} + +// Request message for the `AddProductToProductSet` method. +message AddProductToProductSetRequest { + // The resource name for the ProductSet to modify. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + string name = 1; + + // The resource name for the Product to be added to this ProductSet. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + string product = 2; +} + +// Request message for the `RemoveProductFromProductSet` method. +message RemoveProductFromProductSetRequest { + // The resource name for the ProductSet to modify. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + string name = 1; + + // The resource name for the Product to be removed from this ProductSet. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + string product = 2; +} + +// Request message for the `ListProductsInProductSet` method. +message ListProductsInProductSetRequest { + // The ProductSet resource for which to retrieve Products. + // + // Format is: + // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + string name = 1; + + // The maximum number of items to return. Default 10, maximum 100. + int32 page_size = 2; + + // The next_page_token returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for the `ListProductsInProductSet` method. +message ListProductsInProductSetResponse { + // The list of Products. + repeated Product products = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The Google Cloud Storage location for a csv file which preserves a list of +// ImportProductSetRequests in each line. +message ImportProductSetsGcsSource { + // The Google Cloud Storage URI of the input csv file. + // + // The URI must start with `gs://`. + // + // The format of the input csv file should be one image per line. + // In each line, there are 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.v1.Product.display_name], the + // `product-category` column refers to + // [product_category][google.cloud.vision.v1.Product.product_category], and the + // `labels` column refers to [product_labels][google.cloud.vision.v1.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.v1.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-v1/src/main/proto/google/cloud/vision/v1/text_annotation.proto b/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/text_annotation.proto index aa506b981be4..c66c9114f1f7 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/text_annotation.proto +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/text_annotation.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google Inc. +// 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. @@ -11,6 +11,7 @@ // WITHOUT 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"; diff --git a/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/web_detection.proto b/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/web_detection.proto index 5747559810c7..17e86f8b36bb 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/web_detection.proto +++ b/google-api-grpc/proto-google-cloud-vision-v1/src/main/proto/google/cloud/vision/v1/web_detection.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google Inc. +// 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. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -25,6 +26,7 @@ option java_outer_classname = "WebDetectionProto"; option java_package = "com.google.cloud.vision.v1"; option objc_class_prefix = "GCVN"; + // Relevant information for the image from the Internet. message WebDetection { // Entity deduced from similar images on the Internet. @@ -100,6 +102,7 @@ message WebDetection { // The visually similar image results. repeated WebImage visually_similar_images = 6; - // Best guess text labels for the request image. + // 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-api-grpc/proto-google-cloud-vision-v1p1beta1/pom.xml b/google-api-grpc/proto-google-cloud-vision-v1p1beta1/pom.xml index cab2b09128c6..0343f26275d8 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1p1beta1/pom.xml +++ b/google-api-grpc/proto-google-cloud-vision-v1p1beta1/pom.xml @@ -17,10 +17,15 @@ protobuf-java compile + + com.google.api + api-common + compile + com.google.api.grpc proto-google-common-protos compile - \ No newline at end of file + diff --git a/google-api-grpc/proto-google-cloud-vision-v1p2beta1/pom.xml b/google-api-grpc/proto-google-cloud-vision-v1p2beta1/pom.xml index 39d91bbe6567..4e4cbe3945af 100644 --- a/google-api-grpc/proto-google-cloud-vision-v1p2beta1/pom.xml +++ b/google-api-grpc/proto-google-cloud-vision-v1p2beta1/pom.xml @@ -17,10 +17,15 @@ protobuf-java compile + + com.google.api + api-common + compile + com.google.api.grpc proto-google-common-protos compile - \ No newline at end of file + diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java new file mode 100644 index 000000000000..19891b17547d --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java @@ -0,0 +1,2546 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.vision.v1.stub.ProductSearchStub; +import com.google.cloud.vision.v1.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.v1.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.v1.Product] resources, named + * `projects/*/locations/*/products/*` + * + *

- Each [Product][google.cloud.vision.v1.Product] has a collection of + * [ReferenceImage][google.cloud.vision.v1.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()) {
+ *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+ *   Product product = Product.newBuilder().build();
+ *   String productId = "";
+ *   Product response = productSearchClient.createProduct(formattedParent, product, productId);
+ * }
+ * 
+ * 
+ * + *

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") +public class ProductSearchClient implements BackgroundResource { + private final ProductSearchSettings settings; + private final ProductSearchStub stub; + private final OperationsClient operationsClient; + + private static final PathTemplate LOCATION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private static final PathTemplate PRODUCT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/products/{product}"); + + private static final PathTemplate PRODUCT_SET_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/productSets/{product_set}"); + + private static final PathTemplate IMAGE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/products/{product}/referenceImages/{image}"); + + /** Formats a string containing the fully-qualified path to represent a location resource. */ + public static final String formatLocationName(String project, String location) { + return LOCATION_PATH_TEMPLATE.instantiate( + "project", project, + "location", location); + } + + /** Formats a string containing the fully-qualified path to represent a product resource. */ + public static final String formatProductName(String project, String location, String product) { + return PRODUCT_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "product", product); + } + + /** Formats a string containing the fully-qualified path to represent a product_set resource. */ + public static final String formatProductSetName( + String project, String location, String productSet) { + return PRODUCT_SET_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "product_set", productSet); + } + + /** Formats a string containing the fully-qualified path to represent a image resource. */ + public static final String formatImageName( + String project, String location, String product, String image) { + return IMAGE_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "product", product, + "image", image); + } + + /** + * Parses the project from the given fully-qualified path which represents a location resource. + */ + public static final String parseProjectFromLocationName(String locationName) { + return LOCATION_PATH_TEMPLATE.parse(locationName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a location resource. + */ + public static final String parseLocationFromLocationName(String locationName) { + return LOCATION_PATH_TEMPLATE.parse(locationName).get("location"); + } + + /** Parses the project from the given fully-qualified path which represents a product resource. */ + public static final String parseProjectFromProductName(String productName) { + return PRODUCT_PATH_TEMPLATE.parse(productName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a product resource. + */ + public static final String parseLocationFromProductName(String productName) { + return PRODUCT_PATH_TEMPLATE.parse(productName).get("location"); + } + + /** Parses the product from the given fully-qualified path which represents a product resource. */ + public static final String parseProductFromProductName(String productName) { + return PRODUCT_PATH_TEMPLATE.parse(productName).get("product"); + } + + /** + * Parses the project from the given fully-qualified path which represents a product_set resource. + */ + public static final String parseProjectFromProductSetName(String productSetName) { + return PRODUCT_SET_PATH_TEMPLATE.parse(productSetName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a product_set + * resource. + */ + public static final String parseLocationFromProductSetName(String productSetName) { + return PRODUCT_SET_PATH_TEMPLATE.parse(productSetName).get("location"); + } + + /** + * Parses the product_set from the given fully-qualified path which represents a product_set + * resource. + */ + public static final String parseProductSetFromProductSetName(String productSetName) { + return PRODUCT_SET_PATH_TEMPLATE.parse(productSetName).get("product_set"); + } + + /** Parses the project from the given fully-qualified path which represents a image resource. */ + public static final String parseProjectFromImageName(String imageName) { + return IMAGE_PATH_TEMPLATE.parse(imageName).get("project"); + } + + /** Parses the location from the given fully-qualified path which represents a image resource. */ + public static final String parseLocationFromImageName(String imageName) { + return IMAGE_PATH_TEMPLATE.parse(imageName).get("location"); + } + + /** Parses the product from the given fully-qualified path which represents a image resource. */ + public static final String parseProductFromImageName(String imageName) { + return IMAGE_PATH_TEMPLATE.parse(imageName).get("product"); + } + + /** Parses the image from the given fully-qualified path which represents a image resource. */ + public static final String parseImageFromImageName(String imageName) { + return IMAGE_PATH_TEMPLATE.parse(imageName).get("image"); + } + + /** 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 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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   Product product = Product.newBuilder().build();
+   *   String productId = "";
+   *   Product response = productSearchClient.createProduct(formattedParent, 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) { + LOCATION_PATH_TEMPLATE.validate(parent, "createProduct"); + 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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   Product product = Product.newBuilder().build();
+   *   CreateProductRequest request = CreateProductRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setProduct(product)
+   *     .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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   Product product = Product.newBuilder().build();
+   *   CreateProductRequest request = CreateProductRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setProduct(product)
+   *     .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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   for (Product element : productSearchClient.listProducts(formattedParent).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) { + LOCATION_PATH_TEMPLATE.validate(parent, "listProducts"); + 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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListProductsRequest request = ListProductsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListProductsRequest request = ListProductsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListProductsRequest request = ListProductsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   Product response = productSearchClient.getProduct(formattedName);
+   * }
+   * 
+ * + * @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) { + PRODUCT_PATH_TEMPLATE.validate(name, "getProduct"); + 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()) {
+   *   String formattedName = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   GetProductRequest request = GetProductRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   GetProductRequest request = GetProductRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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();
+   *   UpdateProductRequest request = UpdateProductRequest.newBuilder()
+   *     .setProduct(product)
+   *     .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();
+   *   UpdateProductRequest request = UpdateProductRequest.newBuilder()
+   *     .setProduct(product)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   productSearchClient.deleteProduct(formattedName);
+   * }
+   * 
+ * + * @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) { + PRODUCT_PATH_TEMPLATE.validate(name, "deleteProduct"); + 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()) {
+   *   String formattedName = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   DeleteProductRequest request = DeleteProductRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   DeleteProductRequest request = DeleteProductRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.deleteProductCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteProductCallable() { + return stub.deleteProductCallable(); + } + + // 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()) {
+   *   String formattedParent = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   for (ReferenceImage element : productSearchClient.listReferenceImages(formattedParent).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) { + PRODUCT_PATH_TEMPLATE.validate(parent, "listReferenceImages"); + 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()) {
+   *   String formattedParent = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ListReferenceImagesRequest request = ListReferenceImagesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .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()) {
+   *   String formattedParent = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ListReferenceImagesRequest request = ListReferenceImagesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .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()) {
+   *   String formattedParent = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ListReferenceImagesRequest request = ListReferenceImagesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatImageName("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[IMAGE]");
+   *   ReferenceImage response = productSearchClient.getReferenceImage(formattedName);
+   * }
+   * 
+ * + * @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) { + IMAGE_PATH_TEMPLATE.validate(name, "getReferenceImage"); + 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()) {
+   *   String formattedName = ProductSearchClient.formatImageName("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[IMAGE]");
+   *   GetReferenceImageRequest request = GetReferenceImageRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatImageName("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[IMAGE]");
+   *   GetReferenceImageRequest request = GetReferenceImageRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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 + /** + * 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()) {
+   *   String formattedName = ProductSearchClient.formatImageName("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[IMAGE]");
+   *   productSearchClient.deleteReferenceImage(formattedName);
+   * }
+   * 
+ * + * @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) { + IMAGE_PATH_TEMPLATE.validate(name, "deleteReferenceImage"); + 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()) {
+   *   String formattedName = ProductSearchClient.formatImageName("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[IMAGE]");
+   *   DeleteReferenceImageRequest request = DeleteReferenceImageRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatImageName("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[IMAGE]");
+   *   DeleteReferenceImageRequest request = DeleteReferenceImageRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.deleteReferenceImageCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteReferenceImageCallable() { + return stub.deleteReferenceImageCallable(); + } + + // 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()) {
+   *   String formattedParent = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ReferenceImage referenceImage = ReferenceImage.newBuilder().build();
+   *   String referenceImageId = "";
+   *   ReferenceImage response = productSearchClient.createReferenceImage(formattedParent, 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) { + PRODUCT_PATH_TEMPLATE.validate(parent, "createReferenceImage"); + 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()) {
+   *   String formattedParent = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ReferenceImage referenceImage = ReferenceImage.newBuilder().build();
+   *   CreateReferenceImageRequest request = CreateReferenceImageRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setReferenceImage(referenceImage)
+   *     .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()) {
+   *   String formattedParent = ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]");
+   *   ReferenceImage referenceImage = ReferenceImage.newBuilder().build();
+   *   CreateReferenceImageRequest request = CreateReferenceImageRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setReferenceImage(referenceImage)
+   *     .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 + /** + * 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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   String productSetId = "";
+   *   ProductSet response = productSearchClient.createProductSet(formattedParent, 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) { + LOCATION_PATH_TEMPLATE.validate(parent, "createProductSet"); + 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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   CreateProductSetRequest request = CreateProductSetRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setProductSet(productSet)
+   *     .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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ProductSet productSet = ProductSet.newBuilder().build();
+   *   CreateProductSetRequest request = CreateProductSetRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setProductSet(productSet)
+   *     .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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   for (ProductSet element : productSearchClient.listProductSets(formattedParent).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) { + LOCATION_PATH_TEMPLATE.validate(parent, "listProductSets"); + 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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListProductSetsRequest request = ListProductSetsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListProductSetsRequest request = ListProductSetsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .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()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListProductSetsRequest request = ListProductSetsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   ProductSet response = productSearchClient.getProductSet(formattedName);
+   * }
+   * 
+ * + * @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) { + PRODUCT_SET_PATH_TEMPLATE.validate(name, "getProductSet"); + 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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   GetProductSetRequest request = GetProductSetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   GetProductSetRequest request = GetProductSetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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();
+   *   UpdateProductSetRequest request = UpdateProductSetRequest.newBuilder()
+   *     .setProductSet(productSet)
+   *     .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();
+   *   UpdateProductSetRequest request = UpdateProductSetRequest.newBuilder()
+   *     .setProductSet(productSet)
+   *     .build();
+   *   ApiFuture<ProductSet> future = productSearchClient.updateProductSetCallable().futureCall(request);
+   *   // Do something
+   *   ProductSet response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateProductSetCallable() { + return stub.updateProductSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be + * deleted. + * + *

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

Possible errors: + * + *

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

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   productSearchClient.deleteProductSet(formattedName);
+   * }
+   * 
+ * + * @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) { + PRODUCT_SET_PATH_TEMPLATE.validate(name, "deleteProductSet"); + DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder().setName(name).build(); + deleteProductSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Permanently deletes a ProductSet. All Products and ReferenceImages in the ProductSet will be + * deleted. + * + *

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

Possible errors: + * + *

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

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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. All Products and ReferenceImages in the ProductSet will be + * deleted. + * + *

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

Possible errors: + * + *

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

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   DeleteProductSetRequest request = DeleteProductSetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Void> future = productSearchClient.deleteProductSetCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteProductSetCallable() { + return stub.deleteProductSetCallable(); + } + + // 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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   productSearchClient.addProductToProductSet(formattedName, 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) { + PRODUCT_SET_PATH_TEMPLATE.validate(name, "addProductToProductSet"); + 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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   AddProductToProductSetRequest request = AddProductToProductSetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   AddProductToProductSetRequest request = AddProductToProductSetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   productSearchClient.removeProductFromProductSet(formattedName, 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) { + PRODUCT_SET_PATH_TEMPLATE.validate(name, "removeProductFromProductSet"); + 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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   RemoveProductFromProductSetRequest request = RemoveProductFromProductSetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   String product = "";
+   *   RemoveProductFromProductSetRequest request = RemoveProductFromProductSetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   for (Product element : productSearchClient.listProductsInProductSet(formattedName).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) { + PRODUCT_SET_PATH_TEMPLATE.validate(name, "listProductsInProductSet"); + 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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   ListProductsInProductSetRequest request = ListProductsInProductSetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   ListProductsInProductSetRequest request = ListProductsInProductSetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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()) {
+   *   String formattedName = ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
+   *   ListProductsInProductSetRequest request = ListProductsInProductSetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .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.v1.ImportProductSetsGcsSource.csv_file_uri]. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsResponse response = productSearchClient.importProductSetsAsync(formattedParent, 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) { + LOCATION_PATH_TEMPLATE.validate(parent, "importProductSets"); + 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.v1.ImportProductSetsGcsSource.csv_file_uri]. + * + *

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsRequest request = ImportProductSetsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .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.v1.ImportProductSetsGcsSource.csv_file_uri]. + * + *

Sample code: + * + *


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

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

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

Sample code: + * + *


+   * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+   *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build();
+   *   ImportProductSetsRequest request = ImportProductSetsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .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 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 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 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/v1/ProductSearchSettings.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchSettings.java new file mode 100644 index 000000000000..9bc9a185e368 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchSettings.java @@ -0,0 +1,398 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1; + +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1.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.v1.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 createProduct to 30 seconds: + * + *

+ * 
+ * ProductSearchSettings.Builder productSearchSettingsBuilder =
+ *     ProductSearchSettings.newBuilder();
+ * productSearchSettingsBuilder.createProductSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ProductSearchSettings productSearchSettings = productSearchSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +public class ProductSearchSettings extends ClientSettings { + /** 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 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 deleteReferenceImage. */ + public UnaryCallSettings deleteReferenceImageSettings() { + return ((ProductSearchStubSettings) getStubSettings()).deleteReferenceImageSettings(); + } + + /** 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 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 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 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 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 deleteReferenceImage. */ + public UnaryCallSettings.Builder + deleteReferenceImageSettings() { + return getStubSettingsBuilder().deleteReferenceImageSettings(); + } + + /** 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 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 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/v1/package-info.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/package-info.java index d51bd17ad6a5..0567a3e2cfdb 100644 --- a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/package-info.java +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/package-info.java @@ -19,7 +19,38 @@ * *

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

==================== ImageAnnotatorClient ==================== + *

=================== 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.v1.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.v1.Product] resources, named + * `projects/*/locations/*/products/*` + * + *

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

Sample for ProductSearchClient: + * + *

+ * 
+ * try (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
+ *   String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]");
+ *   Product product = Product.newBuilder().build();
+ *   String productId = "";
+ *   Product response = productSearchClient.createProduct(formattedParent, product, productId);
+ * }
+ * 
+ * 
+ * + * ==================== 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 diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcProductSearchCallableFactory.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcProductSearchCallableFactory.java new file mode 100644 index 000000000000..ef035f3b6ae7 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcProductSearchCallableFactory.java @@ -0,0 +1,116 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Cloud Vision API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcProductSearchCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcProductSearchStub.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcProductSearchStub.java new file mode 100644 index 000000000000..cabd824dbc31 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/GrpcProductSearchStub.java @@ -0,0 +1,630 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1.stub; + +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest; +import com.google.cloud.vision.v1.BatchOperationMetadata; +import com.google.cloud.vision.v1.CreateProductRequest; +import com.google.cloud.vision.v1.CreateProductSetRequest; +import com.google.cloud.vision.v1.CreateReferenceImageRequest; +import com.google.cloud.vision.v1.DeleteProductRequest; +import com.google.cloud.vision.v1.DeleteProductSetRequest; +import com.google.cloud.vision.v1.DeleteReferenceImageRequest; +import com.google.cloud.vision.v1.GetProductRequest; +import com.google.cloud.vision.v1.GetProductSetRequest; +import com.google.cloud.vision.v1.GetReferenceImageRequest; +import com.google.cloud.vision.v1.ImportProductSetsRequest; +import com.google.cloud.vision.v1.ImportProductSetsResponse; +import com.google.cloud.vision.v1.ListProductSetsRequest; +import com.google.cloud.vision.v1.ListProductSetsResponse; +import com.google.cloud.vision.v1.ListProductsInProductSetRequest; +import com.google.cloud.vision.v1.ListProductsInProductSetResponse; +import com.google.cloud.vision.v1.ListProductsRequest; +import com.google.cloud.vision.v1.ListProductsResponse; +import com.google.cloud.vision.v1.ListReferenceImagesRequest; +import com.google.cloud.vision.v1.ListReferenceImagesResponse; +import com.google.cloud.vision.v1.Product; +import com.google.cloud.vision.v1.ProductSet; +import com.google.cloud.vision.v1.ReferenceImage; +import com.google.cloud.vision.v1.RemoveProductFromProductSetRequest; +import com.google.cloud.vision.v1.UpdateProductRequest; +import com.google.cloud.vision.v1.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 + createProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ProductSearch/DeleteProduct") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listReferenceImagesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1.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.v1.ProductSearch/GetReferenceImage") + .setRequestMarshaller( + ProtoUtils.marshaller(GetReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReferenceImage.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteReferenceImageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1.ProductSearch/DeleteReferenceImage") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createReferenceImageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1.ProductSearch/CreateReferenceImage") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateReferenceImageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReferenceImage.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createProductSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1.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.v1.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.v1.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.v1.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.v1.ProductSearch/DeleteProductSet") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteProductSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + addProductToProductSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.vision.v1.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.v1.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.v1.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.v1.ProductSearch/ImportProductSets") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportProductSetsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + 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 + listReferenceImagesCallable; + private final UnaryCallable + listReferenceImagesPagedCallable; + private final UnaryCallable getReferenceImageCallable; + private final UnaryCallable deleteReferenceImageCallable; + private final UnaryCallable + createReferenceImageCallable; + 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 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 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 + listReferenceImagesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listReferenceImagesMethodDescriptor) + .build(); + GrpcCallSettings getReferenceImageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getReferenceImageMethodDescriptor) + .build(); + GrpcCallSettings deleteReferenceImageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteReferenceImageMethodDescriptor) + .build(); + GrpcCallSettings + createReferenceImageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createReferenceImageMethodDescriptor) + .build(); + 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 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.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.listReferenceImagesCallable = + callableFactory.createUnaryCallable( + listReferenceImagesTransportSettings, + settings.listReferenceImagesSettings(), + clientContext); + this.listReferenceImagesPagedCallable = + callableFactory.createPagedCallable( + listReferenceImagesTransportSettings, + settings.listReferenceImagesSettings(), + clientContext); + this.getReferenceImageCallable = + callableFactory.createUnaryCallable( + getReferenceImageTransportSettings, + settings.getReferenceImageSettings(), + clientContext); + this.deleteReferenceImageCallable = + callableFactory.createUnaryCallable( + deleteReferenceImageTransportSettings, + settings.deleteReferenceImageSettings(), + clientContext); + this.createReferenceImageCallable = + callableFactory.createUnaryCallable( + createReferenceImageTransportSettings, + settings.createReferenceImageSettings(), + clientContext); + 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.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 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 + listReferenceImagesPagedCallable() { + return listReferenceImagesPagedCallable; + } + + public UnaryCallable + listReferenceImagesCallable() { + return listReferenceImagesCallable; + } + + public UnaryCallable getReferenceImageCallable() { + return getReferenceImageCallable; + } + + public UnaryCallable deleteReferenceImageCallable() { + return deleteReferenceImageCallable; + } + + public UnaryCallable createReferenceImageCallable() { + return createReferenceImageCallable; + } + + 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 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/v1/stub/ProductSearchStub.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStub.java new file mode 100644 index 000000000000..c61ea4ea525b --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStub.java @@ -0,0 +1,180 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1.stub; + +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest; +import com.google.cloud.vision.v1.BatchOperationMetadata; +import com.google.cloud.vision.v1.CreateProductRequest; +import com.google.cloud.vision.v1.CreateProductSetRequest; +import com.google.cloud.vision.v1.CreateReferenceImageRequest; +import com.google.cloud.vision.v1.DeleteProductRequest; +import com.google.cloud.vision.v1.DeleteProductSetRequest; +import com.google.cloud.vision.v1.DeleteReferenceImageRequest; +import com.google.cloud.vision.v1.GetProductRequest; +import com.google.cloud.vision.v1.GetProductSetRequest; +import com.google.cloud.vision.v1.GetReferenceImageRequest; +import com.google.cloud.vision.v1.ImportProductSetsRequest; +import com.google.cloud.vision.v1.ImportProductSetsResponse; +import com.google.cloud.vision.v1.ListProductSetsRequest; +import com.google.cloud.vision.v1.ListProductSetsResponse; +import com.google.cloud.vision.v1.ListProductsInProductSetRequest; +import com.google.cloud.vision.v1.ListProductsInProductSetResponse; +import com.google.cloud.vision.v1.ListProductsRequest; +import com.google.cloud.vision.v1.ListProductsResponse; +import com.google.cloud.vision.v1.ListReferenceImagesRequest; +import com.google.cloud.vision.v1.ListReferenceImagesResponse; +import com.google.cloud.vision.v1.Product; +import com.google.cloud.vision.v1.ProductSet; +import com.google.cloud.vision.v1.ReferenceImage; +import com.google.cloud.vision.v1.RemoveProductFromProductSetRequest; +import com.google.cloud.vision.v1.UpdateProductRequest; +import com.google.cloud.vision.v1.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 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 + 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 deleteReferenceImageCallable() { + throw new UnsupportedOperationException("Not implemented: deleteReferenceImageCallable()"); + } + + public UnaryCallable createReferenceImageCallable() { + throw new UnsupportedOperationException("Not implemented: createReferenceImageCallable()"); + } + + 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 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/v1/stub/ProductSearchStubSettings.java b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStubSettings.java new file mode 100644 index 000000000000..6dfacbb59294 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/stub/ProductSearchStubSettings.java @@ -0,0 +1,1046 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1.stub; + +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1.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.v1.AddProductToProductSetRequest; +import com.google.cloud.vision.v1.BatchOperationMetadata; +import com.google.cloud.vision.v1.CreateProductRequest; +import com.google.cloud.vision.v1.CreateProductSetRequest; +import com.google.cloud.vision.v1.CreateReferenceImageRequest; +import com.google.cloud.vision.v1.DeleteProductRequest; +import com.google.cloud.vision.v1.DeleteProductSetRequest; +import com.google.cloud.vision.v1.DeleteReferenceImageRequest; +import com.google.cloud.vision.v1.GetProductRequest; +import com.google.cloud.vision.v1.GetProductSetRequest; +import com.google.cloud.vision.v1.GetReferenceImageRequest; +import com.google.cloud.vision.v1.ImportProductSetsRequest; +import com.google.cloud.vision.v1.ImportProductSetsResponse; +import com.google.cloud.vision.v1.ListProductSetsRequest; +import com.google.cloud.vision.v1.ListProductSetsResponse; +import com.google.cloud.vision.v1.ListProductsInProductSetRequest; +import com.google.cloud.vision.v1.ListProductsInProductSetResponse; +import com.google.cloud.vision.v1.ListProductsRequest; +import com.google.cloud.vision.v1.ListProductsResponse; +import com.google.cloud.vision.v1.ListReferenceImagesRequest; +import com.google.cloud.vision.v1.ListReferenceImagesResponse; +import com.google.cloud.vision.v1.Product; +import com.google.cloud.vision.v1.ProductSet; +import com.google.cloud.vision.v1.ReferenceImage; +import com.google.cloud.vision.v1.RemoveProductFromProductSetRequest; +import com.google.cloud.vision.v1.UpdateProductRequest; +import com.google.cloud.vision.v1.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 createProduct to 30 seconds: + * + *

+ * 
+ * ProductSearchStubSettings.Builder productSearchSettingsBuilder =
+ *     ProductSearchStubSettings.newBuilder();
+ * productSearchSettingsBuilder.createProductSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ProductSearchStubSettings productSearchSettings = productSearchSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +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 createProductSettings; + private final PagedCallSettings< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings; + private final UnaryCallSettings getProductSettings; + private final UnaryCallSettings updateProductSettings; + private final UnaryCallSettings deleteProductSettings; + private final PagedCallSettings< + ListReferenceImagesRequest, ListReferenceImagesResponse, ListReferenceImagesPagedResponse> + listReferenceImagesSettings; + private final UnaryCallSettings + getReferenceImageSettings; + private final UnaryCallSettings deleteReferenceImageSettings; + private final UnaryCallSettings + createReferenceImageSettings; + 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 + 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 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 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 deleteReferenceImage. */ + public UnaryCallSettings deleteReferenceImageSettings() { + return deleteReferenceImageSettings; + } + + /** 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 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 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); + + createProductSettings = settingsBuilder.createProductSettings().build(); + listProductsSettings = settingsBuilder.listProductsSettings().build(); + getProductSettings = settingsBuilder.getProductSettings().build(); + updateProductSettings = settingsBuilder.updateProductSettings().build(); + deleteProductSettings = settingsBuilder.deleteProductSettings().build(); + listReferenceImagesSettings = settingsBuilder.listReferenceImagesSettings().build(); + getReferenceImageSettings = settingsBuilder.getReferenceImageSettings().build(); + deleteReferenceImageSettings = settingsBuilder.deleteReferenceImageSettings().build(); + createReferenceImageSettings = settingsBuilder.createReferenceImageSettings().build(); + createProductSetSettings = settingsBuilder.createProductSetSettings().build(); + listProductSetsSettings = settingsBuilder.listProductSetsSettings().build(); + getProductSetSettings = settingsBuilder.getProductSetSettings().build(); + updateProductSetSettings = settingsBuilder.updateProductSetSettings().build(); + deleteProductSetSettings = settingsBuilder.deleteProductSetSettings().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 + LIST_PRODUCTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProductsRequest injectToken(ListProductsRequest payload, String token) { + return ListProductsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProductsRequest injectPageSize(ListProductsRequest payload, int pageSize) { + return ListProductsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProductsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProductsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProductsResponse payload) { + return payload.getProductsList(); + } + }; + + private static final PagedListDescriptor< + ListReferenceImagesRequest, ListReferenceImagesResponse, ReferenceImage> + LIST_REFERENCE_IMAGES_PAGE_STR_DESC = + new PagedListDescriptor< + ListReferenceImagesRequest, ListReferenceImagesResponse, ReferenceImage>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListReferenceImagesRequest injectToken( + ListReferenceImagesRequest payload, String token) { + return ListReferenceImagesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListReferenceImagesRequest injectPageSize( + ListReferenceImagesRequest payload, int pageSize) { + return ListReferenceImagesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListReferenceImagesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListReferenceImagesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListReferenceImagesResponse payload) { + return payload.getReferenceImagesList(); + } + }; + + private static final PagedListDescriptor< + ListProductSetsRequest, ListProductSetsResponse, ProductSet> + LIST_PRODUCT_SETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProductSetsRequest injectToken( + ListProductSetsRequest payload, String token) { + return ListProductSetsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProductSetsRequest injectPageSize( + ListProductSetsRequest payload, int pageSize) { + return ListProductSetsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProductSetsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProductSetsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProductSetsResponse payload) { + return payload.getProductSetsList(); + } + }; + + private static final PagedListDescriptor< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, Product> + LIST_PRODUCTS_IN_PRODUCT_SET_PAGE_STR_DESC = + new PagedListDescriptor< + ListProductsInProductSetRequest, ListProductsInProductSetResponse, Product>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProductsInProductSetRequest injectToken( + ListProductsInProductSetRequest payload, String token) { + return ListProductsInProductSetRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListProductsInProductSetRequest injectPageSize( + ListProductsInProductSetRequest payload, int pageSize) { + return ListProductsInProductSetRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListProductsInProductSetRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProductsInProductSetResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProductsInProductSetResponse payload) { + return payload.getProductsList(); + } + }; + + private static final PagedListResponseFactory< + 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< + 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< + 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 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 PagedCallSettings.Builder< + ListReferenceImagesRequest, ListReferenceImagesResponse, + ListReferenceImagesPagedResponse> + listReferenceImagesSettings; + private final UnaryCallSettings.Builder + getReferenceImageSettings; + private final UnaryCallSettings.Builder + deleteReferenceImageSettings; + private final UnaryCallSettings.Builder + createReferenceImageSettings; + 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 + 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(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); + + createProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listProductsSettings = PagedCallSettings.newBuilder(LIST_PRODUCTS_PAGE_STR_FACT); + + getProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listReferenceImagesSettings = + PagedCallSettings.newBuilder(LIST_REFERENCE_IMAGES_PAGE_STR_FACT); + + getReferenceImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteReferenceImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createReferenceImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createProductSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listProductSetsSettings = PagedCallSettings.newBuilder(LIST_PRODUCT_SETS_PAGE_STR_FACT); + + getProductSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateProductSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteProductSetSettings = 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( + createProductSettings, + listProductsSettings, + getProductSettings, + updateProductSettings, + deleteProductSettings, + listReferenceImagesSettings, + getReferenceImageSettings, + deleteReferenceImageSettings, + createReferenceImageSettings, + createProductSetSettings, + listProductSetsSettings, + getProductSetSettings, + updateProductSetSettings, + deleteProductSetSettings, + 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 + .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("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteProductSettings() + .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 + .deleteReferenceImageSettings() + .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 + .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("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteProductSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .addProductToProductSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .removeProductFromProductSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("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); + + createProductSettings = settings.createProductSettings.toBuilder(); + listProductsSettings = settings.listProductsSettings.toBuilder(); + getProductSettings = settings.getProductSettings.toBuilder(); + updateProductSettings = settings.updateProductSettings.toBuilder(); + deleteProductSettings = settings.deleteProductSettings.toBuilder(); + listReferenceImagesSettings = settings.listReferenceImagesSettings.toBuilder(); + getReferenceImageSettings = settings.getReferenceImageSettings.toBuilder(); + deleteReferenceImageSettings = settings.deleteReferenceImageSettings.toBuilder(); + createReferenceImageSettings = settings.createReferenceImageSettings.toBuilder(); + createProductSetSettings = settings.createProductSetSettings.toBuilder(); + listProductSetsSettings = settings.listProductSetsSettings.toBuilder(); + getProductSetSettings = settings.getProductSetSettings.toBuilder(); + updateProductSetSettings = settings.updateProductSetSettings.toBuilder(); + deleteProductSetSettings = settings.deleteProductSetSettings.toBuilder(); + addProductToProductSetSettings = settings.addProductToProductSetSettings.toBuilder(); + removeProductFromProductSetSettings = + settings.removeProductFromProductSetSettings.toBuilder(); + listProductsInProductSetSettings = settings.listProductsInProductSetSettings.toBuilder(); + importProductSetsSettings = settings.importProductSetsSettings.toBuilder(); + importProductSetsOperationSettings = settings.importProductSetsOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createProductSettings, + listProductsSettings, + getProductSettings, + updateProductSettings, + deleteProductSettings, + listReferenceImagesSettings, + getReferenceImageSettings, + deleteReferenceImageSettings, + createReferenceImageSettings, + createProductSetSettings, + listProductSetsSettings, + getProductSetSettings, + updateProductSetSettings, + deleteProductSetSettings, + 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 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 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 deleteReferenceImage. */ + public UnaryCallSettings.Builder + deleteReferenceImageSettings() { + return deleteReferenceImageSettings; + } + + /** 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 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 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/v1/ImageAnnotatorClientTest.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ImageAnnotatorClientTest.java index 1927c5473113..b9cb14762db1 100644 --- a/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ImageAnnotatorClientTest.java +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ImageAnnotatorClientTest.java @@ -42,6 +42,7 @@ @javax.annotation.Generated("by GAPIC") public class ImageAnnotatorClientTest { + private static MockProductSearch mockProductSearch; private static MockImageAnnotator mockImageAnnotator; private static MockServiceHelper serviceHelper; private ImageAnnotatorClient client; @@ -49,9 +50,11 @@ public class ImageAnnotatorClientTest { @BeforeClass public static void startStaticServer() { + mockProductSearch = new MockProductSearch(); mockImageAnnotator = new MockImageAnnotator(); serviceHelper = - new MockServiceHelper("in-process-1", Arrays.asList(mockImageAnnotator)); + new MockServiceHelper( + "in-process-1", Arrays.asList(mockProductSearch, mockImageAnnotator)); serviceHelper.start(); } diff --git a/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/MockProductSearch.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/MockProductSearch.java new file mode 100644 index 000000000000..ebe03254f4bb --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/MockProductSearch.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1; + +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/v1/MockProductSearchImpl.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/MockProductSearchImpl.java new file mode 100644 index 000000000000..303aed35b7f8 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/MockProductSearchImpl.java @@ -0,0 +1,330 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.vision.v1.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/v1/ProductSearchClientTest.java b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ProductSearchClientTest.java new file mode 100644 index 000000000000..485361f93dc7 --- /dev/null +++ b/google-cloud-clients/google-cloud-vision/src/test/java/com/google/cloud/vision/v1/ProductSearchClientTest.java @@ -0,0 +1,924 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.vision.v1; + +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductSetsPagedResponse; +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductsInProductSetPagedResponse; +import static com.google.cloud.vision.v1.ProductSearchClient.ListProductsPagedResponse; +import static com.google.cloud.vision.v1.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 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); + + String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]"); + Product product = Product.newBuilder().build(); + String productId = "productId1753008747"; + + Product actualResponse = client.createProduct(formattedParent, product, productId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateProductRequest actualRequest = (CreateProductRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, 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 { + String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]"); + Product product = Product.newBuilder().build(); + String productId = "productId1753008747"; + + client.createProduct(formattedParent, 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); + + String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + ListProductsPagedResponse pagedListResponse = client.listProducts(formattedParent); + + 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(formattedParent, 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 { + String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + client.listProducts(formattedParent); + 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); + + String formattedName = + ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + + Product actualResponse = client.getProduct(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProductRequest actualRequest = (GetProductRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, 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 { + String formattedName = + ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + + client.getProduct(formattedName); + 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); + + String formattedName = + ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + + client.deleteProduct(formattedName); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProductRequest actualRequest = (DeleteProductRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, 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 { + String formattedName = + ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + + client.deleteProduct(formattedName); + 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); + + String formattedParent = + ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + + ListReferenceImagesPagedResponse pagedListResponse = + client.listReferenceImages(formattedParent); + + 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(formattedParent, 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 { + String formattedParent = + ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + + client.listReferenceImages(formattedParent); + 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); + + String formattedName = + ProductSearchClient.formatImageName("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[IMAGE]"); + + ReferenceImage actualResponse = client.getReferenceImage(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetReferenceImageRequest actualRequest = (GetReferenceImageRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, 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 { + String formattedName = + ProductSearchClient.formatImageName("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[IMAGE]"); + + client.getReferenceImage(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteReferenceImageTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockProductSearch.addResponse(expectedResponse); + + String formattedName = + ProductSearchClient.formatImageName("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[IMAGE]"); + + client.deleteReferenceImage(formattedName); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteReferenceImageRequest actualRequest = (DeleteReferenceImageRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, 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 { + String formattedName = + ProductSearchClient.formatImageName("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[IMAGE]"); + + client.deleteReferenceImage(formattedName); + 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); + + String formattedParent = + ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + ReferenceImage referenceImage = ReferenceImage.newBuilder().build(); + String referenceImageId = "referenceImageId1946713331"; + + ReferenceImage actualResponse = + client.createReferenceImage(formattedParent, referenceImage, referenceImageId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateReferenceImageRequest actualRequest = (CreateReferenceImageRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, 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 { + String formattedParent = + ProductSearchClient.formatProductName("[PROJECT]", "[LOCATION]", "[PRODUCT]"); + ReferenceImage referenceImage = ReferenceImage.newBuilder().build(); + String referenceImageId = "referenceImageId1946713331"; + + client.createReferenceImage(formattedParent, referenceImage, referenceImageId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createProductSetTest() { + String name = "name3373707"; + String displayName = "displayName1615086568"; + ProductSet expectedResponse = + ProductSet.newBuilder().setName(name).setDisplayName(displayName).build(); + mockProductSearch.addResponse(expectedResponse); + + String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]"); + ProductSet productSet = ProductSet.newBuilder().build(); + String productSetId = "productSetId4216680"; + + ProductSet actualResponse = client.createProductSet(formattedParent, productSet, productSetId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateProductSetRequest actualRequest = (CreateProductSetRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, 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 { + String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]"); + ProductSet productSet = ProductSet.newBuilder().build(); + String productSetId = "productSetId4216680"; + + client.createProductSet(formattedParent, 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); + + String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + ListProductSetsPagedResponse pagedListResponse = client.listProductSets(formattedParent); + + 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(formattedParent, 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 { + String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + client.listProductSets(formattedParent); + 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); + + String formattedName = + ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + + ProductSet actualResponse = client.getProductSet(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProductSetRequest actualRequest = (GetProductSetRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, 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 { + String formattedName = + ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + + client.getProductSet(formattedName); + 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); + + String formattedName = + ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + + client.deleteProductSet(formattedName); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProductSetRequest actualRequest = (DeleteProductSetRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, 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 { + String formattedName = + ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + + client.deleteProductSet(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void addProductToProductSetTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockProductSearch.addResponse(expectedResponse); + + String formattedName = + ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + String product = "product-309474065"; + + client.addProductToProductSet(formattedName, product); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddProductToProductSetRequest actualRequest = + (AddProductToProductSetRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, 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 { + String formattedName = + ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + String product = "product-309474065"; + + client.addProductToProductSet(formattedName, 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); + + String formattedName = + ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + String product = "product-309474065"; + + client.removeProductFromProductSet(formattedName, product); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveProductFromProductSetRequest actualRequest = + (RemoveProductFromProductSetRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, 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 { + String formattedName = + ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + String product = "product-309474065"; + + client.removeProductFromProductSet(formattedName, 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); + + String formattedName = + ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + + ListProductsInProductSetPagedResponse pagedListResponse = + client.listProductsInProductSet(formattedName); + + 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(formattedName, 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 { + String formattedName = + ProductSearchClient.formatProductSetName("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"); + + client.listProductsInProductSet(formattedName); + 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); + + String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]"); + ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build(); + + ImportProductSetsResponse actualResponse = + client.importProductSetsAsync(formattedParent, inputConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductSearch.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportProductSetsRequest actualRequest = (ImportProductSetsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, 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 { + String formattedParent = ProductSearchClient.formatLocationName("[PROJECT]", "[LOCATION]"); + ImportProductSetsInputConfig inputConfig = ImportProductSetsInputConfig.newBuilder().build(); + + client.importProductSetsAsync(formattedParent, 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()); + } + } +}