@googleapis/vision 2.0.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/v1.d.ts +2167 -2
- package/build/v1.js +36 -1
- package/build/v1.js.map +1 -1
- package/build/v1p1beta1.d.ts +724 -2
- package/build/v1p1beta1.js +18 -1
- package/build/v1p1beta1.js.map +1 -1
- package/build/v1p2beta1.d.ts +724 -2
- package/build/v1p2beta1.js +18 -1
- package/build/v1p2beta1.js.map +1 -1
- package/package.json +4 -4
- package/v1.ts +2167 -1
- package/v1p1beta1.ts +724 -1
- package/v1p2beta1.ts +724 -1
package/build/v1p2beta1.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
|
|
3
2
|
import { Readable } from 'stream';
|
|
4
3
|
export declare namespace vision_v1p2beta1 {
|
|
@@ -1815,7 +1814,7 @@ export declare namespace vision_v1p2beta1 {
|
|
|
1815
1814
|
*/
|
|
1816
1815
|
maxResults?: number | null;
|
|
1817
1816
|
/**
|
|
1818
|
-
* Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also support "builtin/
|
|
1817
|
+
* Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also support "builtin/rc" for the latest release candidate.
|
|
1819
1818
|
*/
|
|
1820
1819
|
model?: string | null;
|
|
1821
1820
|
/**
|
|
@@ -4975,6 +4974,62 @@ export declare namespace vision_v1p2beta1 {
|
|
|
4975
4974
|
constructor(context: APIRequestContext);
|
|
4976
4975
|
/**
|
|
4977
4976
|
* 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.
|
|
4977
|
+
* @example
|
|
4978
|
+
* ```js
|
|
4979
|
+
* // Before running the sample:
|
|
4980
|
+
* // - Enable the API at:
|
|
4981
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
4982
|
+
* // - Login into gcloud by running:
|
|
4983
|
+
* // ```sh
|
|
4984
|
+
* // $ gcloud auth application-default login
|
|
4985
|
+
* // ```
|
|
4986
|
+
* // - Install the npm module by running:
|
|
4987
|
+
* // ```sh
|
|
4988
|
+
* // $ npm install googleapis
|
|
4989
|
+
* // ```
|
|
4990
|
+
*
|
|
4991
|
+
* const {google} = require('googleapis');
|
|
4992
|
+
* const vision = google.vision('v1p2beta1');
|
|
4993
|
+
*
|
|
4994
|
+
* async function main() {
|
|
4995
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4996
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4997
|
+
* scopes: [
|
|
4998
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4999
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5000
|
+
* ],
|
|
5001
|
+
* });
|
|
5002
|
+
*
|
|
5003
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5004
|
+
* const authClient = await auth.getClient();
|
|
5005
|
+
* google.options({auth: authClient});
|
|
5006
|
+
*
|
|
5007
|
+
* // Do the magic
|
|
5008
|
+
* const res = await vision.files.annotate({
|
|
5009
|
+
* // Request body metadata
|
|
5010
|
+
* requestBody: {
|
|
5011
|
+
* // request body parameters
|
|
5012
|
+
* // {
|
|
5013
|
+
* // "labels": {},
|
|
5014
|
+
* // "parent": "my_parent",
|
|
5015
|
+
* // "requests": []
|
|
5016
|
+
* // }
|
|
5017
|
+
* },
|
|
5018
|
+
* });
|
|
5019
|
+
* console.log(res.data);
|
|
5020
|
+
*
|
|
5021
|
+
* // Example response
|
|
5022
|
+
* // {
|
|
5023
|
+
* // "responses": []
|
|
5024
|
+
* // }
|
|
5025
|
+
* }
|
|
5026
|
+
*
|
|
5027
|
+
* main().catch(e => {
|
|
5028
|
+
* console.error(e);
|
|
5029
|
+
* throw e;
|
|
5030
|
+
* });
|
|
5031
|
+
*
|
|
5032
|
+
* ```
|
|
4978
5033
|
*
|
|
4979
5034
|
* @param params - Parameters for request
|
|
4980
5035
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -4989,6 +5044,66 @@ export declare namespace vision_v1p2beta1 {
|
|
|
4989
5044
|
annotate(callback: BodyResponseCallback<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>): void;
|
|
4990
5045
|
/**
|
|
4991
5046
|
* 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).
|
|
5047
|
+
* @example
|
|
5048
|
+
* ```js
|
|
5049
|
+
* // Before running the sample:
|
|
5050
|
+
* // - Enable the API at:
|
|
5051
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5052
|
+
* // - Login into gcloud by running:
|
|
5053
|
+
* // ```sh
|
|
5054
|
+
* // $ gcloud auth application-default login
|
|
5055
|
+
* // ```
|
|
5056
|
+
* // - Install the npm module by running:
|
|
5057
|
+
* // ```sh
|
|
5058
|
+
* // $ npm install googleapis
|
|
5059
|
+
* // ```
|
|
5060
|
+
*
|
|
5061
|
+
* const {google} = require('googleapis');
|
|
5062
|
+
* const vision = google.vision('v1p2beta1');
|
|
5063
|
+
*
|
|
5064
|
+
* async function main() {
|
|
5065
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5066
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5067
|
+
* scopes: [
|
|
5068
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5069
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5070
|
+
* ],
|
|
5071
|
+
* });
|
|
5072
|
+
*
|
|
5073
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5074
|
+
* const authClient = await auth.getClient();
|
|
5075
|
+
* google.options({auth: authClient});
|
|
5076
|
+
*
|
|
5077
|
+
* // Do the magic
|
|
5078
|
+
* const res = await vision.files.asyncBatchAnnotate({
|
|
5079
|
+
* // Request body metadata
|
|
5080
|
+
* requestBody: {
|
|
5081
|
+
* // request body parameters
|
|
5082
|
+
* // {
|
|
5083
|
+
* // "labels": {},
|
|
5084
|
+
* // "parent": "my_parent",
|
|
5085
|
+
* // "requests": []
|
|
5086
|
+
* // }
|
|
5087
|
+
* },
|
|
5088
|
+
* });
|
|
5089
|
+
* console.log(res.data);
|
|
5090
|
+
*
|
|
5091
|
+
* // Example response
|
|
5092
|
+
* // {
|
|
5093
|
+
* // "done": false,
|
|
5094
|
+
* // "error": {},
|
|
5095
|
+
* // "metadata": {},
|
|
5096
|
+
* // "name": "my_name",
|
|
5097
|
+
* // "response": {}
|
|
5098
|
+
* // }
|
|
5099
|
+
* }
|
|
5100
|
+
*
|
|
5101
|
+
* main().catch(e => {
|
|
5102
|
+
* console.error(e);
|
|
5103
|
+
* throw e;
|
|
5104
|
+
* });
|
|
5105
|
+
*
|
|
5106
|
+
* ```
|
|
4992
5107
|
*
|
|
4993
5108
|
* @param params - Parameters for request
|
|
4994
5109
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5019,6 +5134,62 @@ export declare namespace vision_v1p2beta1 {
|
|
|
5019
5134
|
constructor(context: APIRequestContext);
|
|
5020
5135
|
/**
|
|
5021
5136
|
* Run image detection and annotation for a batch of images.
|
|
5137
|
+
* @example
|
|
5138
|
+
* ```js
|
|
5139
|
+
* // Before running the sample:
|
|
5140
|
+
* // - Enable the API at:
|
|
5141
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5142
|
+
* // - Login into gcloud by running:
|
|
5143
|
+
* // ```sh
|
|
5144
|
+
* // $ gcloud auth application-default login
|
|
5145
|
+
* // ```
|
|
5146
|
+
* // - Install the npm module by running:
|
|
5147
|
+
* // ```sh
|
|
5148
|
+
* // $ npm install googleapis
|
|
5149
|
+
* // ```
|
|
5150
|
+
*
|
|
5151
|
+
* const {google} = require('googleapis');
|
|
5152
|
+
* const vision = google.vision('v1p2beta1');
|
|
5153
|
+
*
|
|
5154
|
+
* async function main() {
|
|
5155
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5156
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5157
|
+
* scopes: [
|
|
5158
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5159
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5160
|
+
* ],
|
|
5161
|
+
* });
|
|
5162
|
+
*
|
|
5163
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5164
|
+
* const authClient = await auth.getClient();
|
|
5165
|
+
* google.options({auth: authClient});
|
|
5166
|
+
*
|
|
5167
|
+
* // Do the magic
|
|
5168
|
+
* const res = await vision.images.annotate({
|
|
5169
|
+
* // Request body metadata
|
|
5170
|
+
* requestBody: {
|
|
5171
|
+
* // request body parameters
|
|
5172
|
+
* // {
|
|
5173
|
+
* // "labels": {},
|
|
5174
|
+
* // "parent": "my_parent",
|
|
5175
|
+
* // "requests": []
|
|
5176
|
+
* // }
|
|
5177
|
+
* },
|
|
5178
|
+
* });
|
|
5179
|
+
* console.log(res.data);
|
|
5180
|
+
*
|
|
5181
|
+
* // Example response
|
|
5182
|
+
* // {
|
|
5183
|
+
* // "responses": []
|
|
5184
|
+
* // }
|
|
5185
|
+
* }
|
|
5186
|
+
*
|
|
5187
|
+
* main().catch(e => {
|
|
5188
|
+
* console.error(e);
|
|
5189
|
+
* throw e;
|
|
5190
|
+
* });
|
|
5191
|
+
*
|
|
5192
|
+
* ```
|
|
5022
5193
|
*
|
|
5023
5194
|
* @param params - Parameters for request
|
|
5024
5195
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5033,6 +5204,67 @@ export declare namespace vision_v1p2beta1 {
|
|
|
5033
5204
|
annotate(callback: BodyResponseCallback<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>): void;
|
|
5034
5205
|
/**
|
|
5035
5206
|
* 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.
|
|
5207
|
+
* @example
|
|
5208
|
+
* ```js
|
|
5209
|
+
* // Before running the sample:
|
|
5210
|
+
* // - Enable the API at:
|
|
5211
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5212
|
+
* // - Login into gcloud by running:
|
|
5213
|
+
* // ```sh
|
|
5214
|
+
* // $ gcloud auth application-default login
|
|
5215
|
+
* // ```
|
|
5216
|
+
* // - Install the npm module by running:
|
|
5217
|
+
* // ```sh
|
|
5218
|
+
* // $ npm install googleapis
|
|
5219
|
+
* // ```
|
|
5220
|
+
*
|
|
5221
|
+
* const {google} = require('googleapis');
|
|
5222
|
+
* const vision = google.vision('v1p2beta1');
|
|
5223
|
+
*
|
|
5224
|
+
* async function main() {
|
|
5225
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5226
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5227
|
+
* scopes: [
|
|
5228
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5229
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5230
|
+
* ],
|
|
5231
|
+
* });
|
|
5232
|
+
*
|
|
5233
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5234
|
+
* const authClient = await auth.getClient();
|
|
5235
|
+
* google.options({auth: authClient});
|
|
5236
|
+
*
|
|
5237
|
+
* // Do the magic
|
|
5238
|
+
* const res = await vision.images.asyncBatchAnnotate({
|
|
5239
|
+
* // Request body metadata
|
|
5240
|
+
* requestBody: {
|
|
5241
|
+
* // request body parameters
|
|
5242
|
+
* // {
|
|
5243
|
+
* // "labels": {},
|
|
5244
|
+
* // "outputConfig": {},
|
|
5245
|
+
* // "parent": "my_parent",
|
|
5246
|
+
* // "requests": []
|
|
5247
|
+
* // }
|
|
5248
|
+
* },
|
|
5249
|
+
* });
|
|
5250
|
+
* console.log(res.data);
|
|
5251
|
+
*
|
|
5252
|
+
* // Example response
|
|
5253
|
+
* // {
|
|
5254
|
+
* // "done": false,
|
|
5255
|
+
* // "error": {},
|
|
5256
|
+
* // "metadata": {},
|
|
5257
|
+
* // "name": "my_name",
|
|
5258
|
+
* // "response": {}
|
|
5259
|
+
* // }
|
|
5260
|
+
* }
|
|
5261
|
+
*
|
|
5262
|
+
* main().catch(e => {
|
|
5263
|
+
* console.error(e);
|
|
5264
|
+
* throw e;
|
|
5265
|
+
* });
|
|
5266
|
+
*
|
|
5267
|
+
* ```
|
|
5036
5268
|
*
|
|
5037
5269
|
* @param params - Parameters for request
|
|
5038
5270
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5070,6 +5302,65 @@ export declare namespace vision_v1p2beta1 {
|
|
|
5070
5302
|
constructor(context: APIRequestContext);
|
|
5071
5303
|
/**
|
|
5072
5304
|
* 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.
|
|
5305
|
+
* @example
|
|
5306
|
+
* ```js
|
|
5307
|
+
* // Before running the sample:
|
|
5308
|
+
* // - Enable the API at:
|
|
5309
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5310
|
+
* // - Login into gcloud by running:
|
|
5311
|
+
* // ```sh
|
|
5312
|
+
* // $ gcloud auth application-default login
|
|
5313
|
+
* // ```
|
|
5314
|
+
* // - Install the npm module by running:
|
|
5315
|
+
* // ```sh
|
|
5316
|
+
* // $ npm install googleapis
|
|
5317
|
+
* // ```
|
|
5318
|
+
*
|
|
5319
|
+
* const {google} = require('googleapis');
|
|
5320
|
+
* const vision = google.vision('v1p2beta1');
|
|
5321
|
+
*
|
|
5322
|
+
* async function main() {
|
|
5323
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5324
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5325
|
+
* scopes: [
|
|
5326
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5327
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5328
|
+
* ],
|
|
5329
|
+
* });
|
|
5330
|
+
*
|
|
5331
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5332
|
+
* const authClient = await auth.getClient();
|
|
5333
|
+
* google.options({auth: authClient});
|
|
5334
|
+
*
|
|
5335
|
+
* // Do the magic
|
|
5336
|
+
* const res = await vision.projects.files.annotate({
|
|
5337
|
+
* // 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`.
|
|
5338
|
+
* parent: 'projects/my-project',
|
|
5339
|
+
*
|
|
5340
|
+
* // Request body metadata
|
|
5341
|
+
* requestBody: {
|
|
5342
|
+
* // request body parameters
|
|
5343
|
+
* // {
|
|
5344
|
+
* // "labels": {},
|
|
5345
|
+
* // "parent": "my_parent",
|
|
5346
|
+
* // "requests": []
|
|
5347
|
+
* // }
|
|
5348
|
+
* },
|
|
5349
|
+
* });
|
|
5350
|
+
* console.log(res.data);
|
|
5351
|
+
*
|
|
5352
|
+
* // Example response
|
|
5353
|
+
* // {
|
|
5354
|
+
* // "responses": []
|
|
5355
|
+
* // }
|
|
5356
|
+
* }
|
|
5357
|
+
*
|
|
5358
|
+
* main().catch(e => {
|
|
5359
|
+
* console.error(e);
|
|
5360
|
+
* throw e;
|
|
5361
|
+
* });
|
|
5362
|
+
*
|
|
5363
|
+
* ```
|
|
5073
5364
|
*
|
|
5074
5365
|
* @param params - Parameters for request
|
|
5075
5366
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5084,6 +5375,69 @@ export declare namespace vision_v1p2beta1 {
|
|
|
5084
5375
|
annotate(callback: BodyResponseCallback<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>): void;
|
|
5085
5376
|
/**
|
|
5086
5377
|
* 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).
|
|
5378
|
+
* @example
|
|
5379
|
+
* ```js
|
|
5380
|
+
* // Before running the sample:
|
|
5381
|
+
* // - Enable the API at:
|
|
5382
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5383
|
+
* // - Login into gcloud by running:
|
|
5384
|
+
* // ```sh
|
|
5385
|
+
* // $ gcloud auth application-default login
|
|
5386
|
+
* // ```
|
|
5387
|
+
* // - Install the npm module by running:
|
|
5388
|
+
* // ```sh
|
|
5389
|
+
* // $ npm install googleapis
|
|
5390
|
+
* // ```
|
|
5391
|
+
*
|
|
5392
|
+
* const {google} = require('googleapis');
|
|
5393
|
+
* const vision = google.vision('v1p2beta1');
|
|
5394
|
+
*
|
|
5395
|
+
* async function main() {
|
|
5396
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5397
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5398
|
+
* scopes: [
|
|
5399
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5400
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5401
|
+
* ],
|
|
5402
|
+
* });
|
|
5403
|
+
*
|
|
5404
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5405
|
+
* const authClient = await auth.getClient();
|
|
5406
|
+
* google.options({auth: authClient});
|
|
5407
|
+
*
|
|
5408
|
+
* // Do the magic
|
|
5409
|
+
* const res = await vision.projects.files.asyncBatchAnnotate({
|
|
5410
|
+
* // 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`.
|
|
5411
|
+
* parent: 'projects/my-project',
|
|
5412
|
+
*
|
|
5413
|
+
* // Request body metadata
|
|
5414
|
+
* requestBody: {
|
|
5415
|
+
* // request body parameters
|
|
5416
|
+
* // {
|
|
5417
|
+
* // "labels": {},
|
|
5418
|
+
* // "parent": "my_parent",
|
|
5419
|
+
* // "requests": []
|
|
5420
|
+
* // }
|
|
5421
|
+
* },
|
|
5422
|
+
* });
|
|
5423
|
+
* console.log(res.data);
|
|
5424
|
+
*
|
|
5425
|
+
* // Example response
|
|
5426
|
+
* // {
|
|
5427
|
+
* // "done": false,
|
|
5428
|
+
* // "error": {},
|
|
5429
|
+
* // "metadata": {},
|
|
5430
|
+
* // "name": "my_name",
|
|
5431
|
+
* // "response": {}
|
|
5432
|
+
* // }
|
|
5433
|
+
* }
|
|
5434
|
+
*
|
|
5435
|
+
* main().catch(e => {
|
|
5436
|
+
* console.error(e);
|
|
5437
|
+
* throw e;
|
|
5438
|
+
* });
|
|
5439
|
+
*
|
|
5440
|
+
* ```
|
|
5087
5441
|
*
|
|
5088
5442
|
* @param params - Parameters for request
|
|
5089
5443
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5122,6 +5476,65 @@ export declare namespace vision_v1p2beta1 {
|
|
|
5122
5476
|
constructor(context: APIRequestContext);
|
|
5123
5477
|
/**
|
|
5124
5478
|
* Run image detection and annotation for a batch of images.
|
|
5479
|
+
* @example
|
|
5480
|
+
* ```js
|
|
5481
|
+
* // Before running the sample:
|
|
5482
|
+
* // - Enable the API at:
|
|
5483
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5484
|
+
* // - Login into gcloud by running:
|
|
5485
|
+
* // ```sh
|
|
5486
|
+
* // $ gcloud auth application-default login
|
|
5487
|
+
* // ```
|
|
5488
|
+
* // - Install the npm module by running:
|
|
5489
|
+
* // ```sh
|
|
5490
|
+
* // $ npm install googleapis
|
|
5491
|
+
* // ```
|
|
5492
|
+
*
|
|
5493
|
+
* const {google} = require('googleapis');
|
|
5494
|
+
* const vision = google.vision('v1p2beta1');
|
|
5495
|
+
*
|
|
5496
|
+
* async function main() {
|
|
5497
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5498
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5499
|
+
* scopes: [
|
|
5500
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5501
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5502
|
+
* ],
|
|
5503
|
+
* });
|
|
5504
|
+
*
|
|
5505
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5506
|
+
* const authClient = await auth.getClient();
|
|
5507
|
+
* google.options({auth: authClient});
|
|
5508
|
+
*
|
|
5509
|
+
* // Do the magic
|
|
5510
|
+
* const res = await vision.projects.images.annotate({
|
|
5511
|
+
* // 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`.
|
|
5512
|
+
* parent: 'projects/my-project',
|
|
5513
|
+
*
|
|
5514
|
+
* // Request body metadata
|
|
5515
|
+
* requestBody: {
|
|
5516
|
+
* // request body parameters
|
|
5517
|
+
* // {
|
|
5518
|
+
* // "labels": {},
|
|
5519
|
+
* // "parent": "my_parent",
|
|
5520
|
+
* // "requests": []
|
|
5521
|
+
* // }
|
|
5522
|
+
* },
|
|
5523
|
+
* });
|
|
5524
|
+
* console.log(res.data);
|
|
5525
|
+
*
|
|
5526
|
+
* // Example response
|
|
5527
|
+
* // {
|
|
5528
|
+
* // "responses": []
|
|
5529
|
+
* // }
|
|
5530
|
+
* }
|
|
5531
|
+
*
|
|
5532
|
+
* main().catch(e => {
|
|
5533
|
+
* console.error(e);
|
|
5534
|
+
* throw e;
|
|
5535
|
+
* });
|
|
5536
|
+
*
|
|
5537
|
+
* ```
|
|
5125
5538
|
*
|
|
5126
5539
|
* @param params - Parameters for request
|
|
5127
5540
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5136,6 +5549,70 @@ export declare namespace vision_v1p2beta1 {
|
|
|
5136
5549
|
annotate(callback: BodyResponseCallback<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>): void;
|
|
5137
5550
|
/**
|
|
5138
5551
|
* 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.
|
|
5552
|
+
* @example
|
|
5553
|
+
* ```js
|
|
5554
|
+
* // Before running the sample:
|
|
5555
|
+
* // - Enable the API at:
|
|
5556
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5557
|
+
* // - Login into gcloud by running:
|
|
5558
|
+
* // ```sh
|
|
5559
|
+
* // $ gcloud auth application-default login
|
|
5560
|
+
* // ```
|
|
5561
|
+
* // - Install the npm module by running:
|
|
5562
|
+
* // ```sh
|
|
5563
|
+
* // $ npm install googleapis
|
|
5564
|
+
* // ```
|
|
5565
|
+
*
|
|
5566
|
+
* const {google} = require('googleapis');
|
|
5567
|
+
* const vision = google.vision('v1p2beta1');
|
|
5568
|
+
*
|
|
5569
|
+
* async function main() {
|
|
5570
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5571
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5572
|
+
* scopes: [
|
|
5573
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5574
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5575
|
+
* ],
|
|
5576
|
+
* });
|
|
5577
|
+
*
|
|
5578
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5579
|
+
* const authClient = await auth.getClient();
|
|
5580
|
+
* google.options({auth: authClient});
|
|
5581
|
+
*
|
|
5582
|
+
* // Do the magic
|
|
5583
|
+
* const res = await vision.projects.images.asyncBatchAnnotate({
|
|
5584
|
+
* // 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`.
|
|
5585
|
+
* parent: 'projects/my-project',
|
|
5586
|
+
*
|
|
5587
|
+
* // Request body metadata
|
|
5588
|
+
* requestBody: {
|
|
5589
|
+
* // request body parameters
|
|
5590
|
+
* // {
|
|
5591
|
+
* // "labels": {},
|
|
5592
|
+
* // "outputConfig": {},
|
|
5593
|
+
* // "parent": "my_parent",
|
|
5594
|
+
* // "requests": []
|
|
5595
|
+
* // }
|
|
5596
|
+
* },
|
|
5597
|
+
* });
|
|
5598
|
+
* console.log(res.data);
|
|
5599
|
+
*
|
|
5600
|
+
* // Example response
|
|
5601
|
+
* // {
|
|
5602
|
+
* // "done": false,
|
|
5603
|
+
* // "error": {},
|
|
5604
|
+
* // "metadata": {},
|
|
5605
|
+
* // "name": "my_name",
|
|
5606
|
+
* // "response": {}
|
|
5607
|
+
* // }
|
|
5608
|
+
* }
|
|
5609
|
+
*
|
|
5610
|
+
* main().catch(e => {
|
|
5611
|
+
* console.error(e);
|
|
5612
|
+
* throw e;
|
|
5613
|
+
* });
|
|
5614
|
+
*
|
|
5615
|
+
* ```
|
|
5139
5616
|
*
|
|
5140
5617
|
* @param params - Parameters for request
|
|
5141
5618
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5180,6 +5657,65 @@ export declare namespace vision_v1p2beta1 {
|
|
|
5180
5657
|
constructor(context: APIRequestContext);
|
|
5181
5658
|
/**
|
|
5182
5659
|
* 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.
|
|
5660
|
+
* @example
|
|
5661
|
+
* ```js
|
|
5662
|
+
* // Before running the sample:
|
|
5663
|
+
* // - Enable the API at:
|
|
5664
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5665
|
+
* // - Login into gcloud by running:
|
|
5666
|
+
* // ```sh
|
|
5667
|
+
* // $ gcloud auth application-default login
|
|
5668
|
+
* // ```
|
|
5669
|
+
* // - Install the npm module by running:
|
|
5670
|
+
* // ```sh
|
|
5671
|
+
* // $ npm install googleapis
|
|
5672
|
+
* // ```
|
|
5673
|
+
*
|
|
5674
|
+
* const {google} = require('googleapis');
|
|
5675
|
+
* const vision = google.vision('v1p2beta1');
|
|
5676
|
+
*
|
|
5677
|
+
* async function main() {
|
|
5678
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5679
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5680
|
+
* scopes: [
|
|
5681
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5682
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5683
|
+
* ],
|
|
5684
|
+
* });
|
|
5685
|
+
*
|
|
5686
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5687
|
+
* const authClient = await auth.getClient();
|
|
5688
|
+
* google.options({auth: authClient});
|
|
5689
|
+
*
|
|
5690
|
+
* // Do the magic
|
|
5691
|
+
* const res = await vision.projects.locations.files.annotate({
|
|
5692
|
+
* // 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`.
|
|
5693
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
5694
|
+
*
|
|
5695
|
+
* // Request body metadata
|
|
5696
|
+
* requestBody: {
|
|
5697
|
+
* // request body parameters
|
|
5698
|
+
* // {
|
|
5699
|
+
* // "labels": {},
|
|
5700
|
+
* // "parent": "my_parent",
|
|
5701
|
+
* // "requests": []
|
|
5702
|
+
* // }
|
|
5703
|
+
* },
|
|
5704
|
+
* });
|
|
5705
|
+
* console.log(res.data);
|
|
5706
|
+
*
|
|
5707
|
+
* // Example response
|
|
5708
|
+
* // {
|
|
5709
|
+
* // "responses": []
|
|
5710
|
+
* // }
|
|
5711
|
+
* }
|
|
5712
|
+
*
|
|
5713
|
+
* main().catch(e => {
|
|
5714
|
+
* console.error(e);
|
|
5715
|
+
* throw e;
|
|
5716
|
+
* });
|
|
5717
|
+
*
|
|
5718
|
+
* ```
|
|
5183
5719
|
*
|
|
5184
5720
|
* @param params - Parameters for request
|
|
5185
5721
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5194,6 +5730,69 @@ export declare namespace vision_v1p2beta1 {
|
|
|
5194
5730
|
annotate(callback: BodyResponseCallback<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>): void;
|
|
5195
5731
|
/**
|
|
5196
5732
|
* 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).
|
|
5733
|
+
* @example
|
|
5734
|
+
* ```js
|
|
5735
|
+
* // Before running the sample:
|
|
5736
|
+
* // - Enable the API at:
|
|
5737
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5738
|
+
* // - Login into gcloud by running:
|
|
5739
|
+
* // ```sh
|
|
5740
|
+
* // $ gcloud auth application-default login
|
|
5741
|
+
* // ```
|
|
5742
|
+
* // - Install the npm module by running:
|
|
5743
|
+
* // ```sh
|
|
5744
|
+
* // $ npm install googleapis
|
|
5745
|
+
* // ```
|
|
5746
|
+
*
|
|
5747
|
+
* const {google} = require('googleapis');
|
|
5748
|
+
* const vision = google.vision('v1p2beta1');
|
|
5749
|
+
*
|
|
5750
|
+
* async function main() {
|
|
5751
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5752
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5753
|
+
* scopes: [
|
|
5754
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5755
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5756
|
+
* ],
|
|
5757
|
+
* });
|
|
5758
|
+
*
|
|
5759
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5760
|
+
* const authClient = await auth.getClient();
|
|
5761
|
+
* google.options({auth: authClient});
|
|
5762
|
+
*
|
|
5763
|
+
* // Do the magic
|
|
5764
|
+
* const res = await vision.projects.locations.files.asyncBatchAnnotate({
|
|
5765
|
+
* // 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`.
|
|
5766
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
5767
|
+
*
|
|
5768
|
+
* // Request body metadata
|
|
5769
|
+
* requestBody: {
|
|
5770
|
+
* // request body parameters
|
|
5771
|
+
* // {
|
|
5772
|
+
* // "labels": {},
|
|
5773
|
+
* // "parent": "my_parent",
|
|
5774
|
+
* // "requests": []
|
|
5775
|
+
* // }
|
|
5776
|
+
* },
|
|
5777
|
+
* });
|
|
5778
|
+
* console.log(res.data);
|
|
5779
|
+
*
|
|
5780
|
+
* // Example response
|
|
5781
|
+
* // {
|
|
5782
|
+
* // "done": false,
|
|
5783
|
+
* // "error": {},
|
|
5784
|
+
* // "metadata": {},
|
|
5785
|
+
* // "name": "my_name",
|
|
5786
|
+
* // "response": {}
|
|
5787
|
+
* // }
|
|
5788
|
+
* }
|
|
5789
|
+
*
|
|
5790
|
+
* main().catch(e => {
|
|
5791
|
+
* console.error(e);
|
|
5792
|
+
* throw e;
|
|
5793
|
+
* });
|
|
5794
|
+
*
|
|
5795
|
+
* ```
|
|
5197
5796
|
*
|
|
5198
5797
|
* @param params - Parameters for request
|
|
5199
5798
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5232,6 +5831,65 @@ export declare namespace vision_v1p2beta1 {
|
|
|
5232
5831
|
constructor(context: APIRequestContext);
|
|
5233
5832
|
/**
|
|
5234
5833
|
* Run image detection and annotation for a batch of images.
|
|
5834
|
+
* @example
|
|
5835
|
+
* ```js
|
|
5836
|
+
* // Before running the sample:
|
|
5837
|
+
* // - Enable the API at:
|
|
5838
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5839
|
+
* // - Login into gcloud by running:
|
|
5840
|
+
* // ```sh
|
|
5841
|
+
* // $ gcloud auth application-default login
|
|
5842
|
+
* // ```
|
|
5843
|
+
* // - Install the npm module by running:
|
|
5844
|
+
* // ```sh
|
|
5845
|
+
* // $ npm install googleapis
|
|
5846
|
+
* // ```
|
|
5847
|
+
*
|
|
5848
|
+
* const {google} = require('googleapis');
|
|
5849
|
+
* const vision = google.vision('v1p2beta1');
|
|
5850
|
+
*
|
|
5851
|
+
* async function main() {
|
|
5852
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5853
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5854
|
+
* scopes: [
|
|
5855
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5856
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5857
|
+
* ],
|
|
5858
|
+
* });
|
|
5859
|
+
*
|
|
5860
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5861
|
+
* const authClient = await auth.getClient();
|
|
5862
|
+
* google.options({auth: authClient});
|
|
5863
|
+
*
|
|
5864
|
+
* // Do the magic
|
|
5865
|
+
* const res = await vision.projects.locations.images.annotate({
|
|
5866
|
+
* // 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`.
|
|
5867
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
5868
|
+
*
|
|
5869
|
+
* // Request body metadata
|
|
5870
|
+
* requestBody: {
|
|
5871
|
+
* // request body parameters
|
|
5872
|
+
* // {
|
|
5873
|
+
* // "labels": {},
|
|
5874
|
+
* // "parent": "my_parent",
|
|
5875
|
+
* // "requests": []
|
|
5876
|
+
* // }
|
|
5877
|
+
* },
|
|
5878
|
+
* });
|
|
5879
|
+
* console.log(res.data);
|
|
5880
|
+
*
|
|
5881
|
+
* // Example response
|
|
5882
|
+
* // {
|
|
5883
|
+
* // "responses": []
|
|
5884
|
+
* // }
|
|
5885
|
+
* }
|
|
5886
|
+
*
|
|
5887
|
+
* main().catch(e => {
|
|
5888
|
+
* console.error(e);
|
|
5889
|
+
* throw e;
|
|
5890
|
+
* });
|
|
5891
|
+
*
|
|
5892
|
+
* ```
|
|
5235
5893
|
*
|
|
5236
5894
|
* @param params - Parameters for request
|
|
5237
5895
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5246,6 +5904,70 @@ export declare namespace vision_v1p2beta1 {
|
|
|
5246
5904
|
annotate(callback: BodyResponseCallback<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>): void;
|
|
5247
5905
|
/**
|
|
5248
5906
|
* 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.
|
|
5907
|
+
* @example
|
|
5908
|
+
* ```js
|
|
5909
|
+
* // Before running the sample:
|
|
5910
|
+
* // - Enable the API at:
|
|
5911
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5912
|
+
* // - Login into gcloud by running:
|
|
5913
|
+
* // ```sh
|
|
5914
|
+
* // $ gcloud auth application-default login
|
|
5915
|
+
* // ```
|
|
5916
|
+
* // - Install the npm module by running:
|
|
5917
|
+
* // ```sh
|
|
5918
|
+
* // $ npm install googleapis
|
|
5919
|
+
* // ```
|
|
5920
|
+
*
|
|
5921
|
+
* const {google} = require('googleapis');
|
|
5922
|
+
* const vision = google.vision('v1p2beta1');
|
|
5923
|
+
*
|
|
5924
|
+
* async function main() {
|
|
5925
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5926
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5927
|
+
* scopes: [
|
|
5928
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5929
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5930
|
+
* ],
|
|
5931
|
+
* });
|
|
5932
|
+
*
|
|
5933
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5934
|
+
* const authClient = await auth.getClient();
|
|
5935
|
+
* google.options({auth: authClient});
|
|
5936
|
+
*
|
|
5937
|
+
* // Do the magic
|
|
5938
|
+
* const res = await vision.projects.locations.images.asyncBatchAnnotate({
|
|
5939
|
+
* // 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`.
|
|
5940
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
5941
|
+
*
|
|
5942
|
+
* // Request body metadata
|
|
5943
|
+
* requestBody: {
|
|
5944
|
+
* // request body parameters
|
|
5945
|
+
* // {
|
|
5946
|
+
* // "labels": {},
|
|
5947
|
+
* // "outputConfig": {},
|
|
5948
|
+
* // "parent": "my_parent",
|
|
5949
|
+
* // "requests": []
|
|
5950
|
+
* // }
|
|
5951
|
+
* },
|
|
5952
|
+
* });
|
|
5953
|
+
* console.log(res.data);
|
|
5954
|
+
*
|
|
5955
|
+
* // Example response
|
|
5956
|
+
* // {
|
|
5957
|
+
* // "done": false,
|
|
5958
|
+
* // "error": {},
|
|
5959
|
+
* // "metadata": {},
|
|
5960
|
+
* // "name": "my_name",
|
|
5961
|
+
* // "response": {}
|
|
5962
|
+
* // }
|
|
5963
|
+
* }
|
|
5964
|
+
*
|
|
5965
|
+
* main().catch(e => {
|
|
5966
|
+
* console.error(e);
|
|
5967
|
+
* throw e;
|
|
5968
|
+
* });
|
|
5969
|
+
*
|
|
5970
|
+
* ```
|
|
5249
5971
|
*
|
|
5250
5972
|
* @param params - Parameters for request
|
|
5251
5973
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|