diff --git a/protos/protos.json b/protos/protos.json index 9e26dfee..8bf63bd0 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -1 +1,8496 @@ -{} \ No newline at end of file +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "vision": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/cloud/vision/v1;vision", + "java_multiple_files": true, + "java_outer_classname": "WebDetectionProto", + "java_package": "com.google.cloud.vision.v1", + "objc_class_prefix": "GCVN" + }, + "nested": { + "ImageAnnotator": { + "options": { + "(google.api.default_host)": "vision.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-vision" + }, + "methods": { + "BatchAnnotateImages": { + "requestType": "BatchAnnotateImagesRequest", + "responseType": "BatchAnnotateImagesResponse", + "options": { + "(google.api.http).post": "/v1/images:annotate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/images:annotate", + "(google.api.http).additional_bindings.body": "*" + } + }, + "BatchAnnotateFiles": { + "requestType": "BatchAnnotateFilesRequest", + "responseType": "BatchAnnotateFilesResponse", + "options": { + "(google.api.http).post": "/v1/files:annotate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/files:annotate", + "(google.api.http).additional_bindings.body": "*" + } + }, + "AsyncBatchAnnotateImages": { + "requestType": "AsyncBatchAnnotateImagesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/images:asyncBatchAnnotate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/images:asyncBatchAnnotate", + "(google.api.http).additional_bindings.body": "*" + } + }, + "AsyncBatchAnnotateFiles": { + "requestType": "AsyncBatchAnnotateFilesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/files:asyncBatchAnnotate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/files:asyncBatchAnnotate", + "(google.api.http).additional_bindings.body": "*" + } + } + } + }, + "Feature": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "maxResults": { + "type": "int32", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "FACE_DETECTION": 1, + "LANDMARK_DETECTION": 2, + "LOGO_DETECTION": 3, + "LABEL_DETECTION": 4, + "TEXT_DETECTION": 5, + "DOCUMENT_TEXT_DETECTION": 11, + "SAFE_SEARCH_DETECTION": 6, + "IMAGE_PROPERTIES": 7, + "CROP_HINTS": 9, + "WEB_DETECTION": 10, + "PRODUCT_SEARCH": 12, + "OBJECT_LOCALIZATION": 19 + } + } + } + }, + "Likelihood": { + "values": { + "UNKNOWN": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + }, + "ImageSource": { + "fields": { + "gcsImageUri": { + "type": "string", + "id": 1 + }, + "imageUri": { + "type": "string", + "id": 2 + } + } + }, + "Image": { + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "source": { + "type": "ImageSource", + "id": 2 + } + } + }, + "FaceAnnotation": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "fdBoundingPoly": { + "type": "BoundingPoly", + "id": 2 + }, + "landmarks": { + "rule": "repeated", + "type": "Landmark", + "id": 3 + }, + "rollAngle": { + "type": "float", + "id": 4 + }, + "panAngle": { + "type": "float", + "id": 5 + }, + "tiltAngle": { + "type": "float", + "id": 6 + }, + "detectionConfidence": { + "type": "float", + "id": 7 + }, + "landmarkingConfidence": { + "type": "float", + "id": 8 + }, + "joyLikelihood": { + "type": "Likelihood", + "id": 9 + }, + "sorrowLikelihood": { + "type": "Likelihood", + "id": 10 + }, + "angerLikelihood": { + "type": "Likelihood", + "id": 11 + }, + "surpriseLikelihood": { + "type": "Likelihood", + "id": 12 + }, + "underExposedLikelihood": { + "type": "Likelihood", + "id": 13 + }, + "blurredLikelihood": { + "type": "Likelihood", + "id": 14 + }, + "headwearLikelihood": { + "type": "Likelihood", + "id": 15 + } + }, + "nested": { + "Landmark": { + "fields": { + "type": { + "type": "Type", + "id": 3 + }, + "position": { + "type": "Position", + "id": 4 + } + }, + "nested": { + "Type": { + "values": { + "UNKNOWN_LANDMARK": 0, + "LEFT_EYE": 1, + "RIGHT_EYE": 2, + "LEFT_OF_LEFT_EYEBROW": 3, + "RIGHT_OF_LEFT_EYEBROW": 4, + "LEFT_OF_RIGHT_EYEBROW": 5, + "RIGHT_OF_RIGHT_EYEBROW": 6, + "MIDPOINT_BETWEEN_EYES": 7, + "NOSE_TIP": 8, + "UPPER_LIP": 9, + "LOWER_LIP": 10, + "MOUTH_LEFT": 11, + "MOUTH_RIGHT": 12, + "MOUTH_CENTER": 13, + "NOSE_BOTTOM_RIGHT": 14, + "NOSE_BOTTOM_LEFT": 15, + "NOSE_BOTTOM_CENTER": 16, + "LEFT_EYE_TOP_BOUNDARY": 17, + "LEFT_EYE_RIGHT_CORNER": 18, + "LEFT_EYE_BOTTOM_BOUNDARY": 19, + "LEFT_EYE_LEFT_CORNER": 20, + "RIGHT_EYE_TOP_BOUNDARY": 21, + "RIGHT_EYE_RIGHT_CORNER": 22, + "RIGHT_EYE_BOTTOM_BOUNDARY": 23, + "RIGHT_EYE_LEFT_CORNER": 24, + "LEFT_EYEBROW_UPPER_MIDPOINT": 25, + "RIGHT_EYEBROW_UPPER_MIDPOINT": 26, + "LEFT_EAR_TRAGION": 27, + "RIGHT_EAR_TRAGION": 28, + "LEFT_EYE_PUPIL": 29, + "RIGHT_EYE_PUPIL": 30, + "FOREHEAD_GLABELLA": 31, + "CHIN_GNATHION": 32, + "CHIN_LEFT_GONION": 33, + "CHIN_RIGHT_GONION": 34 + } + } + } + } + } + }, + "LocationInfo": { + "fields": { + "latLng": { + "type": "google.type.LatLng", + "id": 1 + } + } + }, + "Property": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + }, + "uint64Value": { + "type": "uint64", + "id": 3 + } + } + }, + "EntityAnnotation": { + "fields": { + "mid": { + "type": "string", + "id": 1 + }, + "locale": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "score": { + "type": "float", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5, + "options": { + "deprecated": true + } + }, + "topicality": { + "type": "float", + "id": 6 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 7 + }, + "locations": { + "rule": "repeated", + "type": "LocationInfo", + "id": 8 + }, + "properties": { + "rule": "repeated", + "type": "Property", + "id": 9 + } + } + }, + "LocalizedObjectAnnotation": { + "fields": { + "mid": { + "type": "string", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + }, + "score": { + "type": "float", + "id": 4 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 5 + } + } + }, + "SafeSearchAnnotation": { + "fields": { + "adult": { + "type": "Likelihood", + "id": 1 + }, + "spoof": { + "type": "Likelihood", + "id": 2 + }, + "medical": { + "type": "Likelihood", + "id": 3 + }, + "violence": { + "type": "Likelihood", + "id": 4 + }, + "racy": { + "type": "Likelihood", + "id": 9 + } + } + }, + "LatLongRect": { + "fields": { + "minLatLng": { + "type": "google.type.LatLng", + "id": 1 + }, + "maxLatLng": { + "type": "google.type.LatLng", + "id": 2 + } + } + }, + "ColorInfo": { + "fields": { + "color": { + "type": "google.type.Color", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "pixelFraction": { + "type": "float", + "id": 3 + } + } + }, + "DominantColorsAnnotation": { + "fields": { + "colors": { + "rule": "repeated", + "type": "ColorInfo", + "id": 1 + } + } + }, + "ImageProperties": { + "fields": { + "dominantColors": { + "type": "DominantColorsAnnotation", + "id": 1 + } + } + }, + "CropHint": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "importanceFraction": { + "type": "float", + "id": 3 + } + } + }, + "CropHintsAnnotation": { + "fields": { + "cropHints": { + "rule": "repeated", + "type": "CropHint", + "id": 1 + } + } + }, + "CropHintsParams": { + "fields": { + "aspectRatios": { + "rule": "repeated", + "type": "float", + "id": 1 + } + } + }, + "WebDetectionParams": { + "fields": { + "includeGeoResults": { + "type": "bool", + "id": 2 + } + } + }, + "ImageContext": { + "fields": { + "latLongRect": { + "type": "LatLongRect", + "id": 1 + }, + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "cropHintsParams": { + "type": "CropHintsParams", + "id": 4 + }, + "productSearchParams": { + "type": "ProductSearchParams", + "id": 5 + }, + "webDetectionParams": { + "type": "WebDetectionParams", + "id": 6 + } + } + }, + "AnnotateImageRequest": { + "fields": { + "image": { + "type": "Image", + "id": 1 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "imageContext": { + "type": "ImageContext", + "id": 3 + } + } + }, + "ImageAnnotationContext": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "pageNumber": { + "type": "int32", + "id": 2 + } + } + }, + "AnnotateImageResponse": { + "fields": { + "faceAnnotations": { + "rule": "repeated", + "type": "FaceAnnotation", + "id": 1 + }, + "landmarkAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 2 + }, + "logoAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 3 + }, + "labelAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 4 + }, + "localizedObjectAnnotations": { + "rule": "repeated", + "type": "LocalizedObjectAnnotation", + "id": 22 + }, + "textAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 5 + }, + "fullTextAnnotation": { + "type": "TextAnnotation", + "id": 12 + }, + "safeSearchAnnotation": { + "type": "SafeSearchAnnotation", + "id": 6 + }, + "imagePropertiesAnnotation": { + "type": "ImageProperties", + "id": 8 + }, + "cropHintsAnnotation": { + "type": "CropHintsAnnotation", + "id": 11 + }, + "webDetection": { + "type": "WebDetection", + "id": 13 + }, + "productSearchResults": { + "type": "ProductSearchResults", + "id": 14 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + }, + "context": { + "type": "ImageAnnotationContext", + "id": 21 + } + } + }, + "AnnotateFileResponse": { + "fields": { + "inputConfig": { + "type": "InputConfig", + "id": 1 + }, + "responses": { + "rule": "repeated", + "type": "AnnotateImageResponse", + "id": 2 + }, + "totalPages": { + "type": "int32", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + } + } + }, + "BatchAnnotateImagesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AnnotateImageRequest", + "id": 1 + }, + "parent": { + "type": "string", + "id": 4 + } + } + }, + "BatchAnnotateImagesResponse": { + "fields": { + "responses": { + "rule": "repeated", + "type": "AnnotateImageResponse", + "id": 1 + } + } + }, + "AnnotateFileRequest": { + "fields": { + "inputConfig": { + "type": "InputConfig", + "id": 1 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "imageContext": { + "type": "ImageContext", + "id": 3 + }, + "pages": { + "rule": "repeated", + "type": "int32", + "id": 4 + } + } + }, + "BatchAnnotateFilesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AnnotateFileRequest", + "id": 1 + }, + "parent": { + "type": "string", + "id": 3 + } + } + }, + "BatchAnnotateFilesResponse": { + "fields": { + "responses": { + "rule": "repeated", + "type": "AnnotateFileResponse", + "id": 1 + } + } + }, + "AsyncAnnotateFileRequest": { + "fields": { + "inputConfig": { + "type": "InputConfig", + "id": 1 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "imageContext": { + "type": "ImageContext", + "id": 3 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 4 + } + } + }, + "AsyncAnnotateFileResponse": { + "fields": { + "outputConfig": { + "type": "OutputConfig", + "id": 1 + } + } + }, + "AsyncBatchAnnotateImagesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AnnotateImageRequest", + "id": 1 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 2 + }, + "parent": { + "type": "string", + "id": 4 + } + } + }, + "AsyncBatchAnnotateImagesResponse": { + "fields": { + "outputConfig": { + "type": "OutputConfig", + "id": 1 + } + } + }, + "AsyncBatchAnnotateFilesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AsyncAnnotateFileRequest", + "id": 1 + }, + "parent": { + "type": "string", + "id": 4 + } + } + }, + "AsyncBatchAnnotateFilesResponse": { + "fields": { + "responses": { + "rule": "repeated", + "type": "AsyncAnnotateFileResponse", + "id": 1 + } + } + }, + "InputConfig": { + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "content": { + "type": "bytes", + "id": 3 + }, + "mimeType": { + "type": "string", + "id": 2 + } + } + }, + "OutputConfig": { + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "batchSize": { + "type": "int32", + "id": 2 + } + } + }, + "GcsSource": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "OperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATED": 1, + "RUNNING": 2, + "DONE": 3, + "CANCELLED": 4 + } + } + } + }, + "Vertex": { + "fields": { + "x": { + "type": "int32", + "id": 1 + }, + "y": { + "type": "int32", + "id": 2 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "Vertex", + "id": 1 + }, + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 2 + } + } + }, + "Position": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + }, + "z": { + "type": "float", + "id": 3 + } + } + }, + "ProductSearchParams": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 9 + }, + "productSet": { + "type": "string", + "id": 6 + }, + "productCategories": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "filter": { + "type": "string", + "id": 8 + } + } + }, + "ProductSearchResults": { + "fields": { + "indexTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "results": { + "rule": "repeated", + "type": "Result", + "id": 5 + }, + "productGroupedResults": { + "rule": "repeated", + "type": "GroupedResult", + "id": 6 + } + }, + "nested": { + "Result": { + "fields": { + "product": { + "type": "Product", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "image": { + "type": "string", + "id": 3 + } + } + }, + "ObjectAnnotation": { + "fields": { + "mid": { + "type": "string", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + }, + "score": { + "type": "float", + "id": 4 + } + } + }, + "GroupedResult": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "results": { + "rule": "repeated", + "type": "Result", + "id": 2 + }, + "objectAnnotations": { + "rule": "repeated", + "type": "ObjectAnnotation", + "id": 3 + } + } + } + } + }, + "ProductSearch": { + "options": { + "(google.api.default_host)": "vision.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-vision" + }, + "methods": { + "CreateProductSet": { + "requestType": "CreateProductSetRequest", + "responseType": "ProductSet", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/productSets", + "(google.api.http).body": "product_set" + } + }, + "ListProductSets": { + "requestType": "ListProductSetsRequest", + "responseType": "ListProductSetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/productSets" + } + }, + "GetProductSet": { + "requestType": "GetProductSetRequest", + "responseType": "ProductSet", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/productSets/*}" + } + }, + "UpdateProductSet": { + "requestType": "UpdateProductSetRequest", + "responseType": "ProductSet", + "options": { + "(google.api.http).patch": "/v1/{product_set.name=projects/*/locations/*/productSets/*}", + "(google.api.http).body": "product_set" + } + }, + "DeleteProductSet": { + "requestType": "DeleteProductSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/productSets/*}" + } + }, + "CreateProduct": { + "requestType": "CreateProductRequest", + "responseType": "Product", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/products", + "(google.api.http).body": "product" + } + }, + "ListProducts": { + "requestType": "ListProductsRequest", + "responseType": "ListProductsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/products" + } + }, + "GetProduct": { + "requestType": "GetProductRequest", + "responseType": "Product", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/products/*}" + } + }, + "UpdateProduct": { + "requestType": "UpdateProductRequest", + "responseType": "Product", + "options": { + "(google.api.http).patch": "/v1/{product.name=projects/*/locations/*/products/*}", + "(google.api.http).body": "product" + } + }, + "DeleteProduct": { + "requestType": "DeleteProductRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/products/*}" + } + }, + "CreateReferenceImage": { + "requestType": "CreateReferenceImageRequest", + "responseType": "ReferenceImage", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/products/*}/referenceImages", + "(google.api.http).body": "reference_image" + } + }, + "DeleteReferenceImage": { + "requestType": "DeleteReferenceImageRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/products/*/referenceImages/*}" + } + }, + "ListReferenceImages": { + "requestType": "ListReferenceImagesRequest", + "responseType": "ListReferenceImagesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/products/*}/referenceImages" + } + }, + "GetReferenceImage": { + "requestType": "GetReferenceImageRequest", + "responseType": "ReferenceImage", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/products/*/referenceImages/*}" + } + }, + "AddProductToProductSet": { + "requestType": "AddProductToProductSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/productSets/*}:addProduct", + "(google.api.http).body": "*" + } + }, + "RemoveProductFromProductSet": { + "requestType": "RemoveProductFromProductSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/productSets/*}:removeProduct", + "(google.api.http).body": "*" + } + }, + "ListProductsInProductSet": { + "requestType": "ListProductsInProductSetRequest", + "responseType": "ListProductsInProductSetResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/productSets/*}/products" + } + }, + "ImportProductSets": { + "requestType": "ImportProductSetsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/productSets:import", + "(google.api.http).body": "*" + } + }, + "PurgeProducts": { + "requestType": "PurgeProductsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/products:purge", + "(google.api.http).body": "*" + } + } + } + }, + "Product": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "productCategory": { + "type": "string", + "id": 4 + }, + "productLabels": { + "rule": "repeated", + "type": "KeyValue", + "id": 5 + } + }, + "nested": { + "KeyValue": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ProductSet": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "indexTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "indexError": { + "type": "google.rpc.Status", + "id": 4 + } + } + }, + "ReferenceImage": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "boundingPolys": { + "rule": "repeated", + "type": "BoundingPoly", + "id": 3 + } + } + }, + "CreateProductRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "product": { + "type": "Product", + "id": 2 + }, + "productId": { + "type": "string", + "id": 3 + } + } + }, + "ListProductsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProductsResponse": { + "fields": { + "products": { + "rule": "repeated", + "type": "Product", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetProductRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "UpdateProductRequest": { + "fields": { + "product": { + "type": "Product", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteProductRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "CreateProductSetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "productSet": { + "type": "ProductSet", + "id": 2 + }, + "productSetId": { + "type": "string", + "id": 3 + } + } + }, + "ListProductSetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProductSetsResponse": { + "fields": { + "productSets": { + "rule": "repeated", + "type": "ProductSet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "UpdateProductSetRequest": { + "fields": { + "productSet": { + "type": "ProductSet", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "CreateReferenceImageRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "referenceImage": { + "type": "ReferenceImage", + "id": 2 + }, + "referenceImageId": { + "type": "string", + "id": 3 + } + } + }, + "ListReferenceImagesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListReferenceImagesResponse": { + "fields": { + "referenceImages": { + "rule": "repeated", + "type": "ReferenceImage", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "GetReferenceImageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteReferenceImageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "AddProductToProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "product": { + "type": "string", + "id": 2 + } + } + }, + "RemoveProductFromProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "product": { + "type": "string", + "id": 2 + } + } + }, + "ListProductsInProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProductsInProductSetResponse": { + "fields": { + "products": { + "rule": "repeated", + "type": "Product", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ImportProductSetsGcsSource": { + "fields": { + "csvFileUri": { + "type": "string", + "id": 1 + } + } + }, + "ImportProductSetsInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "ImportProductSetsGcsSource", + "id": 1 + } + } + }, + "ImportProductSetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "inputConfig": { + "type": "ImportProductSetsInputConfig", + "id": 2 + } + } + }, + "ImportProductSetsResponse": { + "fields": { + "referenceImages": { + "rule": "repeated", + "type": "ReferenceImage", + "id": 1 + }, + "statuses": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + } + } + }, + "BatchOperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PROCESSING": 1, + "SUCCESSFUL": 2, + "FAILED": 3, + "CANCELLED": 4 + } + } + } + }, + "ProductSetPurgeConfig": { + "fields": { + "productSetId": { + "type": "string", + "id": 1 + } + } + }, + "PurgeProductsRequest": { + "oneofs": { + "target": { + "oneof": [ + "productSetPurgeConfig", + "deleteOrphanProducts" + ] + } + }, + "fields": { + "productSetPurgeConfig": { + "type": "ProductSetPurgeConfig", + "id": 2 + }, + "deleteOrphanProducts": { + "type": "bool", + "id": 3 + }, + "parent": { + "type": "string", + "id": 1 + }, + "force": { + "type": "bool", + "id": 4 + } + } + }, + "TextAnnotation": { + "fields": { + "pages": { + "rule": "repeated", + "type": "Page", + "id": 1 + }, + "text": { + "type": "string", + "id": 2 + } + }, + "nested": { + "DetectedLanguage": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "DetectedBreak": { + "fields": { + "type": { + "type": "BreakType", + "id": 1 + }, + "isPrefix": { + "type": "bool", + "id": 2 + } + }, + "nested": { + "BreakType": { + "values": { + "UNKNOWN": 0, + "SPACE": 1, + "SURE_SPACE": 2, + "EOL_SURE_SPACE": 3, + "HYPHEN": 4, + "LINE_BREAK": 5 + } + } + } + }, + "TextProperty": { + "fields": { + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 1 + }, + "detectedBreak": { + "type": "DetectedBreak", + "id": 2 + } + } + } + } + }, + "Page": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "width": { + "type": "int32", + "id": 2 + }, + "height": { + "type": "int32", + "id": 3 + }, + "blocks": { + "rule": "repeated", + "type": "Block", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + } + } + }, + "Block": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "paragraphs": { + "rule": "repeated", + "type": "Paragraph", + "id": 3 + }, + "blockType": { + "type": "BlockType", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + } + }, + "nested": { + "BlockType": { + "values": { + "UNKNOWN": 0, + "TEXT": 1, + "TABLE": 2, + "PICTURE": 3, + "RULER": 4, + "BARCODE": 5 + } + } + } + }, + "Paragraph": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "words": { + "rule": "repeated", + "type": "Word", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "Word": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "symbols": { + "rule": "repeated", + "type": "Symbol", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "Symbol": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "text": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "WebDetection": { + "fields": { + "webEntities": { + "rule": "repeated", + "type": "WebEntity", + "id": 1 + }, + "fullMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 2 + }, + "partialMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 3 + }, + "pagesWithMatchingImages": { + "rule": "repeated", + "type": "WebPage", + "id": 4 + }, + "visuallySimilarImages": { + "rule": "repeated", + "type": "WebImage", + "id": 6 + }, + "bestGuessLabels": { + "rule": "repeated", + "type": "WebLabel", + "id": 8 + } + }, + "nested": { + "WebEntity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + } + }, + "WebImage": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + } + } + }, + "WebPage": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "pageTitle": { + "type": "string", + "id": 3 + }, + "fullMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 4 + }, + "partialMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 5 + } + } + }, + "WebLabel": { + "fields": { + "label": { + "type": "string", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + } + } + } + } + }, + "v1p1beta1": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision", + "java_multiple_files": true, + "java_outer_classname": "WebDetectionProto", + "java_package": "com.google.cloud.vision.v1p1beta1" + }, + "nested": { + "ImageAnnotator": { + "methods": { + "BatchAnnotateImages": { + "requestType": "BatchAnnotateImagesRequest", + "responseType": "BatchAnnotateImagesResponse", + "options": { + "(google.api.http).post": "/v1p1beta1/images:annotate", + "(google.api.http).body": "*" + } + } + } + }, + "Feature": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "maxResults": { + "type": "int32", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "FACE_DETECTION": 1, + "LANDMARK_DETECTION": 2, + "LOGO_DETECTION": 3, + "LABEL_DETECTION": 4, + "TEXT_DETECTION": 5, + "DOCUMENT_TEXT_DETECTION": 11, + "SAFE_SEARCH_DETECTION": 6, + "IMAGE_PROPERTIES": 7, + "CROP_HINTS": 9, + "WEB_DETECTION": 10 + } + } + } + }, + "ImageSource": { + "fields": { + "gcsImageUri": { + "type": "string", + "id": 1 + }, + "imageUri": { + "type": "string", + "id": 2 + } + } + }, + "Image": { + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "source": { + "type": "ImageSource", + "id": 2 + } + } + }, + "FaceAnnotation": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "fdBoundingPoly": { + "type": "BoundingPoly", + "id": 2 + }, + "landmarks": { + "rule": "repeated", + "type": "Landmark", + "id": 3 + }, + "rollAngle": { + "type": "float", + "id": 4 + }, + "panAngle": { + "type": "float", + "id": 5 + }, + "tiltAngle": { + "type": "float", + "id": 6 + }, + "detectionConfidence": { + "type": "float", + "id": 7 + }, + "landmarkingConfidence": { + "type": "float", + "id": 8 + }, + "joyLikelihood": { + "type": "Likelihood", + "id": 9 + }, + "sorrowLikelihood": { + "type": "Likelihood", + "id": 10 + }, + "angerLikelihood": { + "type": "Likelihood", + "id": 11 + }, + "surpriseLikelihood": { + "type": "Likelihood", + "id": 12 + }, + "underExposedLikelihood": { + "type": "Likelihood", + "id": 13 + }, + "blurredLikelihood": { + "type": "Likelihood", + "id": 14 + }, + "headwearLikelihood": { + "type": "Likelihood", + "id": 15 + } + }, + "nested": { + "Landmark": { + "fields": { + "type": { + "type": "Type", + "id": 3 + }, + "position": { + "type": "Position", + "id": 4 + } + }, + "nested": { + "Type": { + "values": { + "UNKNOWN_LANDMARK": 0, + "LEFT_EYE": 1, + "RIGHT_EYE": 2, + "LEFT_OF_LEFT_EYEBROW": 3, + "RIGHT_OF_LEFT_EYEBROW": 4, + "LEFT_OF_RIGHT_EYEBROW": 5, + "RIGHT_OF_RIGHT_EYEBROW": 6, + "MIDPOINT_BETWEEN_EYES": 7, + "NOSE_TIP": 8, + "UPPER_LIP": 9, + "LOWER_LIP": 10, + "MOUTH_LEFT": 11, + "MOUTH_RIGHT": 12, + "MOUTH_CENTER": 13, + "NOSE_BOTTOM_RIGHT": 14, + "NOSE_BOTTOM_LEFT": 15, + "NOSE_BOTTOM_CENTER": 16, + "LEFT_EYE_TOP_BOUNDARY": 17, + "LEFT_EYE_RIGHT_CORNER": 18, + "LEFT_EYE_BOTTOM_BOUNDARY": 19, + "LEFT_EYE_LEFT_CORNER": 20, + "RIGHT_EYE_TOP_BOUNDARY": 21, + "RIGHT_EYE_RIGHT_CORNER": 22, + "RIGHT_EYE_BOTTOM_BOUNDARY": 23, + "RIGHT_EYE_LEFT_CORNER": 24, + "LEFT_EYEBROW_UPPER_MIDPOINT": 25, + "RIGHT_EYEBROW_UPPER_MIDPOINT": 26, + "LEFT_EAR_TRAGION": 27, + "RIGHT_EAR_TRAGION": 28, + "LEFT_EYE_PUPIL": 29, + "RIGHT_EYE_PUPIL": 30, + "FOREHEAD_GLABELLA": 31, + "CHIN_GNATHION": 32, + "CHIN_LEFT_GONION": 33, + "CHIN_RIGHT_GONION": 34 + } + } + } + } + } + }, + "LocationInfo": { + "fields": { + "latLng": { + "type": "google.type.LatLng", + "id": 1 + } + } + }, + "Property": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + }, + "uint64Value": { + "type": "uint64", + "id": 3 + } + } + }, + "EntityAnnotation": { + "fields": { + "mid": { + "type": "string", + "id": 1 + }, + "locale": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "score": { + "type": "float", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + }, + "topicality": { + "type": "float", + "id": 6 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 7 + }, + "locations": { + "rule": "repeated", + "type": "LocationInfo", + "id": 8 + }, + "properties": { + "rule": "repeated", + "type": "Property", + "id": 9 + } + } + }, + "SafeSearchAnnotation": { + "fields": { + "adult": { + "type": "Likelihood", + "id": 1 + }, + "spoof": { + "type": "Likelihood", + "id": 2 + }, + "medical": { + "type": "Likelihood", + "id": 3 + }, + "violence": { + "type": "Likelihood", + "id": 4 + }, + "racy": { + "type": "Likelihood", + "id": 9 + } + } + }, + "LatLongRect": { + "fields": { + "minLatLng": { + "type": "google.type.LatLng", + "id": 1 + }, + "maxLatLng": { + "type": "google.type.LatLng", + "id": 2 + } + } + }, + "ColorInfo": { + "fields": { + "color": { + "type": "google.type.Color", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "pixelFraction": { + "type": "float", + "id": 3 + } + } + }, + "DominantColorsAnnotation": { + "fields": { + "colors": { + "rule": "repeated", + "type": "ColorInfo", + "id": 1 + } + } + }, + "ImageProperties": { + "fields": { + "dominantColors": { + "type": "DominantColorsAnnotation", + "id": 1 + } + } + }, + "CropHint": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "importanceFraction": { + "type": "float", + "id": 3 + } + } + }, + "CropHintsAnnotation": { + "fields": { + "cropHints": { + "rule": "repeated", + "type": "CropHint", + "id": 1 + } + } + }, + "CropHintsParams": { + "fields": { + "aspectRatios": { + "rule": "repeated", + "type": "float", + "id": 1 + } + } + }, + "WebDetectionParams": { + "fields": { + "includeGeoResults": { + "type": "bool", + "id": 2 + } + } + }, + "ImageContext": { + "fields": { + "latLongRect": { + "type": "LatLongRect", + "id": 1 + }, + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "cropHintsParams": { + "type": "CropHintsParams", + "id": 4 + }, + "webDetectionParams": { + "type": "WebDetectionParams", + "id": 6 + } + } + }, + "AnnotateImageRequest": { + "fields": { + "image": { + "type": "Image", + "id": 1 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "imageContext": { + "type": "ImageContext", + "id": 3 + } + } + }, + "AnnotateImageResponse": { + "fields": { + "faceAnnotations": { + "rule": "repeated", + "type": "FaceAnnotation", + "id": 1 + }, + "landmarkAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 2 + }, + "logoAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 3 + }, + "labelAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 4 + }, + "textAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 5 + }, + "fullTextAnnotation": { + "type": "TextAnnotation", + "id": 12 + }, + "safeSearchAnnotation": { + "type": "SafeSearchAnnotation", + "id": 6 + }, + "imagePropertiesAnnotation": { + "type": "ImageProperties", + "id": 8 + }, + "cropHintsAnnotation": { + "type": "CropHintsAnnotation", + "id": 11 + }, + "webDetection": { + "type": "WebDetection", + "id": 13 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + } + } + }, + "BatchAnnotateImagesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AnnotateImageRequest", + "id": 1 + } + } + }, + "BatchAnnotateImagesResponse": { + "fields": { + "responses": { + "rule": "repeated", + "type": "AnnotateImageResponse", + "id": 1 + } + } + }, + "Likelihood": { + "values": { + "UNKNOWN": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + }, + "Vertex": { + "fields": { + "x": { + "type": "int32", + "id": 1 + }, + "y": { + "type": "int32", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "Vertex", + "id": 1 + } + } + }, + "Position": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + }, + "z": { + "type": "float", + "id": 3 + } + } + }, + "TextAnnotation": { + "fields": { + "pages": { + "rule": "repeated", + "type": "Page", + "id": 1 + }, + "text": { + "type": "string", + "id": 2 + } + }, + "nested": { + "DetectedLanguage": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "DetectedBreak": { + "fields": { + "type": { + "type": "BreakType", + "id": 1 + }, + "isPrefix": { + "type": "bool", + "id": 2 + } + }, + "nested": { + "BreakType": { + "values": { + "UNKNOWN": 0, + "SPACE": 1, + "SURE_SPACE": 2, + "EOL_SURE_SPACE": 3, + "HYPHEN": 4, + "LINE_BREAK": 5 + } + } + } + }, + "TextProperty": { + "fields": { + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 1 + }, + "detectedBreak": { + "type": "DetectedBreak", + "id": 2 + } + } + } + } + }, + "Page": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "width": { + "type": "int32", + "id": 2 + }, + "height": { + "type": "int32", + "id": 3 + }, + "blocks": { + "rule": "repeated", + "type": "Block", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + } + } + }, + "Block": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "paragraphs": { + "rule": "repeated", + "type": "Paragraph", + "id": 3 + }, + "blockType": { + "type": "BlockType", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + } + }, + "nested": { + "BlockType": { + "values": { + "UNKNOWN": 0, + "TEXT": 1, + "TABLE": 2, + "PICTURE": 3, + "RULER": 4, + "BARCODE": 5 + } + } + } + }, + "Paragraph": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "words": { + "rule": "repeated", + "type": "Word", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "Word": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "symbols": { + "rule": "repeated", + "type": "Symbol", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "Symbol": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "text": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "WebDetection": { + "fields": { + "webEntities": { + "rule": "repeated", + "type": "WebEntity", + "id": 1 + }, + "fullMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 2 + }, + "partialMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 3 + }, + "pagesWithMatchingImages": { + "rule": "repeated", + "type": "WebPage", + "id": 4 + }, + "visuallySimilarImages": { + "rule": "repeated", + "type": "WebImage", + "id": 6 + }, + "bestGuessLabels": { + "rule": "repeated", + "type": "WebLabel", + "id": 8 + } + }, + "nested": { + "WebEntity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + } + }, + "WebImage": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + } + } + }, + "WebPage": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "pageTitle": { + "type": "string", + "id": 3 + }, + "fullMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 4 + }, + "partialMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 5 + } + } + }, + "WebLabel": { + "fields": { + "label": { + "type": "string", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + } + } + } + } + }, + "v1p2beta1": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision", + "java_multiple_files": true, + "java_outer_classname": "WebDetectionProto", + "java_package": "com.google.cloud.vision.v1p2beta1" + }, + "nested": { + "ImageAnnotator": { + "methods": { + "BatchAnnotateImages": { + "requestType": "BatchAnnotateImagesRequest", + "responseType": "BatchAnnotateImagesResponse", + "options": { + "(google.api.http).post": "/v1p2beta1/images:annotate", + "(google.api.http).body": "*" + } + }, + "AsyncBatchAnnotateFiles": { + "requestType": "AsyncBatchAnnotateFilesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p2beta1/files:asyncBatchAnnotate", + "(google.api.http).body": "*" + } + } + } + }, + "Feature": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "maxResults": { + "type": "int32", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "FACE_DETECTION": 1, + "LANDMARK_DETECTION": 2, + "LOGO_DETECTION": 3, + "LABEL_DETECTION": 4, + "TEXT_DETECTION": 5, + "DOCUMENT_TEXT_DETECTION": 11, + "SAFE_SEARCH_DETECTION": 6, + "IMAGE_PROPERTIES": 7, + "CROP_HINTS": 9, + "WEB_DETECTION": 10 + } + } + } + }, + "ImageSource": { + "fields": { + "gcsImageUri": { + "type": "string", + "id": 1 + }, + "imageUri": { + "type": "string", + "id": 2 + } + } + }, + "Image": { + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "source": { + "type": "ImageSource", + "id": 2 + } + } + }, + "FaceAnnotation": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "fdBoundingPoly": { + "type": "BoundingPoly", + "id": 2 + }, + "landmarks": { + "rule": "repeated", + "type": "Landmark", + "id": 3 + }, + "rollAngle": { + "type": "float", + "id": 4 + }, + "panAngle": { + "type": "float", + "id": 5 + }, + "tiltAngle": { + "type": "float", + "id": 6 + }, + "detectionConfidence": { + "type": "float", + "id": 7 + }, + "landmarkingConfidence": { + "type": "float", + "id": 8 + }, + "joyLikelihood": { + "type": "Likelihood", + "id": 9 + }, + "sorrowLikelihood": { + "type": "Likelihood", + "id": 10 + }, + "angerLikelihood": { + "type": "Likelihood", + "id": 11 + }, + "surpriseLikelihood": { + "type": "Likelihood", + "id": 12 + }, + "underExposedLikelihood": { + "type": "Likelihood", + "id": 13 + }, + "blurredLikelihood": { + "type": "Likelihood", + "id": 14 + }, + "headwearLikelihood": { + "type": "Likelihood", + "id": 15 + } + }, + "nested": { + "Landmark": { + "fields": { + "type": { + "type": "Type", + "id": 3 + }, + "position": { + "type": "Position", + "id": 4 + } + }, + "nested": { + "Type": { + "values": { + "UNKNOWN_LANDMARK": 0, + "LEFT_EYE": 1, + "RIGHT_EYE": 2, + "LEFT_OF_LEFT_EYEBROW": 3, + "RIGHT_OF_LEFT_EYEBROW": 4, + "LEFT_OF_RIGHT_EYEBROW": 5, + "RIGHT_OF_RIGHT_EYEBROW": 6, + "MIDPOINT_BETWEEN_EYES": 7, + "NOSE_TIP": 8, + "UPPER_LIP": 9, + "LOWER_LIP": 10, + "MOUTH_LEFT": 11, + "MOUTH_RIGHT": 12, + "MOUTH_CENTER": 13, + "NOSE_BOTTOM_RIGHT": 14, + "NOSE_BOTTOM_LEFT": 15, + "NOSE_BOTTOM_CENTER": 16, + "LEFT_EYE_TOP_BOUNDARY": 17, + "LEFT_EYE_RIGHT_CORNER": 18, + "LEFT_EYE_BOTTOM_BOUNDARY": 19, + "LEFT_EYE_LEFT_CORNER": 20, + "RIGHT_EYE_TOP_BOUNDARY": 21, + "RIGHT_EYE_RIGHT_CORNER": 22, + "RIGHT_EYE_BOTTOM_BOUNDARY": 23, + "RIGHT_EYE_LEFT_CORNER": 24, + "LEFT_EYEBROW_UPPER_MIDPOINT": 25, + "RIGHT_EYEBROW_UPPER_MIDPOINT": 26, + "LEFT_EAR_TRAGION": 27, + "RIGHT_EAR_TRAGION": 28, + "LEFT_EYE_PUPIL": 29, + "RIGHT_EYE_PUPIL": 30, + "FOREHEAD_GLABELLA": 31, + "CHIN_GNATHION": 32, + "CHIN_LEFT_GONION": 33, + "CHIN_RIGHT_GONION": 34 + } + } + } + } + } + }, + "LocationInfo": { + "fields": { + "latLng": { + "type": "google.type.LatLng", + "id": 1 + } + } + }, + "Property": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + }, + "uint64Value": { + "type": "uint64", + "id": 3 + } + } + }, + "EntityAnnotation": { + "fields": { + "mid": { + "type": "string", + "id": 1 + }, + "locale": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "score": { + "type": "float", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + }, + "topicality": { + "type": "float", + "id": 6 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 7 + }, + "locations": { + "rule": "repeated", + "type": "LocationInfo", + "id": 8 + }, + "properties": { + "rule": "repeated", + "type": "Property", + "id": 9 + } + } + }, + "SafeSearchAnnotation": { + "fields": { + "adult": { + "type": "Likelihood", + "id": 1 + }, + "spoof": { + "type": "Likelihood", + "id": 2 + }, + "medical": { + "type": "Likelihood", + "id": 3 + }, + "violence": { + "type": "Likelihood", + "id": 4 + }, + "racy": { + "type": "Likelihood", + "id": 9 + } + } + }, + "LatLongRect": { + "fields": { + "minLatLng": { + "type": "google.type.LatLng", + "id": 1 + }, + "maxLatLng": { + "type": "google.type.LatLng", + "id": 2 + } + } + }, + "ColorInfo": { + "fields": { + "color": { + "type": "google.type.Color", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "pixelFraction": { + "type": "float", + "id": 3 + } + } + }, + "DominantColorsAnnotation": { + "fields": { + "colors": { + "rule": "repeated", + "type": "ColorInfo", + "id": 1 + } + } + }, + "ImageProperties": { + "fields": { + "dominantColors": { + "type": "DominantColorsAnnotation", + "id": 1 + } + } + }, + "CropHint": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "importanceFraction": { + "type": "float", + "id": 3 + } + } + }, + "CropHintsAnnotation": { + "fields": { + "cropHints": { + "rule": "repeated", + "type": "CropHint", + "id": 1 + } + } + }, + "CropHintsParams": { + "fields": { + "aspectRatios": { + "rule": "repeated", + "type": "float", + "id": 1 + } + } + }, + "WebDetectionParams": { + "fields": { + "includeGeoResults": { + "type": "bool", + "id": 2 + } + } + }, + "ImageContext": { + "fields": { + "latLongRect": { + "type": "LatLongRect", + "id": 1 + }, + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "cropHintsParams": { + "type": "CropHintsParams", + "id": 4 + }, + "webDetectionParams": { + "type": "WebDetectionParams", + "id": 6 + } + } + }, + "AnnotateImageRequest": { + "fields": { + "image": { + "type": "Image", + "id": 1 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "imageContext": { + "type": "ImageContext", + "id": 3 + } + } + }, + "ImageAnnotationContext": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "pageNumber": { + "type": "int32", + "id": 2 + } + } + }, + "AnnotateImageResponse": { + "fields": { + "faceAnnotations": { + "rule": "repeated", + "type": "FaceAnnotation", + "id": 1 + }, + "landmarkAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 2 + }, + "logoAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 3 + }, + "labelAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 4 + }, + "textAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 5 + }, + "fullTextAnnotation": { + "type": "TextAnnotation", + "id": 12 + }, + "safeSearchAnnotation": { + "type": "SafeSearchAnnotation", + "id": 6 + }, + "imagePropertiesAnnotation": { + "type": "ImageProperties", + "id": 8 + }, + "cropHintsAnnotation": { + "type": "CropHintsAnnotation", + "id": 11 + }, + "webDetection": { + "type": "WebDetection", + "id": 13 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + }, + "context": { + "type": "ImageAnnotationContext", + "id": 21 + } + } + }, + "AnnotateFileResponse": { + "fields": { + "inputConfig": { + "type": "InputConfig", + "id": 1 + }, + "responses": { + "rule": "repeated", + "type": "AnnotateImageResponse", + "id": 2 + } + } + }, + "BatchAnnotateImagesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AnnotateImageRequest", + "id": 1 + } + } + }, + "BatchAnnotateImagesResponse": { + "fields": { + "responses": { + "rule": "repeated", + "type": "AnnotateImageResponse", + "id": 1 + } + } + }, + "AsyncAnnotateFileRequest": { + "fields": { + "inputConfig": { + "type": "InputConfig", + "id": 1 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "imageContext": { + "type": "ImageContext", + "id": 3 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 4 + } + } + }, + "AsyncAnnotateFileResponse": { + "fields": { + "outputConfig": { + "type": "OutputConfig", + "id": 1 + } + } + }, + "AsyncBatchAnnotateFilesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AsyncAnnotateFileRequest", + "id": 1 + } + } + }, + "AsyncBatchAnnotateFilesResponse": { + "fields": { + "responses": { + "rule": "repeated", + "type": "AsyncAnnotateFileResponse", + "id": 1 + } + } + }, + "InputConfig": { + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + } + } + }, + "OutputConfig": { + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "batchSize": { + "type": "int32", + "id": 2 + } + } + }, + "GcsSource": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "OperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATED": 1, + "RUNNING": 2, + "DONE": 3, + "CANCELLED": 4 + } + } + } + }, + "Likelihood": { + "values": { + "UNKNOWN": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + }, + "Vertex": { + "fields": { + "x": { + "type": "int32", + "id": 1 + }, + "y": { + "type": "int32", + "id": 2 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "Vertex", + "id": 1 + }, + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 2 + } + } + }, + "Position": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + }, + "z": { + "type": "float", + "id": 3 + } + } + }, + "TextAnnotation": { + "fields": { + "pages": { + "rule": "repeated", + "type": "Page", + "id": 1 + }, + "text": { + "type": "string", + "id": 2 + } + }, + "nested": { + "DetectedLanguage": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "DetectedBreak": { + "fields": { + "type": { + "type": "BreakType", + "id": 1 + }, + "isPrefix": { + "type": "bool", + "id": 2 + } + }, + "nested": { + "BreakType": { + "values": { + "UNKNOWN": 0, + "SPACE": 1, + "SURE_SPACE": 2, + "EOL_SURE_SPACE": 3, + "HYPHEN": 4, + "LINE_BREAK": 5 + } + } + } + }, + "TextProperty": { + "fields": { + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 1 + }, + "detectedBreak": { + "type": "DetectedBreak", + "id": 2 + } + } + } + } + }, + "Page": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "width": { + "type": "int32", + "id": 2 + }, + "height": { + "type": "int32", + "id": 3 + }, + "blocks": { + "rule": "repeated", + "type": "Block", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + } + } + }, + "Block": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "paragraphs": { + "rule": "repeated", + "type": "Paragraph", + "id": 3 + }, + "blockType": { + "type": "BlockType", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + } + }, + "nested": { + "BlockType": { + "values": { + "UNKNOWN": 0, + "TEXT": 1, + "TABLE": 2, + "PICTURE": 3, + "RULER": 4, + "BARCODE": 5 + } + } + } + }, + "Paragraph": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "words": { + "rule": "repeated", + "type": "Word", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "Word": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "symbols": { + "rule": "repeated", + "type": "Symbol", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "Symbol": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "text": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "WebDetection": { + "fields": { + "webEntities": { + "rule": "repeated", + "type": "WebEntity", + "id": 1 + }, + "fullMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 2 + }, + "partialMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 3 + }, + "pagesWithMatchingImages": { + "rule": "repeated", + "type": "WebPage", + "id": 4 + }, + "visuallySimilarImages": { + "rule": "repeated", + "type": "WebImage", + "id": 6 + }, + "bestGuessLabels": { + "rule": "repeated", + "type": "WebLabel", + "id": 8 + } + }, + "nested": { + "WebEntity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + } + }, + "WebImage": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + } + } + }, + "WebPage": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "pageTitle": { + "type": "string", + "id": 3 + }, + "fullMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 4 + }, + "partialMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 5 + } + } + }, + "WebLabel": { + "fields": { + "label": { + "type": "string", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + } + } + } + } + }, + "v1p3beta1": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision", + "java_multiple_files": true, + "java_outer_classname": "WebDetectionProto", + "java_package": "com.google.cloud.vision.v1p3beta1" + }, + "nested": { + "ImageAnnotator": { + "methods": { + "BatchAnnotateImages": { + "requestType": "BatchAnnotateImagesRequest", + "responseType": "BatchAnnotateImagesResponse", + "options": { + "(google.api.http).post": "/v1p3beta1/images:annotate", + "(google.api.http).body": "*" + } + }, + "AsyncBatchAnnotateFiles": { + "requestType": "AsyncBatchAnnotateFilesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p3beta1/files:asyncBatchAnnotate", + "(google.api.http).body": "*" + } + } + } + }, + "Feature": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "maxResults": { + "type": "int32", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "FACE_DETECTION": 1, + "LANDMARK_DETECTION": 2, + "LOGO_DETECTION": 3, + "LABEL_DETECTION": 4, + "TEXT_DETECTION": 5, + "DOCUMENT_TEXT_DETECTION": 11, + "SAFE_SEARCH_DETECTION": 6, + "IMAGE_PROPERTIES": 7, + "CROP_HINTS": 9, + "WEB_DETECTION": 10, + "PRODUCT_SEARCH": 12, + "OBJECT_LOCALIZATION": 19 + } + } + } + }, + "ImageSource": { + "fields": { + "gcsImageUri": { + "type": "string", + "id": 1 + }, + "imageUri": { + "type": "string", + "id": 2 + } + } + }, + "Image": { + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "source": { + "type": "ImageSource", + "id": 2 + } + } + }, + "FaceAnnotation": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "fdBoundingPoly": { + "type": "BoundingPoly", + "id": 2 + }, + "landmarks": { + "rule": "repeated", + "type": "Landmark", + "id": 3 + }, + "rollAngle": { + "type": "float", + "id": 4 + }, + "panAngle": { + "type": "float", + "id": 5 + }, + "tiltAngle": { + "type": "float", + "id": 6 + }, + "detectionConfidence": { + "type": "float", + "id": 7 + }, + "landmarkingConfidence": { + "type": "float", + "id": 8 + }, + "joyLikelihood": { + "type": "Likelihood", + "id": 9 + }, + "sorrowLikelihood": { + "type": "Likelihood", + "id": 10 + }, + "angerLikelihood": { + "type": "Likelihood", + "id": 11 + }, + "surpriseLikelihood": { + "type": "Likelihood", + "id": 12 + }, + "underExposedLikelihood": { + "type": "Likelihood", + "id": 13 + }, + "blurredLikelihood": { + "type": "Likelihood", + "id": 14 + }, + "headwearLikelihood": { + "type": "Likelihood", + "id": 15 + } + }, + "nested": { + "Landmark": { + "fields": { + "type": { + "type": "Type", + "id": 3 + }, + "position": { + "type": "Position", + "id": 4 + } + }, + "nested": { + "Type": { + "values": { + "UNKNOWN_LANDMARK": 0, + "LEFT_EYE": 1, + "RIGHT_EYE": 2, + "LEFT_OF_LEFT_EYEBROW": 3, + "RIGHT_OF_LEFT_EYEBROW": 4, + "LEFT_OF_RIGHT_EYEBROW": 5, + "RIGHT_OF_RIGHT_EYEBROW": 6, + "MIDPOINT_BETWEEN_EYES": 7, + "NOSE_TIP": 8, + "UPPER_LIP": 9, + "LOWER_LIP": 10, + "MOUTH_LEFT": 11, + "MOUTH_RIGHT": 12, + "MOUTH_CENTER": 13, + "NOSE_BOTTOM_RIGHT": 14, + "NOSE_BOTTOM_LEFT": 15, + "NOSE_BOTTOM_CENTER": 16, + "LEFT_EYE_TOP_BOUNDARY": 17, + "LEFT_EYE_RIGHT_CORNER": 18, + "LEFT_EYE_BOTTOM_BOUNDARY": 19, + "LEFT_EYE_LEFT_CORNER": 20, + "RIGHT_EYE_TOP_BOUNDARY": 21, + "RIGHT_EYE_RIGHT_CORNER": 22, + "RIGHT_EYE_BOTTOM_BOUNDARY": 23, + "RIGHT_EYE_LEFT_CORNER": 24, + "LEFT_EYEBROW_UPPER_MIDPOINT": 25, + "RIGHT_EYEBROW_UPPER_MIDPOINT": 26, + "LEFT_EAR_TRAGION": 27, + "RIGHT_EAR_TRAGION": 28, + "LEFT_EYE_PUPIL": 29, + "RIGHT_EYE_PUPIL": 30, + "FOREHEAD_GLABELLA": 31, + "CHIN_GNATHION": 32, + "CHIN_LEFT_GONION": 33, + "CHIN_RIGHT_GONION": 34 + } + } + } + } + } + }, + "LocationInfo": { + "fields": { + "latLng": { + "type": "google.type.LatLng", + "id": 1 + } + } + }, + "Property": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + }, + "uint64Value": { + "type": "uint64", + "id": 3 + } + } + }, + "EntityAnnotation": { + "fields": { + "mid": { + "type": "string", + "id": 1 + }, + "locale": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "score": { + "type": "float", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + }, + "topicality": { + "type": "float", + "id": 6 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 7 + }, + "locations": { + "rule": "repeated", + "type": "LocationInfo", + "id": 8 + }, + "properties": { + "rule": "repeated", + "type": "Property", + "id": 9 + } + } + }, + "LocalizedObjectAnnotation": { + "fields": { + "mid": { + "type": "string", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + }, + "score": { + "type": "float", + "id": 4 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 5 + } + } + }, + "SafeSearchAnnotation": { + "fields": { + "adult": { + "type": "Likelihood", + "id": 1 + }, + "spoof": { + "type": "Likelihood", + "id": 2 + }, + "medical": { + "type": "Likelihood", + "id": 3 + }, + "violence": { + "type": "Likelihood", + "id": 4 + }, + "racy": { + "type": "Likelihood", + "id": 9 + } + } + }, + "LatLongRect": { + "fields": { + "minLatLng": { + "type": "google.type.LatLng", + "id": 1 + }, + "maxLatLng": { + "type": "google.type.LatLng", + "id": 2 + } + } + }, + "ColorInfo": { + "fields": { + "color": { + "type": "google.type.Color", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "pixelFraction": { + "type": "float", + "id": 3 + } + } + }, + "DominantColorsAnnotation": { + "fields": { + "colors": { + "rule": "repeated", + "type": "ColorInfo", + "id": 1 + } + } + }, + "ImageProperties": { + "fields": { + "dominantColors": { + "type": "DominantColorsAnnotation", + "id": 1 + } + } + }, + "CropHint": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "importanceFraction": { + "type": "float", + "id": 3 + } + } + }, + "CropHintsAnnotation": { + "fields": { + "cropHints": { + "rule": "repeated", + "type": "CropHint", + "id": 1 + } + } + }, + "CropHintsParams": { + "fields": { + "aspectRatios": { + "rule": "repeated", + "type": "float", + "id": 1 + } + } + }, + "WebDetectionParams": { + "fields": { + "includeGeoResults": { + "type": "bool", + "id": 2 + } + } + }, + "ImageContext": { + "fields": { + "latLongRect": { + "type": "LatLongRect", + "id": 1 + }, + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "cropHintsParams": { + "type": "CropHintsParams", + "id": 4 + }, + "productSearchParams": { + "type": "google.cloud.vision.v1p3beta1.ProductSearchParams", + "id": 5 + }, + "webDetectionParams": { + "type": "WebDetectionParams", + "id": 6 + } + } + }, + "AnnotateImageRequest": { + "fields": { + "image": { + "type": "Image", + "id": 1 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "imageContext": { + "type": "ImageContext", + "id": 3 + } + } + }, + "ImageAnnotationContext": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "pageNumber": { + "type": "int32", + "id": 2 + } + } + }, + "AnnotateImageResponse": { + "fields": { + "faceAnnotations": { + "rule": "repeated", + "type": "FaceAnnotation", + "id": 1 + }, + "landmarkAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 2 + }, + "logoAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 3 + }, + "labelAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 4 + }, + "localizedObjectAnnotations": { + "rule": "repeated", + "type": "LocalizedObjectAnnotation", + "id": 22 + }, + "textAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 5 + }, + "fullTextAnnotation": { + "type": "TextAnnotation", + "id": 12 + }, + "safeSearchAnnotation": { + "type": "SafeSearchAnnotation", + "id": 6 + }, + "imagePropertiesAnnotation": { + "type": "ImageProperties", + "id": 8 + }, + "cropHintsAnnotation": { + "type": "CropHintsAnnotation", + "id": 11 + }, + "webDetection": { + "type": "WebDetection", + "id": 13 + }, + "productSearchResults": { + "type": "google.cloud.vision.v1p3beta1.ProductSearchResults", + "id": 14 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + }, + "context": { + "type": "ImageAnnotationContext", + "id": 21 + } + } + }, + "AnnotateFileResponse": { + "fields": { + "inputConfig": { + "type": "InputConfig", + "id": 1 + }, + "responses": { + "rule": "repeated", + "type": "AnnotateImageResponse", + "id": 2 + } + } + }, + "BatchAnnotateImagesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AnnotateImageRequest", + "id": 1 + } + } + }, + "BatchAnnotateImagesResponse": { + "fields": { + "responses": { + "rule": "repeated", + "type": "AnnotateImageResponse", + "id": 1 + } + } + }, + "AsyncAnnotateFileRequest": { + "fields": { + "inputConfig": { + "type": "InputConfig", + "id": 1 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "imageContext": { + "type": "ImageContext", + "id": 3 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 4 + } + } + }, + "AsyncAnnotateFileResponse": { + "fields": { + "outputConfig": { + "type": "OutputConfig", + "id": 1 + } + } + }, + "AsyncBatchAnnotateFilesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AsyncAnnotateFileRequest", + "id": 1 + } + } + }, + "AsyncBatchAnnotateFilesResponse": { + "fields": { + "responses": { + "rule": "repeated", + "type": "AsyncAnnotateFileResponse", + "id": 1 + } + } + }, + "InputConfig": { + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + } + } + }, + "OutputConfig": { + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "batchSize": { + "type": "int32", + "id": 2 + } + } + }, + "GcsSource": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "Likelihood": { + "values": { + "UNKNOWN": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + }, + "OperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATED": 1, + "RUNNING": 2, + "DONE": 3, + "CANCELLED": 4 + } + } + } + }, + "Vertex": { + "fields": { + "x": { + "type": "int32", + "id": 1 + }, + "y": { + "type": "int32", + "id": 2 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "Vertex", + "id": 1 + }, + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 2 + } + } + }, + "NormalizedBoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 1 + } + } + }, + "Position": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + }, + "z": { + "type": "float", + "id": 3 + } + } + }, + "ProductSearchParams": { + "fields": { + "catalogName": { + "type": "string", + "id": 1 + }, + "category": { + "type": "ProductSearchCategory", + "id": 2 + }, + "productCategory": { + "type": "string", + "id": 5 + }, + "normalizedBoundingPoly": { + "type": "NormalizedBoundingPoly", + "id": 3 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 9 + }, + "view": { + "type": "ProductSearchResultsView", + "id": 4 + }, + "productSet": { + "type": "string", + "id": 6 + }, + "productCategories": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "filter": { + "type": "string", + "id": 8 + } + } + }, + "ProductSearchResults": { + "fields": { + "category": { + "type": "ProductSearchCategory", + "id": 1 + }, + "productCategory": { + "type": "string", + "id": 4 + }, + "indexTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "products": { + "rule": "repeated", + "type": "ProductInfo", + "id": 3 + }, + "results": { + "rule": "repeated", + "type": "Result", + "id": 5 + } + }, + "nested": { + "ProductInfo": { + "fields": { + "productId": { + "type": "string", + "id": 1 + }, + "imageUri": { + "type": "string", + "id": 2 + }, + "score": { + "type": "float", + "id": 3 + } + } + }, + "Result": { + "fields": { + "product": { + "type": "Product", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "image": { + "type": "string", + "id": 3 + } + } + } + } + }, + "ProductSearchCategory": { + "values": { + "PRODUCT_SEARCH_CATEGORY_UNSPECIFIED": 0, + "SHOES": 1, + "BAGS": 2 + } + }, + "ProductSearchResultsView": { + "values": { + "BASIC": 0, + "FULL": 1 + } + }, + "ProductSearch": { + "methods": { + "CreateProductSet": { + "requestType": "CreateProductSetRequest", + "responseType": "ProductSet", + "options": { + "(google.api.http).post": "/v1p3beta1/{parent=projects/*/locations/*}/productSets", + "(google.api.http).body": "product_set" + } + }, + "ListProductSets": { + "requestType": "ListProductSetsRequest", + "responseType": "ListProductSetsResponse", + "options": { + "(google.api.http).get": "/v1p3beta1/{parent=projects/*/locations/*}/productSets" + } + }, + "GetProductSet": { + "requestType": "GetProductSetRequest", + "responseType": "ProductSet", + "options": { + "(google.api.http).get": "/v1p3beta1/{name=projects/*/locations/*/productSets/*}" + } + }, + "UpdateProductSet": { + "requestType": "UpdateProductSetRequest", + "responseType": "ProductSet", + "options": { + "(google.api.http).patch": "/v1p3beta1/{product_set.name=projects/*/locations/*/productSets/*}", + "(google.api.http).body": "product_set" + } + }, + "DeleteProductSet": { + "requestType": "DeleteProductSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p3beta1/{name=projects/*/locations/*/productSets/*}" + } + }, + "CreateProduct": { + "requestType": "CreateProductRequest", + "responseType": "Product", + "options": { + "(google.api.http).post": "/v1p3beta1/{parent=projects/*/locations/*}/products", + "(google.api.http).body": "product" + } + }, + "ListProducts": { + "requestType": "ListProductsRequest", + "responseType": "ListProductsResponse", + "options": { + "(google.api.http).get": "/v1p3beta1/{parent=projects/*/locations/*}/products" + } + }, + "GetProduct": { + "requestType": "GetProductRequest", + "responseType": "Product", + "options": { + "(google.api.http).get": "/v1p3beta1/{name=projects/*/locations/*/products/*}" + } + }, + "UpdateProduct": { + "requestType": "UpdateProductRequest", + "responseType": "Product", + "options": { + "(google.api.http).patch": "/v1p3beta1/{product.name=projects/*/locations/*/products/*}", + "(google.api.http).body": "product" + } + }, + "DeleteProduct": { + "requestType": "DeleteProductRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p3beta1/{name=projects/*/locations/*/products/*}" + } + }, + "CreateReferenceImage": { + "requestType": "CreateReferenceImageRequest", + "responseType": "ReferenceImage", + "options": { + "(google.api.http).post": "/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages", + "(google.api.http).body": "reference_image" + } + }, + "DeleteReferenceImage": { + "requestType": "DeleteReferenceImageRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" + } + }, + "ListReferenceImages": { + "requestType": "ListReferenceImagesRequest", + "responseType": "ListReferenceImagesResponse", + "options": { + "(google.api.http).get": "/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages" + } + }, + "GetReferenceImage": { + "requestType": "GetReferenceImageRequest", + "responseType": "ReferenceImage", + "options": { + "(google.api.http).get": "/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" + } + }, + "AddProductToProductSet": { + "requestType": "AddProductToProductSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1p3beta1/{name=projects/*/locations/*/productSets/*}:addProduct", + "(google.api.http).body": "*" + } + }, + "RemoveProductFromProductSet": { + "requestType": "RemoveProductFromProductSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1p3beta1/{name=projects/*/locations/*/productSets/*}:removeProduct", + "(google.api.http).body": "*" + } + }, + "ListProductsInProductSet": { + "requestType": "ListProductsInProductSetRequest", + "responseType": "ListProductsInProductSetResponse", + "options": { + "(google.api.http).get": "/v1p3beta1/{name=projects/*/locations/*/productSets/*}/products" + } + }, + "ImportProductSets": { + "requestType": "ImportProductSetsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p3beta1/{parent=projects/*/locations/*}/productSets:import", + "(google.api.http).body": "*" + } + } + } + }, + "Product": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "productCategory": { + "type": "string", + "id": 4 + }, + "productLabels": { + "rule": "repeated", + "type": "KeyValue", + "id": 5 + } + }, + "nested": { + "KeyValue": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ProductSet": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "indexTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "indexError": { + "type": "google.rpc.Status", + "id": 4 + } + } + }, + "ReferenceImage": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "boundingPolys": { + "rule": "repeated", + "type": "BoundingPoly", + "id": 3 + } + } + }, + "CreateProductRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "product": { + "type": "Product", + "id": 2 + }, + "productId": { + "type": "string", + "id": 3 + } + } + }, + "ListProductsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProductsResponse": { + "fields": { + "products": { + "rule": "repeated", + "type": "Product", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetProductRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "UpdateProductRequest": { + "fields": { + "product": { + "type": "Product", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteProductRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "CreateProductSetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "productSet": { + "type": "ProductSet", + "id": 2 + }, + "productSetId": { + "type": "string", + "id": 3 + } + } + }, + "ListProductSetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProductSetsResponse": { + "fields": { + "productSets": { + "rule": "repeated", + "type": "ProductSet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "UpdateProductSetRequest": { + "fields": { + "productSet": { + "type": "ProductSet", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "CreateReferenceImageRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "referenceImage": { + "type": "ReferenceImage", + "id": 2 + }, + "referenceImageId": { + "type": "string", + "id": 3 + } + } + }, + "ListReferenceImagesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListReferenceImagesResponse": { + "fields": { + "referenceImages": { + "rule": "repeated", + "type": "ReferenceImage", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "GetReferenceImageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteReferenceImageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "AddProductToProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "product": { + "type": "string", + "id": 2 + } + } + }, + "RemoveProductFromProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "product": { + "type": "string", + "id": 2 + } + } + }, + "ListProductsInProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProductsInProductSetResponse": { + "fields": { + "products": { + "rule": "repeated", + "type": "Product", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ImportProductSetsGcsSource": { + "fields": { + "csvFileUri": { + "type": "string", + "id": 1 + } + } + }, + "ImportProductSetsInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "ImportProductSetsGcsSource", + "id": 1 + } + } + }, + "ImportProductSetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "inputConfig": { + "type": "ImportProductSetsInputConfig", + "id": 2 + } + } + }, + "ImportProductSetsResponse": { + "fields": { + "referenceImages": { + "rule": "repeated", + "type": "ReferenceImage", + "id": 1 + }, + "statuses": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + } + } + }, + "BatchOperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PROCESSING": 1, + "SUCCESSFUL": 2, + "FAILED": 3, + "CANCELLED": 4 + } + } + } + }, + "TextAnnotation": { + "fields": { + "pages": { + "rule": "repeated", + "type": "Page", + "id": 1 + }, + "text": { + "type": "string", + "id": 2 + } + }, + "nested": { + "DetectedLanguage": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "DetectedBreak": { + "fields": { + "type": { + "type": "BreakType", + "id": 1 + }, + "isPrefix": { + "type": "bool", + "id": 2 + } + }, + "nested": { + "BreakType": { + "values": { + "UNKNOWN": 0, + "SPACE": 1, + "SURE_SPACE": 2, + "EOL_SURE_SPACE": 3, + "HYPHEN": 4, + "LINE_BREAK": 5 + } + } + } + }, + "TextProperty": { + "fields": { + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 1 + }, + "detectedBreak": { + "type": "DetectedBreak", + "id": 2 + } + } + } + } + }, + "Page": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "width": { + "type": "int32", + "id": 2 + }, + "height": { + "type": "int32", + "id": 3 + }, + "blocks": { + "rule": "repeated", + "type": "Block", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + } + } + }, + "Block": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "paragraphs": { + "rule": "repeated", + "type": "Paragraph", + "id": 3 + }, + "blockType": { + "type": "BlockType", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + } + }, + "nested": { + "BlockType": { + "values": { + "UNKNOWN": 0, + "TEXT": 1, + "TABLE": 2, + "PICTURE": 3, + "RULER": 4, + "BARCODE": 5 + } + } + } + }, + "Paragraph": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "words": { + "rule": "repeated", + "type": "Word", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "Word": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "symbols": { + "rule": "repeated", + "type": "Symbol", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "Symbol": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "text": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "WebDetection": { + "fields": { + "webEntities": { + "rule": "repeated", + "type": "WebEntity", + "id": 1 + }, + "fullMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 2 + }, + "partialMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 3 + }, + "pagesWithMatchingImages": { + "rule": "repeated", + "type": "WebPage", + "id": 4 + }, + "visuallySimilarImages": { + "rule": "repeated", + "type": "WebImage", + "id": 6 + }, + "bestGuessLabels": { + "rule": "repeated", + "type": "WebLabel", + "id": 8 + } + }, + "nested": { + "WebEntity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + } + }, + "WebImage": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + } + } + }, + "WebPage": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "pageTitle": { + "type": "string", + "id": 3 + }, + "fullMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 4 + }, + "partialMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 5 + } + } + }, + "WebLabel": { + "fields": { + "label": { + "type": "string", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + } + } + } + } + }, + "v1p4beta1": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision", + "java_multiple_files": true, + "java_outer_classname": "WebDetectionProto", + "java_package": "com.google.cloud.vision.v1p4beta1", + "objc_class_prefix": "GCVN" + }, + "nested": { + "ImageAnnotator": { + "methods": { + "BatchAnnotateImages": { + "requestType": "BatchAnnotateImagesRequest", + "responseType": "BatchAnnotateImagesResponse", + "options": { + "(google.api.http).post": "/v1p4beta1/images:annotate", + "(google.api.http).body": "*" + } + }, + "BatchAnnotateFiles": { + "requestType": "BatchAnnotateFilesRequest", + "responseType": "BatchAnnotateFilesResponse", + "options": { + "(google.api.http).post": "/v1p4beta1/files:annotate", + "(google.api.http).body": "*" + } + }, + "AsyncBatchAnnotateImages": { + "requestType": "AsyncBatchAnnotateImagesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p4beta1/images:asyncBatchAnnotate", + "(google.api.http).body": "*" + } + }, + "AsyncBatchAnnotateFiles": { + "requestType": "AsyncBatchAnnotateFilesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p4beta1/files:asyncBatchAnnotate", + "(google.api.http).body": "*" + } + } + } + }, + "Feature": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "maxResults": { + "type": "int32", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "FACE_DETECTION": 1, + "LANDMARK_DETECTION": 2, + "LOGO_DETECTION": 3, + "LABEL_DETECTION": 4, + "TEXT_DETECTION": 5, + "DOCUMENT_TEXT_DETECTION": 11, + "SAFE_SEARCH_DETECTION": 6, + "IMAGE_PROPERTIES": 7, + "CROP_HINTS": 9, + "WEB_DETECTION": 10, + "PRODUCT_SEARCH": 12, + "OBJECT_LOCALIZATION": 19 + } + } + } + }, + "ImageSource": { + "fields": { + "gcsImageUri": { + "type": "string", + "id": 1 + }, + "imageUri": { + "type": "string", + "id": 2 + } + } + }, + "Image": { + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "source": { + "type": "ImageSource", + "id": 2 + } + } + }, + "Likelihood": { + "values": { + "UNKNOWN": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + }, + "FaceAnnotation": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "fdBoundingPoly": { + "type": "BoundingPoly", + "id": 2 + }, + "landmarks": { + "rule": "repeated", + "type": "Landmark", + "id": 3 + }, + "rollAngle": { + "type": "float", + "id": 4 + }, + "panAngle": { + "type": "float", + "id": 5 + }, + "tiltAngle": { + "type": "float", + "id": 6 + }, + "detectionConfidence": { + "type": "float", + "id": 7 + }, + "landmarkingConfidence": { + "type": "float", + "id": 8 + }, + "joyLikelihood": { + "type": "Likelihood", + "id": 9 + }, + "sorrowLikelihood": { + "type": "Likelihood", + "id": 10 + }, + "angerLikelihood": { + "type": "Likelihood", + "id": 11 + }, + "surpriseLikelihood": { + "type": "Likelihood", + "id": 12 + }, + "underExposedLikelihood": { + "type": "Likelihood", + "id": 13 + }, + "blurredLikelihood": { + "type": "Likelihood", + "id": 14 + }, + "headwearLikelihood": { + "type": "Likelihood", + "id": 15 + } + }, + "nested": { + "Landmark": { + "fields": { + "type": { + "type": "Type", + "id": 3 + }, + "position": { + "type": "Position", + "id": 4 + } + }, + "nested": { + "Type": { + "values": { + "UNKNOWN_LANDMARK": 0, + "LEFT_EYE": 1, + "RIGHT_EYE": 2, + "LEFT_OF_LEFT_EYEBROW": 3, + "RIGHT_OF_LEFT_EYEBROW": 4, + "LEFT_OF_RIGHT_EYEBROW": 5, + "RIGHT_OF_RIGHT_EYEBROW": 6, + "MIDPOINT_BETWEEN_EYES": 7, + "NOSE_TIP": 8, + "UPPER_LIP": 9, + "LOWER_LIP": 10, + "MOUTH_LEFT": 11, + "MOUTH_RIGHT": 12, + "MOUTH_CENTER": 13, + "NOSE_BOTTOM_RIGHT": 14, + "NOSE_BOTTOM_LEFT": 15, + "NOSE_BOTTOM_CENTER": 16, + "LEFT_EYE_TOP_BOUNDARY": 17, + "LEFT_EYE_RIGHT_CORNER": 18, + "LEFT_EYE_BOTTOM_BOUNDARY": 19, + "LEFT_EYE_LEFT_CORNER": 20, + "RIGHT_EYE_TOP_BOUNDARY": 21, + "RIGHT_EYE_RIGHT_CORNER": 22, + "RIGHT_EYE_BOTTOM_BOUNDARY": 23, + "RIGHT_EYE_LEFT_CORNER": 24, + "LEFT_EYEBROW_UPPER_MIDPOINT": 25, + "RIGHT_EYEBROW_UPPER_MIDPOINT": 26, + "LEFT_EAR_TRAGION": 27, + "RIGHT_EAR_TRAGION": 28, + "LEFT_EYE_PUPIL": 29, + "RIGHT_EYE_PUPIL": 30, + "FOREHEAD_GLABELLA": 31, + "CHIN_GNATHION": 32, + "CHIN_LEFT_GONION": 33, + "CHIN_RIGHT_GONION": 34 + } + } + } + } + } + }, + "LocationInfo": { + "fields": { + "latLng": { + "type": "google.type.LatLng", + "id": 1 + } + } + }, + "Property": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + }, + "uint64Value": { + "type": "uint64", + "id": 3 + } + } + }, + "EntityAnnotation": { + "fields": { + "mid": { + "type": "string", + "id": 1 + }, + "locale": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "score": { + "type": "float", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5, + "options": { + "deprecated": true + } + }, + "topicality": { + "type": "float", + "id": 6 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 7 + }, + "locations": { + "rule": "repeated", + "type": "LocationInfo", + "id": 8 + }, + "properties": { + "rule": "repeated", + "type": "Property", + "id": 9 + } + } + }, + "LocalizedObjectAnnotation": { + "fields": { + "mid": { + "type": "string", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + }, + "score": { + "type": "float", + "id": 4 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 5 + } + } + }, + "SafeSearchAnnotation": { + "fields": { + "adult": { + "type": "Likelihood", + "id": 1 + }, + "spoof": { + "type": "Likelihood", + "id": 2 + }, + "medical": { + "type": "Likelihood", + "id": 3 + }, + "violence": { + "type": "Likelihood", + "id": 4 + }, + "racy": { + "type": "Likelihood", + "id": 9 + } + } + }, + "LatLongRect": { + "fields": { + "minLatLng": { + "type": "google.type.LatLng", + "id": 1 + }, + "maxLatLng": { + "type": "google.type.LatLng", + "id": 2 + } + } + }, + "ColorInfo": { + "fields": { + "color": { + "type": "google.type.Color", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "pixelFraction": { + "type": "float", + "id": 3 + } + } + }, + "DominantColorsAnnotation": { + "fields": { + "colors": { + "rule": "repeated", + "type": "ColorInfo", + "id": 1 + } + } + }, + "ImageProperties": { + "fields": { + "dominantColors": { + "type": "DominantColorsAnnotation", + "id": 1 + } + } + }, + "CropHint": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "importanceFraction": { + "type": "float", + "id": 3 + } + } + }, + "CropHintsAnnotation": { + "fields": { + "cropHints": { + "rule": "repeated", + "type": "CropHint", + "id": 1 + } + } + }, + "CropHintsParams": { + "fields": { + "aspectRatios": { + "rule": "repeated", + "type": "float", + "id": 1 + } + } + }, + "WebDetectionParams": { + "fields": { + "includeGeoResults": { + "type": "bool", + "id": 2 + } + } + }, + "ImageContext": { + "fields": { + "latLongRect": { + "type": "LatLongRect", + "id": 1 + }, + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "cropHintsParams": { + "type": "CropHintsParams", + "id": 4 + }, + "productSearchParams": { + "type": "ProductSearchParams", + "id": 5 + }, + "webDetectionParams": { + "type": "WebDetectionParams", + "id": 6 + } + } + }, + "AnnotateImageRequest": { + "fields": { + "image": { + "type": "Image", + "id": 1 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "imageContext": { + "type": "ImageContext", + "id": 3 + } + } + }, + "ImageAnnotationContext": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "pageNumber": { + "type": "int32", + "id": 2 + } + } + }, + "AnnotateImageResponse": { + "fields": { + "faceAnnotations": { + "rule": "repeated", + "type": "FaceAnnotation", + "id": 1 + }, + "landmarkAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 2 + }, + "logoAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 3 + }, + "labelAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 4 + }, + "localizedObjectAnnotations": { + "rule": "repeated", + "type": "LocalizedObjectAnnotation", + "id": 22 + }, + "textAnnotations": { + "rule": "repeated", + "type": "EntityAnnotation", + "id": 5 + }, + "fullTextAnnotation": { + "type": "TextAnnotation", + "id": 12 + }, + "safeSearchAnnotation": { + "type": "SafeSearchAnnotation", + "id": 6 + }, + "imagePropertiesAnnotation": { + "type": "ImageProperties", + "id": 8 + }, + "cropHintsAnnotation": { + "type": "CropHintsAnnotation", + "id": 11 + }, + "webDetection": { + "type": "WebDetection", + "id": 13 + }, + "productSearchResults": { + "type": "ProductSearchResults", + "id": 14 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + }, + "context": { + "type": "ImageAnnotationContext", + "id": 21 + } + } + }, + "AnnotateFileResponse": { + "fields": { + "inputConfig": { + "type": "InputConfig", + "id": 1 + }, + "responses": { + "rule": "repeated", + "type": "AnnotateImageResponse", + "id": 2 + }, + "totalPages": { + "type": "int32", + "id": 3 + } + } + }, + "BatchAnnotateImagesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AnnotateImageRequest", + "id": 1 + } + } + }, + "BatchAnnotateImagesResponse": { + "fields": { + "responses": { + "rule": "repeated", + "type": "AnnotateImageResponse", + "id": 1 + } + } + }, + "AnnotateFileRequest": { + "fields": { + "inputConfig": { + "type": "InputConfig", + "id": 1 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "imageContext": { + "type": "ImageContext", + "id": 3 + }, + "pages": { + "rule": "repeated", + "type": "int32", + "id": 4 + } + } + }, + "BatchAnnotateFilesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AnnotateFileRequest", + "id": 1 + } + } + }, + "BatchAnnotateFilesResponse": { + "fields": { + "responses": { + "rule": "repeated", + "type": "AnnotateFileResponse", + "id": 1 + } + } + }, + "AsyncAnnotateFileRequest": { + "fields": { + "inputConfig": { + "type": "InputConfig", + "id": 1 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "imageContext": { + "type": "ImageContext", + "id": 3 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 4 + } + } + }, + "AsyncAnnotateFileResponse": { + "fields": { + "outputConfig": { + "type": "OutputConfig", + "id": 1 + } + } + }, + "AsyncBatchAnnotateImagesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AnnotateImageRequest", + "id": 1 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 2 + } + } + }, + "AsyncBatchAnnotateImagesResponse": { + "fields": { + "outputConfig": { + "type": "OutputConfig", + "id": 1 + } + } + }, + "AsyncBatchAnnotateFilesRequest": { + "fields": { + "requests": { + "rule": "repeated", + "type": "AsyncAnnotateFileRequest", + "id": 1 + } + } + }, + "AsyncBatchAnnotateFilesResponse": { + "fields": { + "responses": { + "rule": "repeated", + "type": "AsyncAnnotateFileResponse", + "id": 1 + } + } + }, + "InputConfig": { + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "content": { + "type": "bytes", + "id": 3 + }, + "mimeType": { + "type": "string", + "id": 2 + } + } + }, + "OutputConfig": { + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "batchSize": { + "type": "int32", + "id": 2 + } + } + }, + "GcsSource": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "OperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATED": 1, + "RUNNING": 2, + "DONE": 3, + "CANCELLED": 4 + } + } + } + }, + "Vertex": { + "fields": { + "x": { + "type": "int32", + "id": 1 + }, + "y": { + "type": "int32", + "id": 2 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "Vertex", + "id": 1 + }, + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 2 + } + } + }, + "Position": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + }, + "z": { + "type": "float", + "id": 3 + } + } + }, + "ProductSearchParams": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 9 + }, + "productSet": { + "type": "string", + "id": 6 + }, + "productCategories": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "filter": { + "type": "string", + "id": 8 + } + } + }, + "ProductSearchResults": { + "fields": { + "indexTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "results": { + "rule": "repeated", + "type": "Result", + "id": 5 + }, + "productGroupedResults": { + "rule": "repeated", + "type": "GroupedResult", + "id": 6 + } + }, + "nested": { + "Result": { + "fields": { + "product": { + "type": "Product", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "image": { + "type": "string", + "id": 3 + } + } + }, + "GroupedResult": { + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "results": { + "rule": "repeated", + "type": "Result", + "id": 2 + } + } + } + } + }, + "ProductSearch": { + "methods": { + "CreateProductSet": { + "requestType": "CreateProductSetRequest", + "responseType": "ProductSet", + "options": { + "(google.api.http).post": "/v1p4beta1/{parent=projects/*/locations/*}/productSets", + "(google.api.http).body": "product_set" + } + }, + "ListProductSets": { + "requestType": "ListProductSetsRequest", + "responseType": "ListProductSetsResponse", + "options": { + "(google.api.http).get": "/v1p4beta1/{parent=projects/*/locations/*}/productSets" + } + }, + "GetProductSet": { + "requestType": "GetProductSetRequest", + "responseType": "ProductSet", + "options": { + "(google.api.http).get": "/v1p4beta1/{name=projects/*/locations/*/productSets/*}" + } + }, + "UpdateProductSet": { + "requestType": "UpdateProductSetRequest", + "responseType": "ProductSet", + "options": { + "(google.api.http).patch": "/v1p4beta1/{product_set.name=projects/*/locations/*/productSets/*}", + "(google.api.http).body": "product_set" + } + }, + "DeleteProductSet": { + "requestType": "DeleteProductSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p4beta1/{name=projects/*/locations/*/productSets/*}" + } + }, + "CreateProduct": { + "requestType": "CreateProductRequest", + "responseType": "Product", + "options": { + "(google.api.http).post": "/v1p4beta1/{parent=projects/*/locations/*}/products", + "(google.api.http).body": "product" + } + }, + "ListProducts": { + "requestType": "ListProductsRequest", + "responseType": "ListProductsResponse", + "options": { + "(google.api.http).get": "/v1p4beta1/{parent=projects/*/locations/*}/products" + } + }, + "GetProduct": { + "requestType": "GetProductRequest", + "responseType": "Product", + "options": { + "(google.api.http).get": "/v1p4beta1/{name=projects/*/locations/*/products/*}" + } + }, + "UpdateProduct": { + "requestType": "UpdateProductRequest", + "responseType": "Product", + "options": { + "(google.api.http).patch": "/v1p4beta1/{product.name=projects/*/locations/*/products/*}", + "(google.api.http).body": "product" + } + }, + "DeleteProduct": { + "requestType": "DeleteProductRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p4beta1/{name=projects/*/locations/*/products/*}" + } + }, + "CreateReferenceImage": { + "requestType": "CreateReferenceImageRequest", + "responseType": "ReferenceImage", + "options": { + "(google.api.http).post": "/v1p4beta1/{parent=projects/*/locations/*/products/*}/referenceImages", + "(google.api.http).body": "reference_image" + } + }, + "DeleteReferenceImage": { + "requestType": "DeleteReferenceImageRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p4beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" + } + }, + "ListReferenceImages": { + "requestType": "ListReferenceImagesRequest", + "responseType": "ListReferenceImagesResponse", + "options": { + "(google.api.http).get": "/v1p4beta1/{parent=projects/*/locations/*/products/*}/referenceImages" + } + }, + "GetReferenceImage": { + "requestType": "GetReferenceImageRequest", + "responseType": "ReferenceImage", + "options": { + "(google.api.http).get": "/v1p4beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" + } + }, + "AddProductToProductSet": { + "requestType": "AddProductToProductSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1p4beta1/{name=projects/*/locations/*/productSets/*}:addProduct", + "(google.api.http).body": "*" + } + }, + "RemoveProductFromProductSet": { + "requestType": "RemoveProductFromProductSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1p4beta1/{name=projects/*/locations/*/productSets/*}:removeProduct", + "(google.api.http).body": "*" + } + }, + "ListProductsInProductSet": { + "requestType": "ListProductsInProductSetRequest", + "responseType": "ListProductsInProductSetResponse", + "options": { + "(google.api.http).get": "/v1p4beta1/{name=projects/*/locations/*/productSets/*}/products" + } + }, + "ImportProductSets": { + "requestType": "ImportProductSetsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p4beta1/{parent=projects/*/locations/*}/productSets:import", + "(google.api.http).body": "*" + } + } + } + }, + "Product": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "productCategory": { + "type": "string", + "id": 4 + }, + "productLabels": { + "rule": "repeated", + "type": "KeyValue", + "id": 5 + } + }, + "nested": { + "KeyValue": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ProductSet": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "indexTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "indexError": { + "type": "google.rpc.Status", + "id": 4 + } + } + }, + "ReferenceImage": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "boundingPolys": { + "rule": "repeated", + "type": "BoundingPoly", + "id": 3 + } + } + }, + "CreateProductRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "product": { + "type": "Product", + "id": 2 + }, + "productId": { + "type": "string", + "id": 3 + } + } + }, + "ListProductsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProductsResponse": { + "fields": { + "products": { + "rule": "repeated", + "type": "Product", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetProductRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "UpdateProductRequest": { + "fields": { + "product": { + "type": "Product", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteProductRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "CreateProductSetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "productSet": { + "type": "ProductSet", + "id": 2 + }, + "productSetId": { + "type": "string", + "id": 3 + } + } + }, + "ListProductSetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProductSetsResponse": { + "fields": { + "productSets": { + "rule": "repeated", + "type": "ProductSet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "UpdateProductSetRequest": { + "fields": { + "productSet": { + "type": "ProductSet", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "CreateReferenceImageRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "referenceImage": { + "type": "ReferenceImage", + "id": 2 + }, + "referenceImageId": { + "type": "string", + "id": 3 + } + } + }, + "ListReferenceImagesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListReferenceImagesResponse": { + "fields": { + "referenceImages": { + "rule": "repeated", + "type": "ReferenceImage", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "GetReferenceImageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteReferenceImageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "AddProductToProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "product": { + "type": "string", + "id": 2 + } + } + }, + "RemoveProductFromProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "product": { + "type": "string", + "id": 2 + } + } + }, + "ListProductsInProductSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProductsInProductSetResponse": { + "fields": { + "products": { + "rule": "repeated", + "type": "Product", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ImportProductSetsGcsSource": { + "fields": { + "csvFileUri": { + "type": "string", + "id": 1 + } + } + }, + "ImportProductSetsInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "ImportProductSetsGcsSource", + "id": 1 + } + } + }, + "ImportProductSetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "inputConfig": { + "type": "ImportProductSetsInputConfig", + "id": 2 + } + } + }, + "ImportProductSetsResponse": { + "fields": { + "referenceImages": { + "rule": "repeated", + "type": "ReferenceImage", + "id": 1 + }, + "statuses": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + } + } + }, + "BatchOperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PROCESSING": 1, + "SUCCESSFUL": 2, + "FAILED": 3, + "CANCELLED": 4 + } + } + } + }, + "TextAnnotation": { + "fields": { + "pages": { + "rule": "repeated", + "type": "Page", + "id": 1 + }, + "text": { + "type": "string", + "id": 2 + } + }, + "nested": { + "DetectedLanguage": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "DetectedBreak": { + "fields": { + "type": { + "type": "BreakType", + "id": 1 + }, + "isPrefix": { + "type": "bool", + "id": 2 + } + }, + "nested": { + "BreakType": { + "values": { + "UNKNOWN": 0, + "SPACE": 1, + "SURE_SPACE": 2, + "EOL_SURE_SPACE": 3, + "HYPHEN": 4, + "LINE_BREAK": 5 + } + } + } + }, + "TextProperty": { + "fields": { + "detectedLanguages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 1 + }, + "detectedBreak": { + "type": "DetectedBreak", + "id": 2 + } + } + } + } + }, + "Page": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "width": { + "type": "int32", + "id": 2 + }, + "height": { + "type": "int32", + "id": 3 + }, + "blocks": { + "rule": "repeated", + "type": "Block", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + } + } + }, + "Block": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "paragraphs": { + "rule": "repeated", + "type": "Paragraph", + "id": 3 + }, + "blockType": { + "type": "BlockType", + "id": 4 + }, + "confidence": { + "type": "float", + "id": 5 + } + }, + "nested": { + "BlockType": { + "values": { + "UNKNOWN": 0, + "TEXT": 1, + "TABLE": 2, + "PICTURE": 3, + "RULER": 4, + "BARCODE": 5 + } + } + } + }, + "Paragraph": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "words": { + "rule": "repeated", + "type": "Word", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "Word": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "symbols": { + "rule": "repeated", + "type": "Symbol", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "Symbol": { + "fields": { + "property": { + "type": "TextAnnotation.TextProperty", + "id": 1 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 2 + }, + "text": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "WebDetection": { + "fields": { + "webEntities": { + "rule": "repeated", + "type": "WebEntity", + "id": 1 + }, + "fullMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 2 + }, + "partialMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 3 + }, + "pagesWithMatchingImages": { + "rule": "repeated", + "type": "WebPage", + "id": 4 + }, + "visuallySimilarImages": { + "rule": "repeated", + "type": "WebImage", + "id": 6 + }, + "bestGuessLabels": { + "rule": "repeated", + "type": "WebLabel", + "id": 8 + } + }, + "nested": { + "WebEntity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + } + }, + "WebImage": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + } + } + }, + "WebLabel": { + "fields": { + "label": { + "type": "string", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "WebPage": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + }, + "pageTitle": { + "type": "string", + "id": 3 + }, + "fullMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 4 + }, + "partialMatchingImages": { + "rule": "repeated", + "type": "WebImage", + "id": 5 + } + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "protobuf": { + "options": { + "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": false + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}" + } + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}" + } + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}" + } + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*" + } + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/latlng;latlng", + "java_multiple_files": true, + "java_outer_classname": "LatLngProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Color": { + "fields": { + "red": { + "type": "float", + "id": 1 + }, + "green": { + "type": "float", + "id": 2 + }, + "blue": { + "type": "float", + "id": 3 + }, + "alpha": { + "type": "google.protobuf.FloatValue", + "id": 4 + } + } + }, + "LatLng": { + "fields": { + "latitude": { + "type": "double", + "id": 1 + }, + "longitude": { + "type": "double", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/browser.js b/src/browser.js new file mode 100644 index 00000000..ddbcd7ec --- /dev/null +++ b/src/browser.js @@ -0,0 +1,21 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +// Set a flag that we are running in a browser bundle. +global.isBrowser = true; + +// Re-export all exports from ./index.js. +module.exports = require('./index'); diff --git a/src/v1/image_annotator_client.js b/src/v1/image_annotator_client.js index a6054b00..084f13a1 100644 --- a/src/v1/image_annotator_client.js +++ b/src/v1/image_annotator_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./image_annotator_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -61,6 +60,16 @@ class ImageAnnotatorClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -77,43 +86,51 @@ class ImageAnnotatorClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/vision/v1/image_annotator.proto'] + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' ); - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/vision/v1/image_annotator.proto' - ), - protoFilesRoot + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -132,7 +149,7 @@ class ImageAnnotatorClient { ); this._descriptors.longrunning = { - asyncBatchAnnotateImages: new gax.LongrunningDescriptor( + asyncBatchAnnotateImages: new gaxModule.LongrunningDescriptor( this.operationsClient, asyncBatchAnnotateImagesResponse.decode.bind( asyncBatchAnnotateImagesResponse @@ -141,7 +158,7 @@ class ImageAnnotatorClient { asyncBatchAnnotateImagesMetadata ) ), - asyncBatchAnnotateFiles: new gax.LongrunningDescriptor( + asyncBatchAnnotateFiles: new gaxModule.LongrunningDescriptor( this.operationsClient, asyncBatchAnnotateFilesResponse.decode.bind( asyncBatchAnnotateFilesResponse @@ -168,7 +185,9 @@ class ImageAnnotatorClient { // Put together the "service stub" for // google.cloud.vision.v1.ImageAnnotator. const imageAnnotatorStub = gaxGrpc.createStub( - protos.google.cloud.vision.v1.ImageAnnotator, + opts.fallback + ? protos.lookupService('google.cloud.vision.v1.ImageAnnotator') + : protos.google.cloud.vision.v1.ImageAnnotator, opts ); @@ -181,18 +200,16 @@ class ImageAnnotatorClient { 'asyncBatchAnnotateFiles', ]; for (const methodName of imageAnnotatorStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - imageAnnotatorStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = imageAnnotatorStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/src/v1/image_annotator_proto_list.json b/src/v1/image_annotator_proto_list.json new file mode 100644 index 00000000..8d36ebf0 --- /dev/null +++ b/src/v1/image_annotator_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/vision/v1/image_annotator.proto" +] diff --git a/src/v1/product_search_client.js b/src/v1/product_search_client.js index c9621bb6..527a87a5 100644 --- a/src/v1/product_search_client.js +++ b/src/v1/product_search_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./product_search_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -74,6 +73,16 @@ class ProductSearchClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -90,42 +99,57 @@ class ProductSearchClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/vision/v1/product_search_service.proto'] + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - locationPathTemplate: new gax.PathTemplate( + locationPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), - productPathTemplate: new gax.PathTemplate( + productPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/products/{product}' ), - productSetPathTemplate: new gax.PathTemplate( + productSetPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/productSets/{product_set}' ), - referenceImagePathTemplate: new gax.PathTemplate( + referenceImagePathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}' ), }; @@ -134,43 +158,36 @@ class ProductSearchClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - listProductSets: new gax.PageDescriptor( + listProductSets: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'productSets' ), - listProducts: new gax.PageDescriptor( + listProducts: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'products' ), - listReferenceImages: new gax.PageDescriptor( + listReferenceImages: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'referenceImages' ), - listProductsInProductSet: new gax.PageDescriptor( + listProductsInProductSet: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'products' ), }; - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/vision/v1/product_search_service.proto' - ), - protoFilesRoot - ); + + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -189,12 +206,12 @@ class ProductSearchClient { ); this._descriptors.longrunning = { - importProductSets: new gax.LongrunningDescriptor( + importProductSets: new gaxModule.LongrunningDescriptor( this.operationsClient, importProductSetsResponse.decode.bind(importProductSetsResponse), importProductSetsMetadata.decode.bind(importProductSetsMetadata) ), - purgeProducts: new gax.LongrunningDescriptor( + purgeProducts: new gaxModule.LongrunningDescriptor( this.operationsClient, purgeProductsResponse.decode.bind(purgeProductsResponse), purgeProductsMetadata.decode.bind(purgeProductsMetadata) @@ -217,7 +234,9 @@ class ProductSearchClient { // Put together the "service stub" for // google.cloud.vision.v1.ProductSearch. const productSearchStub = gaxGrpc.createStub( - protos.google.cloud.vision.v1.ProductSearch, + opts.fallback + ? protos.lookupService('google.cloud.vision.v1.ProductSearch') + : protos.google.cloud.vision.v1.ProductSearch, opts ); @@ -245,18 +264,16 @@ class ProductSearchClient { 'purgeProducts', ]; for (const methodName of productSearchStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - productSearchStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = productSearchStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.page[methodName] || this._descriptors.longrunning[methodName] diff --git a/src/v1/product_search_proto_list.json b/src/v1/product_search_proto_list.json new file mode 100644 index 00000000..fe01671f --- /dev/null +++ b/src/v1/product_search_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/vision/v1/product_search_service.proto" +] diff --git a/src/v1p1beta1/image_annotator_client.js b/src/v1p1beta1/image_annotator_client.js index 2e939ae7..97ecfb9c 100644 --- a/src/v1p1beta1/image_annotator_client.js +++ b/src/v1p1beta1/image_annotator_client.js @@ -60,6 +60,16 @@ class ImageAnnotatorClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -76,26 +86,41 @@ class ImageAnnotatorClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/vision/v1p1beta1/image_annotator.proto'] + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); // Put together the default options sent with requests. @@ -114,7 +139,9 @@ class ImageAnnotatorClient { // Put together the "service stub" for // google.cloud.vision.v1p1beta1.ImageAnnotator. const imageAnnotatorStub = gaxGrpc.createStub( - protos.google.cloud.vision.v1p1beta1.ImageAnnotator, + opts.fallback + ? protos.lookupService('google.cloud.vision.v1p1beta1.ImageAnnotator') + : protos.google.cloud.vision.v1p1beta1.ImageAnnotator, opts ); @@ -122,18 +149,16 @@ class ImageAnnotatorClient { // and create an API call method for each. const imageAnnotatorStubMethods = ['batchAnnotateImages']; for (const methodName of imageAnnotatorStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - imageAnnotatorStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = imageAnnotatorStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], null ); diff --git a/src/v1p1beta1/image_annotator_proto_list.json b/src/v1p1beta1/image_annotator_proto_list.json new file mode 100644 index 00000000..75373115 --- /dev/null +++ b/src/v1p1beta1/image_annotator_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/vision/v1p1beta1/image_annotator.proto" +] diff --git a/src/v1p2beta1/image_annotator_client.js b/src/v1p2beta1/image_annotator_client.js index 67888b6e..7096820d 100644 --- a/src/v1p2beta1/image_annotator_client.js +++ b/src/v1p2beta1/image_annotator_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./image_annotator_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -61,6 +60,16 @@ class ImageAnnotatorClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -77,43 +86,51 @@ class ImageAnnotatorClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/vision/v1p2beta1/image_annotator.proto'] + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' ); - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/vision/v1p2beta1/image_annotator.proto' - ), - protoFilesRoot + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -126,7 +143,7 @@ class ImageAnnotatorClient { ); this._descriptors.longrunning = { - asyncBatchAnnotateFiles: new gax.LongrunningDescriptor( + asyncBatchAnnotateFiles: new gaxModule.LongrunningDescriptor( this.operationsClient, asyncBatchAnnotateFilesResponse.decode.bind( asyncBatchAnnotateFilesResponse @@ -153,7 +170,9 @@ class ImageAnnotatorClient { // Put together the "service stub" for // google.cloud.vision.v1p2beta1.ImageAnnotator. const imageAnnotatorStub = gaxGrpc.createStub( - protos.google.cloud.vision.v1p2beta1.ImageAnnotator, + opts.fallback + ? protos.lookupService('google.cloud.vision.v1p2beta1.ImageAnnotator') + : protos.google.cloud.vision.v1p2beta1.ImageAnnotator, opts ); @@ -164,18 +183,16 @@ class ImageAnnotatorClient { 'asyncBatchAnnotateFiles', ]; for (const methodName of imageAnnotatorStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - imageAnnotatorStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = imageAnnotatorStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/src/v1p2beta1/image_annotator_proto_list.json b/src/v1p2beta1/image_annotator_proto_list.json new file mode 100644 index 00000000..63dc03da --- /dev/null +++ b/src/v1p2beta1/image_annotator_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/vision/v1p2beta1/image_annotator.proto" +] diff --git a/src/v1p3beta1/image_annotator_client.js b/src/v1p3beta1/image_annotator_client.js index 5354040a..75889128 100644 --- a/src/v1p3beta1/image_annotator_client.js +++ b/src/v1p3beta1/image_annotator_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./image_annotator_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -61,6 +60,16 @@ class ImageAnnotatorClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -77,43 +86,51 @@ class ImageAnnotatorClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/vision/v1p3beta1/image_annotator.proto'] + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' ); - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/vision/v1p3beta1/image_annotator.proto' - ), - protoFilesRoot + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -126,7 +143,7 @@ class ImageAnnotatorClient { ); this._descriptors.longrunning = { - asyncBatchAnnotateFiles: new gax.LongrunningDescriptor( + asyncBatchAnnotateFiles: new gaxModule.LongrunningDescriptor( this.operationsClient, asyncBatchAnnotateFilesResponse.decode.bind( asyncBatchAnnotateFilesResponse @@ -153,7 +170,9 @@ class ImageAnnotatorClient { // Put together the "service stub" for // google.cloud.vision.v1p3beta1.ImageAnnotator. const imageAnnotatorStub = gaxGrpc.createStub( - protos.google.cloud.vision.v1p3beta1.ImageAnnotator, + opts.fallback + ? protos.lookupService('google.cloud.vision.v1p3beta1.ImageAnnotator') + : protos.google.cloud.vision.v1p3beta1.ImageAnnotator, opts ); @@ -164,18 +183,16 @@ class ImageAnnotatorClient { 'asyncBatchAnnotateFiles', ]; for (const methodName of imageAnnotatorStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - imageAnnotatorStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = imageAnnotatorStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/src/v1p3beta1/image_annotator_proto_list.json b/src/v1p3beta1/image_annotator_proto_list.json new file mode 100644 index 00000000..afd0848a --- /dev/null +++ b/src/v1p3beta1/image_annotator_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/vision/v1p3beta1/image_annotator.proto" +] diff --git a/src/v1p3beta1/product_search_client.js b/src/v1p3beta1/product_search_client.js index cd9855f6..8d27cd31 100644 --- a/src/v1p3beta1/product_search_client.js +++ b/src/v1p3beta1/product_search_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./product_search_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -76,6 +75,16 @@ class ProductSearchClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -92,42 +101,57 @@ class ProductSearchClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/vision/v1p3beta1/product_search_service.proto'] + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - locationPathTemplate: new gax.PathTemplate( + locationPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), - productPathTemplate: new gax.PathTemplate( + productPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/products/{product}' ), - productSetPathTemplate: new gax.PathTemplate( + productSetPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/productSets/{product_set}' ), - referenceImagePathTemplate: new gax.PathTemplate( + referenceImagePathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}' ), }; @@ -136,43 +160,36 @@ class ProductSearchClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - listProductSets: new gax.PageDescriptor( + listProductSets: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'productSets' ), - listProducts: new gax.PageDescriptor( + listProducts: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'products' ), - listReferenceImages: new gax.PageDescriptor( + listReferenceImages: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'referenceImages' ), - listProductsInProductSet: new gax.PageDescriptor( + listProductsInProductSet: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'products' ), }; - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/vision/v1p3beta1/product_search_service.proto' - ), - protoFilesRoot - ); + + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -185,7 +202,7 @@ class ProductSearchClient { ); this._descriptors.longrunning = { - importProductSets: new gax.LongrunningDescriptor( + importProductSets: new gaxModule.LongrunningDescriptor( this.operationsClient, importProductSetsResponse.decode.bind(importProductSetsResponse), importProductSetsMetadata.decode.bind(importProductSetsMetadata) @@ -208,7 +225,9 @@ class ProductSearchClient { // Put together the "service stub" for // google.cloud.vision.v1p3beta1.ProductSearch. const productSearchStub = gaxGrpc.createStub( - protos.google.cloud.vision.v1p3beta1.ProductSearch, + opts.fallback + ? protos.lookupService('google.cloud.vision.v1p3beta1.ProductSearch') + : protos.google.cloud.vision.v1p3beta1.ProductSearch, opts ); @@ -235,18 +254,16 @@ class ProductSearchClient { 'importProductSets', ]; for (const methodName of productSearchStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - productSearchStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = productSearchStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.page[methodName] || this._descriptors.longrunning[methodName] diff --git a/src/v1p3beta1/product_search_proto_list.json b/src/v1p3beta1/product_search_proto_list.json new file mode 100644 index 00000000..ab47bf6e --- /dev/null +++ b/src/v1p3beta1/product_search_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/vision/v1p3beta1/product_search_service.proto" +] diff --git a/src/v1p4beta1/image_annotator_client.js b/src/v1p4beta1/image_annotator_client.js index afc9c090..0399c1a2 100644 --- a/src/v1p4beta1/image_annotator_client.js +++ b/src/v1p4beta1/image_annotator_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./image_annotator_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -61,6 +60,16 @@ class ImageAnnotatorClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -77,43 +86,51 @@ class ImageAnnotatorClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/vision/v1p4beta1/image_annotator.proto'] + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' ); - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/vision/v1p4beta1/image_annotator.proto' - ), - protoFilesRoot + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -132,7 +149,7 @@ class ImageAnnotatorClient { ); this._descriptors.longrunning = { - asyncBatchAnnotateImages: new gax.LongrunningDescriptor( + asyncBatchAnnotateImages: new gaxModule.LongrunningDescriptor( this.operationsClient, asyncBatchAnnotateImagesResponse.decode.bind( asyncBatchAnnotateImagesResponse @@ -141,7 +158,7 @@ class ImageAnnotatorClient { asyncBatchAnnotateImagesMetadata ) ), - asyncBatchAnnotateFiles: new gax.LongrunningDescriptor( + asyncBatchAnnotateFiles: new gaxModule.LongrunningDescriptor( this.operationsClient, asyncBatchAnnotateFilesResponse.decode.bind( asyncBatchAnnotateFilesResponse @@ -168,7 +185,9 @@ class ImageAnnotatorClient { // Put together the "service stub" for // google.cloud.vision.v1p4beta1.ImageAnnotator. const imageAnnotatorStub = gaxGrpc.createStub( - protos.google.cloud.vision.v1p4beta1.ImageAnnotator, + opts.fallback + ? protos.lookupService('google.cloud.vision.v1p4beta1.ImageAnnotator') + : protos.google.cloud.vision.v1p4beta1.ImageAnnotator, opts ); @@ -181,18 +200,16 @@ class ImageAnnotatorClient { 'asyncBatchAnnotateFiles', ]; for (const methodName of imageAnnotatorStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - imageAnnotatorStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = imageAnnotatorStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/src/v1p4beta1/image_annotator_proto_list.json b/src/v1p4beta1/image_annotator_proto_list.json new file mode 100644 index 00000000..75141cbc --- /dev/null +++ b/src/v1p4beta1/image_annotator_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/vision/v1p4beta1/image_annotator.proto" +] diff --git a/src/v1p4beta1/product_search_client.js b/src/v1p4beta1/product_search_client.js index 91f56b53..41957da8 100644 --- a/src/v1p4beta1/product_search_client.js +++ b/src/v1p4beta1/product_search_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./product_search_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -76,6 +75,16 @@ class ProductSearchClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -92,42 +101,57 @@ class ProductSearchClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/vision/v1p4beta1/product_search_service.proto'] + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - locationPathTemplate: new gax.PathTemplate( + locationPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), - productPathTemplate: new gax.PathTemplate( + productPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/products/{product}' ), - productSetPathTemplate: new gax.PathTemplate( + productSetPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/productSets/{product_set}' ), - referenceImagePathTemplate: new gax.PathTemplate( + referenceImagePathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}' ), }; @@ -136,43 +160,36 @@ class ProductSearchClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - listProductSets: new gax.PageDescriptor( + listProductSets: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'productSets' ), - listProducts: new gax.PageDescriptor( + listProducts: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'products' ), - listReferenceImages: new gax.PageDescriptor( + listReferenceImages: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'referenceImages' ), - listProductsInProductSet: new gax.PageDescriptor( + listProductsInProductSet: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'products' ), }; - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/vision/v1p4beta1/product_search_service.proto' - ), - protoFilesRoot - ); + + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -185,7 +202,7 @@ class ProductSearchClient { ); this._descriptors.longrunning = { - importProductSets: new gax.LongrunningDescriptor( + importProductSets: new gaxModule.LongrunningDescriptor( this.operationsClient, importProductSetsResponse.decode.bind(importProductSetsResponse), importProductSetsMetadata.decode.bind(importProductSetsMetadata) @@ -208,7 +225,9 @@ class ProductSearchClient { // Put together the "service stub" for // google.cloud.vision.v1p4beta1.ProductSearch. const productSearchStub = gaxGrpc.createStub( - protos.google.cloud.vision.v1p4beta1.ProductSearch, + opts.fallback + ? protos.lookupService('google.cloud.vision.v1p4beta1.ProductSearch') + : protos.google.cloud.vision.v1p4beta1.ProductSearch, opts ); @@ -235,18 +254,16 @@ class ProductSearchClient { 'importProductSets', ]; for (const methodName of productSearchStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - productSearchStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = productSearchStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.page[methodName] || this._descriptors.longrunning[methodName] diff --git a/src/v1p4beta1/product_search_proto_list.json b/src/v1p4beta1/product_search_proto_list.json new file mode 100644 index 00000000..f4abec50 --- /dev/null +++ b/src/v1p4beta1/product_search_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/vision/v1p4beta1/product_search_service.proto" +] diff --git a/synth.metadata b/synth.metadata index 391e755f..a034b06d 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-29T11:27:31.663243Z", + "updateTime": "2019-09-06T11:26:58.194033Z", "sources": [ { "generator": { "name": "artman", - "version": "0.35.1", - "dockerImage": "googleapis/artman@sha256:b11c7ea0d0831c54016fb50f4b796d24d1971439b30fbc32a369ba1ac887c384" + "version": "0.36.2", + "dockerImage": "googleapis/artman@sha256:0e6f3a668cd68afc768ecbe08817cf6e56a0e64fcbdb1c58c3b97492d12418a1" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e121a35579e73377f998c11bcc09ba0486736404", - "internalRef": "265953539" + "sha": "960b76b1f0c46d12610088977d1129cc7405f3dc", + "internalRef": "267478864" } }, { diff --git a/test/gapic-v1.js b/test/gapic-v1.js index 231c9023..7ab0e0c4 100644 --- a/test/gapic-v1.js +++ b/test/gapic-v1.js @@ -44,6 +44,11 @@ describe('ImageAnnotatorClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new visionModule.v1.ImageAnnotatorClient({fallback: true}); + assert(client); + }); + describe('batchAnnotateImages', () => { it('invokes batchAnnotateImages without error', done => { const client = new visionModule.v1.ImageAnnotatorClient({ @@ -360,6 +365,11 @@ describe('ProductSearchClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new visionModule.v1.ProductSearchClient({fallback: true}); + assert(client); + }); + describe('createProductSet', () => { it('invokes createProductSet without error', done => { const client = new visionModule.v1.ProductSearchClient({ diff --git a/test/gapic-v1p1beta1.js b/test/gapic-v1p1beta1.js index e6bbc992..3a9438f0 100644 --- a/test/gapic-v1p1beta1.js +++ b/test/gapic-v1p1beta1.js @@ -44,6 +44,13 @@ describe('ImageAnnotatorClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new visionModule.v1p1beta1.ImageAnnotatorClient({ + fallback: true, + }); + assert(client); + }); + describe('batchAnnotateImages', () => { it('invokes batchAnnotateImages without error', done => { const client = new visionModule.v1p1beta1.ImageAnnotatorClient({ diff --git a/test/gapic-v1p2beta1.js b/test/gapic-v1p2beta1.js index eca8d7f7..c1549b98 100644 --- a/test/gapic-v1p2beta1.js +++ b/test/gapic-v1p2beta1.js @@ -44,6 +44,13 @@ describe('ImageAnnotatorClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new visionModule.v1p2beta1.ImageAnnotatorClient({ + fallback: true, + }); + assert(client); + }); + describe('batchAnnotateImages', () => { it('invokes batchAnnotateImages without error', done => { const client = new visionModule.v1p2beta1.ImageAnnotatorClient({ diff --git a/test/gapic-v1p3beta1.js b/test/gapic-v1p3beta1.js index 7ce712ed..94cd12fb 100644 --- a/test/gapic-v1p3beta1.js +++ b/test/gapic-v1p3beta1.js @@ -44,6 +44,13 @@ describe('ProductSearchClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new visionModule.v1p3beta1.ProductSearchClient({ + fallback: true, + }); + assert(client); + }); + describe('createProductSet', () => { it('invokes createProductSet without error', done => { const client = new visionModule.v1p3beta1.ProductSearchClient({ @@ -1319,6 +1326,13 @@ describe('ImageAnnotatorClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new visionModule.v1p3beta1.ImageAnnotatorClient({ + fallback: true, + }); + assert(client); + }); + describe('batchAnnotateImages', () => { it('invokes batchAnnotateImages without error', done => { const client = new visionModule.v1p3beta1.ImageAnnotatorClient({ diff --git a/test/gapic-v1p4beta1.js b/test/gapic-v1p4beta1.js index 40ae7733..a5b7c779 100644 --- a/test/gapic-v1p4beta1.js +++ b/test/gapic-v1p4beta1.js @@ -44,6 +44,13 @@ describe('ProductSearchClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new visionModule.v1p4beta1.ProductSearchClient({ + fallback: true, + }); + assert(client); + }); + describe('createProductSet', () => { it('invokes createProductSet without error', done => { const client = new visionModule.v1p4beta1.ProductSearchClient({ @@ -1319,6 +1326,13 @@ describe('ImageAnnotatorClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new visionModule.v1p4beta1.ImageAnnotatorClient({ + fallback: true, + }); + assert(client); + }); + describe('batchAnnotateImages', () => { it('invokes batchAnnotateImages without error', done => { const client = new visionModule.v1p4beta1.ImageAnnotatorClient({ diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 00000000..68570f9f --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,46 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + entry: './src/browser.js', + output: { + library: 'vision', + filename: './vision.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + extensions: ['.js', '.json'], + }, + module: { + rules: [ + { + test: /node_modules[\\/]retry-request[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https-proxy-agent[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken[\\/]/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +};