openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 244 kB
JSON
{"openapi":"3.0.0","servers":[{"url":"https://vision.googleapis.com/"}],"info":{"contact":{"name":"Google","url":"https://google.com","x-twitter":"youtube"},"description":"Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications.","license":{"name":"Creative Commons Attribution 3.0","url":"http://creativecommons.org/licenses/by/3.0/"},"termsOfService":"https://developers.google.com/terms/","title":"Cloud Vision API","version":"v1p1beta1","x-apiClientRegistration":{"url":"https://console.developers.google.com"},"x-apisguru-categories":["analytics","media"],"x-logo":{"url":"https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"},"x-origin":[{"format":"google","url":"https://vision.googleapis.com/$discovery/rest?version=v1p1beta1","version":"v1"}],"x-preferred":true,"x-providerName":"googleapis.com","x-serviceName":"vision"},"externalDocs":{"url":"https://cloud.google.com/vision/"},"tags":[{"name":"files"},{"name":"images"},{"name":"projects"}],"paths":{"/v1p1beta1/files:annotate":{"parameters":[{"$ref":"#/components/parameters/_.xgafv"},{"$ref":"#/components/parameters/access_token"},{"$ref":"#/components/parameters/alt"},{"$ref":"#/components/parameters/callback"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/key"},{"$ref":"#/components/parameters/oauth_token"},{"$ref":"#/components/parameters/prettyPrint"},{"$ref":"#/components/parameters/quotaUser"},{"$ref":"#/components/parameters/upload_protocol"},{"$ref":"#/components/parameters/uploadType"}],"post":{"description":"Service that performs image detection and annotation for a batch of files. Now only \"application/pdf\", \"image/tiff\" and \"image/gif\" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted.","operationId":"vision.files.annotate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse"}}},"description":"Successful response"}},"security":[{"Oauth2":["https://www.googleapis.com/auth/cloud-platform"],"Oauth2c":["https://www.googleapis.com/auth/cloud-platform"]},{"Oauth2":["https://www.googleapis.com/auth/cloud-vision"],"Oauth2c":["https://www.googleapis.com/auth/cloud-vision"]}],"tags":["files"]}},"/v1p1beta1/files:asyncBatchAnnotate":{"parameters":[{"$ref":"#/components/parameters/_.xgafv"},{"$ref":"#/components/parameters/access_token"},{"$ref":"#/components/parameters/alt"},{"$ref":"#/components/parameters/callback"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/key"},{"$ref":"#/components/parameters/oauth_token"},{"$ref":"#/components/parameters/prettyPrint"},{"$ref":"#/components/parameters/quotaUser"},{"$ref":"#/components/parameters/upload_protocol"},{"$ref":"#/components/parameters/uploadType"}],"post":{"description":"Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).","operationId":"vision.files.asyncBatchAnnotate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}},"description":"Successful response"}},"security":[{"Oauth2":["https://www.googleapis.com/auth/cloud-platform"],"Oauth2c":["https://www.googleapis.com/auth/cloud-platform"]},{"Oauth2":["https://www.googleapis.com/auth/cloud-vision"],"Oauth2c":["https://www.googleapis.com/auth/cloud-vision"]}],"tags":["files"]}},"/v1p1beta1/images:annotate":{"parameters":[{"$ref":"#/components/parameters/_.xgafv"},{"$ref":"#/components/parameters/access_token"},{"$ref":"#/components/parameters/alt"},{"$ref":"#/components/parameters/callback"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/key"},{"$ref":"#/components/parameters/oauth_token"},{"$ref":"#/components/parameters/prettyPrint"},{"$ref":"#/components/parameters/quotaUser"},{"$ref":"#/components/parameters/upload_protocol"},{"$ref":"#/components/parameters/uploadType"}],"post":{"description":"Run image detection and annotation for a batch of images.","operationId":"vision.images.annotate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse"}}},"description":"Successful response"}},"security":[{"Oauth2":["https://www.googleapis.com/auth/cloud-platform"],"Oauth2c":["https://www.googleapis.com/auth/cloud-platform"]},{"Oauth2":["https://www.googleapis.com/auth/cloud-vision"],"Oauth2c":["https://www.googleapis.com/auth/cloud-vision"]}],"tags":["images"]}},"/v1p1beta1/images:asyncBatchAnnotate":{"parameters":[{"$ref":"#/components/parameters/_.xgafv"},{"$ref":"#/components/parameters/access_token"},{"$ref":"#/components/parameters/alt"},{"$ref":"#/components/parameters/callback"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/key"},{"$ref":"#/components/parameters/oauth_token"},{"$ref":"#/components/parameters/prettyPrint"},{"$ref":"#/components/parameters/quotaUser"},{"$ref":"#/components/parameters/upload_protocol"},{"$ref":"#/components/parameters/uploadType"}],"post":{"description":"Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto.","operationId":"vision.images.asyncBatchAnnotate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}},"description":"Successful response"}},"security":[{"Oauth2":["https://www.googleapis.com/auth/cloud-platform"],"Oauth2c":["https://www.googleapis.com/auth/cloud-platform"]},{"Oauth2":["https://www.googleapis.com/auth/cloud-vision"],"Oauth2c":["https://www.googleapis.com/auth/cloud-vision"]}],"tags":["images"]}},"/v1p1beta1/{parent}/files:annotate":{"parameters":[{"$ref":"#/components/parameters/_.xgafv"},{"$ref":"#/components/parameters/access_token"},{"$ref":"#/components/parameters/alt"},{"$ref":"#/components/parameters/callback"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/key"},{"$ref":"#/components/parameters/oauth_token"},{"$ref":"#/components/parameters/prettyPrint"},{"$ref":"#/components/parameters/quotaUser"},{"$ref":"#/components/parameters/upload_protocol"},{"$ref":"#/components/parameters/uploadType"}],"post":{"description":"Service that performs image detection and annotation for a batch of files. Now only \"application/pdf\", \"image/tiff\" and \"image/gif\" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted.","operationId":"vision.projects.locations.files.annotate","parameters":[{"description":"Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.","in":"path","name":"parent","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse"}}},"description":"Successful response"}},"security":[{"Oauth2":["https://www.googleapis.com/auth/cloud-platform"],"Oauth2c":["https://www.googleapis.com/auth/cloud-platform"]},{"Oauth2":["https://www.googleapis.com/auth/cloud-vision"],"Oauth2c":["https://www.googleapis.com/auth/cloud-vision"]}],"tags":["projects"]}},"/v1p1beta1/{parent}/files:asyncBatchAnnotate":{"parameters":[{"$ref":"#/components/parameters/_.xgafv"},{"$ref":"#/components/parameters/access_token"},{"$ref":"#/components/parameters/alt"},{"$ref":"#/components/parameters/callback"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/key"},{"$ref":"#/components/parameters/oauth_token"},{"$ref":"#/components/parameters/prettyPrint"},{"$ref":"#/components/parameters/quotaUser"},{"$ref":"#/components/parameters/upload_protocol"},{"$ref":"#/components/parameters/uploadType"}],"post":{"description":"Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).","operationId":"vision.projects.locations.files.asyncBatchAnnotate","parameters":[{"description":"Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.","in":"path","name":"parent","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}},"description":"Successful response"}},"security":[{"Oauth2":["https://www.googleapis.com/auth/cloud-platform"],"Oauth2c":["https://www.googleapis.com/auth/cloud-platform"]},{"Oauth2":["https://www.googleapis.com/auth/cloud-vision"],"Oauth2c":["https://www.googleapis.com/auth/cloud-vision"]}],"tags":["projects"]}},"/v1p1beta1/{parent}/images:annotate":{"parameters":[{"$ref":"#/components/parameters/_.xgafv"},{"$ref":"#/components/parameters/access_token"},{"$ref":"#/components/parameters/alt"},{"$ref":"#/components/parameters/callback"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/key"},{"$ref":"#/components/parameters/oauth_token"},{"$ref":"#/components/parameters/prettyPrint"},{"$ref":"#/components/parameters/quotaUser"},{"$ref":"#/components/parameters/upload_protocol"},{"$ref":"#/components/parameters/uploadType"}],"post":{"description":"Run image detection and annotation for a batch of images.","operationId":"vision.projects.locations.images.annotate","parameters":[{"description":"Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.","in":"path","name":"parent","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse"}}},"description":"Successful response"}},"security":[{"Oauth2":["https://www.googleapis.com/auth/cloud-platform"],"Oauth2c":["https://www.googleapis.com/auth/cloud-platform"]},{"Oauth2":["https://www.googleapis.com/auth/cloud-vision"],"Oauth2c":["https://www.googleapis.com/auth/cloud-vision"]}],"tags":["projects"]}},"/v1p1beta1/{parent}/images:asyncBatchAnnotate":{"parameters":[{"$ref":"#/components/parameters/_.xgafv"},{"$ref":"#/components/parameters/access_token"},{"$ref":"#/components/parameters/alt"},{"$ref":"#/components/parameters/callback"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/key"},{"$ref":"#/components/parameters/oauth_token"},{"$ref":"#/components/parameters/prettyPrint"},{"$ref":"#/components/parameters/quotaUser"},{"$ref":"#/components/parameters/upload_protocol"},{"$ref":"#/components/parameters/uploadType"}],"post":{"description":"Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto.","operationId":"vision.projects.locations.images.asyncBatchAnnotate","parameters":[{"description":"Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.","in":"path","name":"parent","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}},"description":"Successful response"}},"security":[{"Oauth2":["https://www.googleapis.com/auth/cloud-platform"],"Oauth2c":["https://www.googleapis.com/auth/cloud-platform"]},{"Oauth2":["https://www.googleapis.com/auth/cloud-vision"],"Oauth2c":["https://www.googleapis.com/auth/cloud-vision"]}],"tags":["projects"]}}},"components":{"parameters":{"_.xgafv":{"description":"V1 error format.","in":"query","name":"$.xgafv","schema":{"enum":["1","2"],"type":"string"}},"access_token":{"description":"OAuth access token.","in":"query","name":"access_token","schema":{"type":"string"}},"alt":{"description":"Data format for response.","in":"query","name":"alt","schema":{"enum":["json","media","proto"],"type":"string"}},"callback":{"description":"JSONP","in":"query","name":"callback","schema":{"type":"string"}},"fields":{"description":"Selector specifying which fields to include in a partial response.","in":"query","name":"fields","schema":{"type":"string"}},"key":{"description":"API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.","in":"query","name":"key","schema":{"type":"string"}},"oauth_token":{"description":"OAuth 2.0 token for the current user.","in":"query","name":"oauth_token","schema":{"type":"string"}},"prettyPrint":{"description":"Returns response with indentations and line breaks.","in":"query","name":"prettyPrint","schema":{"type":"boolean"}},"quotaUser":{"description":"Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.","in":"query","name":"quotaUser","schema":{"type":"string"}},"uploadType":{"description":"Legacy upload protocol for media (e.g. \"media\", \"multipart\").","in":"query","name":"uploadType","schema":{"type":"string"}},"upload_protocol":{"description":"Upload protocol for media (e.g. \"raw\", \"multipart\").","in":"query","name":"upload_protocol","schema":{"type":"string"}}},"schemas":{"AnnotateFileResponse":{"description":"Response to a single file annotation request. A file may contain one or more images, which individually have their own responses.","properties":{"error":{"$ref":"#/components/schemas/Status","description":"If set, represents the error message for the failed request. The `responses` field will not be set in this case."},"inputConfig":{"$ref":"#/components/schemas/InputConfig","description":"Information about the file for which this response is generated."},"responses":{"description":"Individual responses to images found within the file. This field will be empty if the `error` field is set.","items":{"$ref":"#/components/schemas/AnnotateImageResponse"},"type":"array"},"totalPages":{"description":"This field gives the total number of pages in the file.","format":"int32","type":"integer"}},"type":"object"},"AnnotateImageResponse":{"description":"Response to an image annotation request.","properties":{"context":{"$ref":"#/components/schemas/ImageAnnotationContext","description":"If present, contextual information is needed to understand where this image comes from."},"cropHintsAnnotation":{"$ref":"#/components/schemas/CropHintsAnnotation","description":"If present, crop hints have completed successfully."},"error":{"$ref":"#/components/schemas/Status","description":"If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be correct, even when `error` is set."},"faceAnnotations":{"description":"If present, face detection has completed successfully.","items":{"$ref":"#/components/schemas/FaceAnnotation"},"type":"array"},"fullTextAnnotation":{"$ref":"#/components/schemas/TextAnnotation","description":"If present, text (OCR) detection or document (OCR) text detection has completed successfully. This annotation provides the structural hierarchy for the OCR detected text."},"imagePropertiesAnnotation":{"$ref":"#/components/schemas/ImageProperties","description":"If present, image properties were extracted successfully."},"labelAnnotations":{"description":"If present, label detection has completed successfully.","items":{"$ref":"#/components/schemas/EntityAnnotation"},"type":"array"},"landmarkAnnotations":{"description":"If present, landmark detection has completed successfully.","items":{"$ref":"#/components/schemas/EntityAnnotation"},"type":"array"},"localizedObjectAnnotations":{"description":"If present, localized object detection has completed successfully. This will be sorted descending by confidence score.","items":{"$ref":"#/components/schemas/LocalizedObjectAnnotation"},"type":"array"},"logoAnnotations":{"description":"If present, logo detection has completed successfully.","items":{"$ref":"#/components/schemas/EntityAnnotation"},"type":"array"},"productSearchResults":{"$ref":"#/components/schemas/ProductSearchResults","description":"If present, product search has completed successfully."},"safeSearchAnnotation":{"$ref":"#/components/schemas/SafeSearchAnnotation","description":"If present, safe-search annotation has completed successfully."},"textAnnotations":{"description":"If present, text (OCR) detection has completed successfully.","items":{"$ref":"#/components/schemas/EntityAnnotation"},"type":"array"},"webDetection":{"$ref":"#/components/schemas/WebDetection","description":"If present, web detection has completed successfully."}},"type":"object"},"AsyncAnnotateFileResponse":{"description":"The response for a single offline file annotation request.","properties":{"outputConfig":{"$ref":"#/components/schemas/OutputConfig","description":"The output location and metadata from AsyncAnnotateFileRequest."}},"type":"object"},"AsyncBatchAnnotateFilesResponse":{"description":"Response to an async batch file annotation request.","properties":{"responses":{"description":"The list of file annotation responses, one for each request in AsyncBatchAnnotateFilesRequest.","items":{"$ref":"#/components/schemas/AsyncAnnotateFileResponse"},"type":"array"}},"type":"object"},"AsyncBatchAnnotateImagesResponse":{"description":"Response to an async batch image annotation request.","properties":{"outputConfig":{"$ref":"#/components/schemas/OutputConfig","description":"The output location and metadata from AsyncBatchAnnotateImagesRequest."}},"type":"object"},"BatchAnnotateFilesResponse":{"description":"A list of file annotation responses.","properties":{"responses":{"description":"The list of file annotation responses, each response corresponding to each AnnotateFileRequest in BatchAnnotateFilesRequest.","items":{"$ref":"#/components/schemas/AnnotateFileResponse"},"type":"array"}},"type":"object"},"BatchOperationMetadata":{"description":"Metadata for the batch operations such as the current state. This is included in the `metadata` field of the `Operation` returned by the `GetOperation` call of the `google::longrunning::Operations` service.","properties":{"endTime":{"description":"The time when the batch request is finished and google.longrunning.Operation.done is set to true.","format":"google-datetime","type":"string"},"state":{"description":"The current state of the batch operation.","enum":["STATE_UNSPECIFIED","PROCESSING","SUCCESSFUL","FAILED","CANCELLED"],"type":"string"},"submitTime":{"description":"The time when the batch request was submitted to the server.","format":"google-datetime","type":"string"}},"type":"object"},"Block":{"description":"Logical element on the page.","properties":{"blockType":{"description":"Detected block type (text, image etc) for this block.","enum":["UNKNOWN","TEXT","TABLE","PICTURE","RULER","BARCODE"],"type":"string"},"boundingBox":{"$ref":"#/components/schemas/BoundingPoly","description":"The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: * when the text is horizontal it might look like: 0----1 | | 3----2 * when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3)."},"confidence":{"description":"Confidence of the OCR results on the block. Range [0, 1].","format":"float","type":"number"},"paragraphs":{"description":"List of paragraphs in this block (if this blocks is of type text).","items":{"$ref":"#/components/schemas/Paragraph"},"type":"array"},"property":{"$ref":"#/components/schemas/TextProperty","description":"Additional information detected for the block."}},"type":"object"},"BoundingPoly":{"description":"A bounding polygon for the detected image annotation.","properties":{"normalizedVertices":{"description":"The bounding polygon normalized vertices.","items":{"$ref":"#/components/schemas/NormalizedVertex"},"type":"array"},"vertices":{"description":"The bounding polygon vertices.","items":{"$ref":"#/components/schemas/Vertex"},"type":"array"}},"type":"object"},"Color":{"description":"Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most `1e-5`. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ...","properties":{"alpha":{"description":"The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).","format":"float","type":"number"},"blue":{"description":"The amount of blue in the color as a value in the interval [0, 1].","format":"float","type":"number"},"green":{"description":"The amount of green in the color as a value in the interval [0, 1].","format":"float","type":"number"},"red":{"description":"The amount of red in the color as a value in the interval [0, 1].","format":"float","type":"number"}},"type":"object"},"ColorInfo":{"description":"Color information consists of RGB channels, score, and the fraction of the image that the color occupies in the image.","properties":{"color":{"$ref":"#/components/schemas/Color","description":"RGB components of the color."},"pixelFraction":{"description":"The fraction of pixels the color occupies in the image. Value in range [0, 1].","format":"float","type":"number"},"score":{"description":"Image-specific score for this color. Value in range [0, 1].","format":"float","type":"number"}},"type":"object"},"CropHint":{"description":"Single crop hint that is used to generate a new crop when serving an image.","properties":{"boundingPoly":{"$ref":"#/components/schemas/BoundingPoly","description":"The bounding polygon for the crop region. The coordinates of the bounding box are in the original image's scale."},"confidence":{"description":"Confidence of this being a salient region. Range [0, 1].","format":"float","type":"number"},"importanceFraction":{"description":"Fraction of importance of this salient region with respect to the original image.","format":"float","type":"number"}},"type":"object"},"CropHintsAnnotation":{"description":"Set of crop hints that are used to generate new crops when serving images.","properties":{"cropHints":{"description":"Crop hint results.","items":{"$ref":"#/components/schemas/CropHint"},"type":"array"}},"type":"object"},"DetectedBreak":{"description":"Detected start or end of a structural component.","properties":{"isPrefix":{"description":"True if break prepends the element.","type":"boolean"},"type":{"description":"Detected break type.","enum":["UNKNOWN","SPACE","SURE_SPACE","EOL_SURE_SPACE","HYPHEN","LINE_BREAK"],"type":"string"}},"type":"object"},"DetectedLanguage":{"description":"Detected language for a structural component.","properties":{"confidence":{"description":"Confidence of detected language. Range [0, 1].","format":"float","type":"number"},"languageCode":{"description":"The BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.","type":"string"}},"type":"object"},"DominantColorsAnnotation":{"description":"Set of dominant colors and their corresponding scores.","properties":{"colors":{"description":"RGB color values with their score and pixel fraction.","items":{"$ref":"#/components/schemas/ColorInfo"},"type":"array"}},"type":"object"},"EntityAnnotation":{"description":"Set of detected entity features.","properties":{"boundingPoly":{"$ref":"#/components/schemas/BoundingPoly","description":"Image region to which this entity belongs. Not produced for `LABEL_DETECTION` features."},"confidence":{"deprecated":true,"description":"**Deprecated. Use `score` instead.** The accuracy of the entity detection in an image. For example, for an image in which the \"Eiffel Tower\" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1].","format":"float","type":"number"},"description":{"description":"Entity textual description, expressed in its `locale` language.","type":"string"},"locale":{"description":"The language code for the locale in which the entity textual `description` is expressed.","type":"string"},"locations":{"description":"The location information for the detected entity. Multiple `LocationInfo` elements can be present because one location may indicate the location of the scene in the image, and another location may indicate the location of the place where the image was taken. Location information is usually present for landmarks.","items":{"$ref":"#/components/schemas/LocationInfo"},"type":"array"},"mid":{"description":"Opaque entity ID. Some IDs may be available in [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).","type":"string"},"properties":{"description":"Some entities may have optional user-supplied `Property` (name/value) fields, such a score or string that qualifies the entity.","items":{"$ref":"#/components/schemas/Property"},"type":"array"},"score":{"description":"Overall score of the result. Range [0, 1].","format":"float","type":"number"},"topicality":{"description":"The relevancy of the ICA (Image Content Annotation) label to the image. For example, the relevancy of \"tower\" is likely higher to an image containing the detected \"Eiffel Tower\" than to an image containing a detected distant towering building, even though the confidence that there is a tower in each image may be the same. Range [0, 1].","format":"float","type":"number"}},"type":"object"},"FaceAnnotation":{"description":"A face annotation object contains the results of face detection.","properties":{"angerLikelihood":{"description":"Anger likelihood.","enum":["UNKNOWN","VERY_UNLIKELY","UNLIKELY","POSSIBLE","LIKELY","VERY_LIKELY"],"type":"string"},"blurredLikelihood":{"description":"Blurred likelihood.","enum":["UNKNOWN","VERY_UNLIKELY","UNLIKELY","POSSIBLE","LIKELY","VERY_LIKELY"],"type":"string"},"boundingPoly":{"$ref":"#/components/schemas/BoundingPoly","description":"The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale. The bounding box is computed to \"frame\" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y coordinates may not be generated in the `BoundingPoly` (the polygon will be unbounded) if only a partial face appears in the image to be annotated."},"detectionConfidence":{"description":"Detection confidence. Range [0, 1].","format":"float","type":"number"},"fdBoundingPoly":{"$ref":"#/components/schemas/BoundingPoly","description":"The `fd_bounding_poly` bounding polygon is tighter than the `boundingPoly`, and encloses only the skin part of the face. Typically, it is used to eliminate the face from any image analysis that detects the \"amount of skin\" visible in an image. It is not based on the landmarker results, only on the initial face detection, hence the fd (face detection) prefix."},"headwearLikelihood":{"description":"Headwear likelihood.","enum":["UNKNOWN","VERY_UNLIKELY","UNLIKELY","POSSIBLE","LIKELY","VERY_LIKELY"],"type":"string"},"joyLikelihood":{"description":"Joy likelihood.","enum":["UNKNOWN","VERY_UNLIKELY","UNLIKELY","POSSIBLE","LIKELY","VERY_LIKELY"],"type":"string"},"landmarkingConfidence":{"description":"Face landmarking confidence. Range [0, 1].","format":"float","type":"number"},"landmarks":{"description":"Detected face landmarks.","items":{"$ref":"#/components/schemas/Landmark"},"type":"array"},"panAngle":{"description":"Yaw angle, which indicates the leftward/rightward angle that the face is pointing relative to the vertical plane perpendicular to the image. Range [-180,180].","format":"float","type":"number"},"rollAngle":{"description":"Roll angle, which indicates the amount of clockwise/anti-clockwise rotation of the face relative to the image vertical about the axis perpendicular to the face. Range [-180,180].","format":"float","type":"number"},"sorrowLikelihood":{"description":"Sorrow likelihood.","enum":["UNKNOWN","VERY_UNLIKELY","UNLIKELY","POSSIBLE","LIKELY","VERY_LIKELY"],"type":"string"},"surpriseLikelihood":{"description":"Surprise likelihood.","enum":["UNKNOWN","VERY_UNLIKELY","UNLIKELY","POSSIBLE","LIKELY","VERY_LIKELY"],"type":"string"},"tiltAngle":{"description":"Pitch angle, which indicates the upwards/downwards angle that the face is pointing relative to the image's horizontal plane. Range [-180,180].","format":"float","type":"number"},"underExposedLikelihood":{"description":"Under-exposed likelihood.","enum":["UNKNOWN","VERY_UNLIKELY","UNLIKELY","POSSIBLE","LIKELY","VERY_LIKELY"],"type":"string"}},"type":"object"},"GcsDestination":{"description":"The Google Cloud Storage location where the output will be written to.","properties":{"uri":{"description":"Google Cloud Storage URI prefix where the results will be stored. Results will be in JSON format and preceded by its corresponding input URI prefix. This field can either represent a gcs file prefix or gcs directory. In either case, the uri should be unique because in order to get all of the output files, you will need to do a wildcard gcs search on the uri prefix you provide. Examples: * File Prefix: gs://bucket-name/here/filenameprefix The output files will be created in gs://bucket-name/here/ and the names of the output files will begin with \"filenameprefix\". * Directory Prefix: gs://bucket-name/some/location/ The output files will be created in gs://bucket-name/some/location/ and the names of the output files could be anything because there was no filename prefix specified. If multiple outputs, each response is still AnnotateFileResponse, each of which contains some subset of the full list of AnnotateImageResponse. Multiple outputs can happen if, for example, the output JSON is too large and overflows into multiple sharded files.","type":"string"}},"type":"object"},"GcsSource":{"description":"The Google Cloud Storage location where the input will be read from.","properties":{"uri":{"description":"Google Cloud Storage URI for the input file. This must only be a Google Cloud Storage object. Wildcards are not currently supported.","type":"string"}},"type":"object"},"GoogleCloudVisionV1p1beta1AnnotateFileRequest":{"description":"A request to annotate one single file, e.g. a PDF, TIFF or GIF file.","properties":{"features":{"description":"Required. Requested features.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1Feature"},"type":"array"},"imageContext":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1ImageContext","description":"Additional context that may accompany the image(s) in the file."},"inputConfig":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1InputConfig","description":"Required. Information about the input file."},"pages":{"description":"Pages of the file to perform image annotation. Pages starts from 1, we assume the first page of the file is page 1. At most 5 pages are supported per request. Pages can be negative. Page 1 means the first page. Page 2 means the second page. Page -1 means the last page. Page -2 means the second to the last page. If the file is GIF instead of PDF or TIFF, page refers to GIF frames. If this field is empty, by default the service performs image annotation for the first 5 pages of the file.","items":{"format":"int32","type":"integer"},"type":"array"}},"type":"object"},"GoogleCloudVisionV1p1beta1AnnotateFileResponse":{"description":"Response to a single file annotation request. A file may contain one or more images, which individually have their own responses.","properties":{"error":{"$ref":"#/components/schemas/Status","description":"If set, represents the error message for the failed request. The `responses` field will not be set in this case."},"inputConfig":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1InputConfig","description":"Information about the file for which this response is generated."},"responses":{"description":"Individual responses to images found within the file. This field will be empty if the `error` field is set.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1AnnotateImageResponse"},"type":"array"},"totalPages":{"description":"This field gives the total number of pages in the file.","format":"int32","type":"integer"}},"type":"object"},"GoogleCloudVisionV1p1beta1AnnotateImageRequest":{"description":"Request for performing Google Cloud Vision API tasks over a user-provided image, with user-requested features, and with context information.","properties":{"features":{"description":"Requested features.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1Feature"},"type":"array"},"image":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1Image","description":"The image to be processed."},"imageContext":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1ImageContext","description":"Additional context that may accompany the image."}},"type":"object"},"GoogleCloudVisionV1p1beta1AnnotateImageResponse":{"description":"Response to an image annotation request.","properties":{"context":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1ImageAnnotationContext","description":"If present, contextual information is needed to understand where this image comes from."},"cropHintsAnnotation":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1CropHintsAnnotation","description":"If present, crop hints have completed successfully."},"error":{"$ref":"#/components/schemas/Status","description":"If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be correct, even when `error` is set."},"faceAnnotations":{"description":"If present, face detection has completed successfully.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1FaceAnnotation"},"type":"array"},"fullTextAnnotation":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1TextAnnotation","description":"If present, text (OCR) detection or document (OCR) text detection has completed successfully. This annotation provides the structural hierarchy for the OCR detected text."},"imagePropertiesAnnotation":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1ImageProperties","description":"If present, image properties were extracted successfully."},"labelAnnotations":{"description":"If present, label detection has completed successfully.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1EntityAnnotation"},"type":"array"},"landmarkAnnotations":{"description":"If present, landmark detection has completed successfully.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1EntityAnnotation"},"type":"array"},"localizedObjectAnnotations":{"description":"If present, localized object detection has completed successfully. This will be sorted descending by confidence score.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation"},"type":"array"},"logoAnnotations":{"description":"If present, logo detection has completed successfully.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1EntityAnnotation"},"type":"array"},"productSearchResults":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1ProductSearchResults","description":"If present, product search has completed successfully."},"safeSearchAnnotation":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1SafeSearchAnnotation","description":"If present, safe-search annotation has completed successfully."},"textAnnotations":{"description":"If present, text (OCR) detection has completed successfully.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1EntityAnnotation"},"type":"array"},"webDetection":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1WebDetection","description":"If present, web detection has completed successfully."}},"type":"object"},"GoogleCloudVisionV1p1beta1AsyncAnnotateFileRequest":{"description":"An offline file annotation request.","properties":{"features":{"description":"Required. Requested features.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1Feature"},"type":"array"},"imageContext":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1ImageContext","description":"Additional context that may accompany the image(s) in the file."},"inputConfig":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1InputConfig","description":"Required. Information about the input file."},"outputConfig":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1OutputConfig","description":"Required. The desired output location and metadata (e.g. format)."}},"type":"object"},"GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse":{"description":"The response for a single offline file annotation request.","properties":{"outputConfig":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1OutputConfig","description":"The output location and metadata from AsyncAnnotateFileRequest."}},"type":"object"},"GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesRequest":{"description":"Multiple async file annotation requests are batched into a single service call.","properties":{"labels":{"additionalProperties":{"type":"string"},"description":"Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.","type":"object"},"parent":{"description":"Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.","type":"string"},"requests":{"description":"Required. Individual async file annotation requests for this batch.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1AsyncAnnotateFileRequest"},"type":"array"}},"type":"object"},"GoogleCloudVisionV1p1beta1AsyncBatchAnnotateFilesResponse":{"description":"Response to an async batch file annotation request.","properties":{"responses":{"description":"The list of file annotation responses, one for each request in AsyncBatchAnnotateFilesRequest.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1AsyncAnnotateFileResponse"},"type":"array"}},"type":"object"},"GoogleCloudVisionV1p1beta1AsyncBatchAnnotateImagesRequest":{"description":"Request for async image annotation for a list of images.","properties":{"labels":{"additionalProperties":{"type":"string"},"description":"Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.","type":"object"},"outputConfig":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1OutputConfig","description":"Required. The desired output location and metadata (e.g. format)."},"parent":{"description":"Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.","type":"string"},"requests":{"description":"Required. Individual image annotation requests for this batch.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1AnnotateImageRequest"},"type":"array"}},"type":"object"},"GoogleCloudVisionV1p1beta1BatchAnnotateFilesRequest":{"description":"A list of requests to annotate files using the BatchAnnotateFiles API.","properties":{"labels":{"additionalProperties":{"type":"string"},"description":"Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.","type":"object"},"parent":{"description":"Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.","type":"string"},"requests":{"description":"Required. The list of file annotation requests. Right now we support only one AnnotateFileRequest in BatchAnnotateFilesRequest.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1AnnotateFileRequest"},"type":"array"}},"type":"object"},"GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse":{"description":"A list of file annotation responses.","properties":{"responses":{"description":"The list of file annotation responses, each response corresponding to each AnnotateFileRequest in BatchAnnotateFilesRequest.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1AnnotateFileResponse"},"type":"array"}},"type":"object"},"GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest":{"description":"Multiple image annotation requests are batched into a single service call.","properties":{"labels":{"additionalProperties":{"type":"string"},"description":"Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.","type":"object"},"parent":{"description":"Optional. Target project and location to make a call. Format: `projects/{project-id}/locations/{location-id}`. If no parent is specified, a region will be chosen automatically. Supported location-ids: `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `projects/project-A/locations/eu`.","type":"string"},"requests":{"description":"Required. Individual image annotation requests for this batch.","items":{"$ref":"#/components/schemas/GoogleCloudVisionV1p1beta1AnnotateImageRe