@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/v1.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_v1 {
|
|
@@ -638,7 +637,7 @@ export declare namespace vision_v1 {
|
|
|
638
637
|
*/
|
|
639
638
|
maxResults?: number | null;
|
|
640
639
|
/**
|
|
641
|
-
* 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/
|
|
640
|
+
* 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.
|
|
642
641
|
*/
|
|
643
642
|
model?: string | null;
|
|
644
643
|
/**
|
|
@@ -5139,6 +5138,62 @@ export declare namespace vision_v1 {
|
|
|
5139
5138
|
constructor(context: APIRequestContext);
|
|
5140
5139
|
/**
|
|
5141
5140
|
* 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.
|
|
5141
|
+
* @example
|
|
5142
|
+
* ```js
|
|
5143
|
+
* // Before running the sample:
|
|
5144
|
+
* // - Enable the API at:
|
|
5145
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5146
|
+
* // - Login into gcloud by running:
|
|
5147
|
+
* // ```sh
|
|
5148
|
+
* // $ gcloud auth application-default login
|
|
5149
|
+
* // ```
|
|
5150
|
+
* // - Install the npm module by running:
|
|
5151
|
+
* // ```sh
|
|
5152
|
+
* // $ npm install googleapis
|
|
5153
|
+
* // ```
|
|
5154
|
+
*
|
|
5155
|
+
* const {google} = require('googleapis');
|
|
5156
|
+
* const vision = google.vision('v1');
|
|
5157
|
+
*
|
|
5158
|
+
* async function main() {
|
|
5159
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5160
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5161
|
+
* scopes: [
|
|
5162
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5163
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5164
|
+
* ],
|
|
5165
|
+
* });
|
|
5166
|
+
*
|
|
5167
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5168
|
+
* const authClient = await auth.getClient();
|
|
5169
|
+
* google.options({auth: authClient});
|
|
5170
|
+
*
|
|
5171
|
+
* // Do the magic
|
|
5172
|
+
* const res = await vision.files.annotate({
|
|
5173
|
+
* // Request body metadata
|
|
5174
|
+
* requestBody: {
|
|
5175
|
+
* // request body parameters
|
|
5176
|
+
* // {
|
|
5177
|
+
* // "labels": {},
|
|
5178
|
+
* // "parent": "my_parent",
|
|
5179
|
+
* // "requests": []
|
|
5180
|
+
* // }
|
|
5181
|
+
* },
|
|
5182
|
+
* });
|
|
5183
|
+
* console.log(res.data);
|
|
5184
|
+
*
|
|
5185
|
+
* // Example response
|
|
5186
|
+
* // {
|
|
5187
|
+
* // "responses": []
|
|
5188
|
+
* // }
|
|
5189
|
+
* }
|
|
5190
|
+
*
|
|
5191
|
+
* main().catch(e => {
|
|
5192
|
+
* console.error(e);
|
|
5193
|
+
* throw e;
|
|
5194
|
+
* });
|
|
5195
|
+
*
|
|
5196
|
+
* ```
|
|
5142
5197
|
*
|
|
5143
5198
|
* @param params - Parameters for request
|
|
5144
5199
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5153,6 +5208,66 @@ export declare namespace vision_v1 {
|
|
|
5153
5208
|
annotate(callback: BodyResponseCallback<Schema$BatchAnnotateFilesResponse>): void;
|
|
5154
5209
|
/**
|
|
5155
5210
|
* 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).
|
|
5211
|
+
* @example
|
|
5212
|
+
* ```js
|
|
5213
|
+
* // Before running the sample:
|
|
5214
|
+
* // - Enable the API at:
|
|
5215
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5216
|
+
* // - Login into gcloud by running:
|
|
5217
|
+
* // ```sh
|
|
5218
|
+
* // $ gcloud auth application-default login
|
|
5219
|
+
* // ```
|
|
5220
|
+
* // - Install the npm module by running:
|
|
5221
|
+
* // ```sh
|
|
5222
|
+
* // $ npm install googleapis
|
|
5223
|
+
* // ```
|
|
5224
|
+
*
|
|
5225
|
+
* const {google} = require('googleapis');
|
|
5226
|
+
* const vision = google.vision('v1');
|
|
5227
|
+
*
|
|
5228
|
+
* async function main() {
|
|
5229
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5230
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5231
|
+
* scopes: [
|
|
5232
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5233
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5234
|
+
* ],
|
|
5235
|
+
* });
|
|
5236
|
+
*
|
|
5237
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5238
|
+
* const authClient = await auth.getClient();
|
|
5239
|
+
* google.options({auth: authClient});
|
|
5240
|
+
*
|
|
5241
|
+
* // Do the magic
|
|
5242
|
+
* const res = await vision.files.asyncBatchAnnotate({
|
|
5243
|
+
* // Request body metadata
|
|
5244
|
+
* requestBody: {
|
|
5245
|
+
* // request body parameters
|
|
5246
|
+
* // {
|
|
5247
|
+
* // "labels": {},
|
|
5248
|
+
* // "parent": "my_parent",
|
|
5249
|
+
* // "requests": []
|
|
5250
|
+
* // }
|
|
5251
|
+
* },
|
|
5252
|
+
* });
|
|
5253
|
+
* console.log(res.data);
|
|
5254
|
+
*
|
|
5255
|
+
* // Example response
|
|
5256
|
+
* // {
|
|
5257
|
+
* // "done": false,
|
|
5258
|
+
* // "error": {},
|
|
5259
|
+
* // "metadata": {},
|
|
5260
|
+
* // "name": "my_name",
|
|
5261
|
+
* // "response": {}
|
|
5262
|
+
* // }
|
|
5263
|
+
* }
|
|
5264
|
+
*
|
|
5265
|
+
* main().catch(e => {
|
|
5266
|
+
* console.error(e);
|
|
5267
|
+
* throw e;
|
|
5268
|
+
* });
|
|
5269
|
+
*
|
|
5270
|
+
* ```
|
|
5156
5271
|
*
|
|
5157
5272
|
* @param params - Parameters for request
|
|
5158
5273
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5183,6 +5298,62 @@ export declare namespace vision_v1 {
|
|
|
5183
5298
|
constructor(context: APIRequestContext);
|
|
5184
5299
|
/**
|
|
5185
5300
|
* Run image detection and annotation for a batch of images.
|
|
5301
|
+
* @example
|
|
5302
|
+
* ```js
|
|
5303
|
+
* // Before running the sample:
|
|
5304
|
+
* // - Enable the API at:
|
|
5305
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5306
|
+
* // - Login into gcloud by running:
|
|
5307
|
+
* // ```sh
|
|
5308
|
+
* // $ gcloud auth application-default login
|
|
5309
|
+
* // ```
|
|
5310
|
+
* // - Install the npm module by running:
|
|
5311
|
+
* // ```sh
|
|
5312
|
+
* // $ npm install googleapis
|
|
5313
|
+
* // ```
|
|
5314
|
+
*
|
|
5315
|
+
* const {google} = require('googleapis');
|
|
5316
|
+
* const vision = google.vision('v1');
|
|
5317
|
+
*
|
|
5318
|
+
* async function main() {
|
|
5319
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5320
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5321
|
+
* scopes: [
|
|
5322
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5323
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5324
|
+
* ],
|
|
5325
|
+
* });
|
|
5326
|
+
*
|
|
5327
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5328
|
+
* const authClient = await auth.getClient();
|
|
5329
|
+
* google.options({auth: authClient});
|
|
5330
|
+
*
|
|
5331
|
+
* // Do the magic
|
|
5332
|
+
* const res = await vision.images.annotate({
|
|
5333
|
+
* // Request body metadata
|
|
5334
|
+
* requestBody: {
|
|
5335
|
+
* // request body parameters
|
|
5336
|
+
* // {
|
|
5337
|
+
* // "labels": {},
|
|
5338
|
+
* // "parent": "my_parent",
|
|
5339
|
+
* // "requests": []
|
|
5340
|
+
* // }
|
|
5341
|
+
* },
|
|
5342
|
+
* });
|
|
5343
|
+
* console.log(res.data);
|
|
5344
|
+
*
|
|
5345
|
+
* // Example response
|
|
5346
|
+
* // {
|
|
5347
|
+
* // "responses": []
|
|
5348
|
+
* // }
|
|
5349
|
+
* }
|
|
5350
|
+
*
|
|
5351
|
+
* main().catch(e => {
|
|
5352
|
+
* console.error(e);
|
|
5353
|
+
* throw e;
|
|
5354
|
+
* });
|
|
5355
|
+
*
|
|
5356
|
+
* ```
|
|
5186
5357
|
*
|
|
5187
5358
|
* @param params - Parameters for request
|
|
5188
5359
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5197,6 +5368,67 @@ export declare namespace vision_v1 {
|
|
|
5197
5368
|
annotate(callback: BodyResponseCallback<Schema$BatchAnnotateImagesResponse>): void;
|
|
5198
5369
|
/**
|
|
5199
5370
|
* 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.
|
|
5371
|
+
* @example
|
|
5372
|
+
* ```js
|
|
5373
|
+
* // Before running the sample:
|
|
5374
|
+
* // - Enable the API at:
|
|
5375
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5376
|
+
* // - Login into gcloud by running:
|
|
5377
|
+
* // ```sh
|
|
5378
|
+
* // $ gcloud auth application-default login
|
|
5379
|
+
* // ```
|
|
5380
|
+
* // - Install the npm module by running:
|
|
5381
|
+
* // ```sh
|
|
5382
|
+
* // $ npm install googleapis
|
|
5383
|
+
* // ```
|
|
5384
|
+
*
|
|
5385
|
+
* const {google} = require('googleapis');
|
|
5386
|
+
* const vision = google.vision('v1');
|
|
5387
|
+
*
|
|
5388
|
+
* async function main() {
|
|
5389
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5390
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5391
|
+
* scopes: [
|
|
5392
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5393
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5394
|
+
* ],
|
|
5395
|
+
* });
|
|
5396
|
+
*
|
|
5397
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5398
|
+
* const authClient = await auth.getClient();
|
|
5399
|
+
* google.options({auth: authClient});
|
|
5400
|
+
*
|
|
5401
|
+
* // Do the magic
|
|
5402
|
+
* const res = await vision.images.asyncBatchAnnotate({
|
|
5403
|
+
* // Request body metadata
|
|
5404
|
+
* requestBody: {
|
|
5405
|
+
* // request body parameters
|
|
5406
|
+
* // {
|
|
5407
|
+
* // "labels": {},
|
|
5408
|
+
* // "outputConfig": {},
|
|
5409
|
+
* // "parent": "my_parent",
|
|
5410
|
+
* // "requests": []
|
|
5411
|
+
* // }
|
|
5412
|
+
* },
|
|
5413
|
+
* });
|
|
5414
|
+
* console.log(res.data);
|
|
5415
|
+
*
|
|
5416
|
+
* // Example response
|
|
5417
|
+
* // {
|
|
5418
|
+
* // "done": false,
|
|
5419
|
+
* // "error": {},
|
|
5420
|
+
* // "metadata": {},
|
|
5421
|
+
* // "name": "my_name",
|
|
5422
|
+
* // "response": {}
|
|
5423
|
+
* // }
|
|
5424
|
+
* }
|
|
5425
|
+
*
|
|
5426
|
+
* main().catch(e => {
|
|
5427
|
+
* console.error(e);
|
|
5428
|
+
* throw e;
|
|
5429
|
+
* });
|
|
5430
|
+
*
|
|
5431
|
+
* ```
|
|
5200
5432
|
*
|
|
5201
5433
|
* @param params - Parameters for request
|
|
5202
5434
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5232,6 +5464,59 @@ export declare namespace vision_v1 {
|
|
|
5232
5464
|
constructor(context: APIRequestContext);
|
|
5233
5465
|
/**
|
|
5234
5466
|
* Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
|
5467
|
+
* @example
|
|
5468
|
+
* ```js
|
|
5469
|
+
* // Before running the sample:
|
|
5470
|
+
* // - Enable the API at:
|
|
5471
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5472
|
+
* // - Login into gcloud by running:
|
|
5473
|
+
* // ```sh
|
|
5474
|
+
* // $ gcloud auth application-default login
|
|
5475
|
+
* // ```
|
|
5476
|
+
* // - Install the npm module by running:
|
|
5477
|
+
* // ```sh
|
|
5478
|
+
* // $ npm install googleapis
|
|
5479
|
+
* // ```
|
|
5480
|
+
*
|
|
5481
|
+
* const {google} = require('googleapis');
|
|
5482
|
+
* const vision = google.vision('v1');
|
|
5483
|
+
*
|
|
5484
|
+
* async function main() {
|
|
5485
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5486
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5487
|
+
* scopes: [
|
|
5488
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5489
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5490
|
+
* ],
|
|
5491
|
+
* });
|
|
5492
|
+
*
|
|
5493
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5494
|
+
* const authClient = await auth.getClient();
|
|
5495
|
+
* google.options({auth: authClient});
|
|
5496
|
+
*
|
|
5497
|
+
* // Do the magic
|
|
5498
|
+
* const res = await vision.locations.operations.get({
|
|
5499
|
+
* // The name of the operation resource.
|
|
5500
|
+
* name: 'locations/my-location/operations/my-operation',
|
|
5501
|
+
* });
|
|
5502
|
+
* console.log(res.data);
|
|
5503
|
+
*
|
|
5504
|
+
* // Example response
|
|
5505
|
+
* // {
|
|
5506
|
+
* // "done": false,
|
|
5507
|
+
* // "error": {},
|
|
5508
|
+
* // "metadata": {},
|
|
5509
|
+
* // "name": "my_name",
|
|
5510
|
+
* // "response": {}
|
|
5511
|
+
* // }
|
|
5512
|
+
* }
|
|
5513
|
+
*
|
|
5514
|
+
* main().catch(e => {
|
|
5515
|
+
* console.error(e);
|
|
5516
|
+
* throw e;
|
|
5517
|
+
* });
|
|
5518
|
+
*
|
|
5519
|
+
* ```
|
|
5235
5520
|
*
|
|
5236
5521
|
* @param params - Parameters for request
|
|
5237
5522
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5256,6 +5541,59 @@ export declare namespace vision_v1 {
|
|
|
5256
5541
|
constructor(context: APIRequestContext);
|
|
5257
5542
|
/**
|
|
5258
5543
|
* Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
|
|
5544
|
+
* @example
|
|
5545
|
+
* ```js
|
|
5546
|
+
* // Before running the sample:
|
|
5547
|
+
* // - Enable the API at:
|
|
5548
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5549
|
+
* // - Login into gcloud by running:
|
|
5550
|
+
* // ```sh
|
|
5551
|
+
* // $ gcloud auth application-default login
|
|
5552
|
+
* // ```
|
|
5553
|
+
* // - Install the npm module by running:
|
|
5554
|
+
* // ```sh
|
|
5555
|
+
* // $ npm install googleapis
|
|
5556
|
+
* // ```
|
|
5557
|
+
*
|
|
5558
|
+
* const {google} = require('googleapis');
|
|
5559
|
+
* const vision = google.vision('v1');
|
|
5560
|
+
*
|
|
5561
|
+
* async function main() {
|
|
5562
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5563
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5564
|
+
* scopes: [
|
|
5565
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5566
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5567
|
+
* ],
|
|
5568
|
+
* });
|
|
5569
|
+
*
|
|
5570
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5571
|
+
* const authClient = await auth.getClient();
|
|
5572
|
+
* google.options({auth: authClient});
|
|
5573
|
+
*
|
|
5574
|
+
* // Do the magic
|
|
5575
|
+
* const res = await vision.operations.cancel({
|
|
5576
|
+
* // The name of the operation resource to be cancelled.
|
|
5577
|
+
* name: 'operations/.*',
|
|
5578
|
+
*
|
|
5579
|
+
* // Request body metadata
|
|
5580
|
+
* requestBody: {
|
|
5581
|
+
* // request body parameters
|
|
5582
|
+
* // {}
|
|
5583
|
+
* },
|
|
5584
|
+
* });
|
|
5585
|
+
* console.log(res.data);
|
|
5586
|
+
*
|
|
5587
|
+
* // Example response
|
|
5588
|
+
* // {}
|
|
5589
|
+
* }
|
|
5590
|
+
*
|
|
5591
|
+
* main().catch(e => {
|
|
5592
|
+
* console.error(e);
|
|
5593
|
+
* throw e;
|
|
5594
|
+
* });
|
|
5595
|
+
*
|
|
5596
|
+
* ```
|
|
5259
5597
|
*
|
|
5260
5598
|
* @param params - Parameters for request
|
|
5261
5599
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5270,6 +5608,53 @@ export declare namespace vision_v1 {
|
|
|
5270
5608
|
cancel(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5271
5609
|
/**
|
|
5272
5610
|
* Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
|
|
5611
|
+
* @example
|
|
5612
|
+
* ```js
|
|
5613
|
+
* // Before running the sample:
|
|
5614
|
+
* // - Enable the API at:
|
|
5615
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5616
|
+
* // - Login into gcloud by running:
|
|
5617
|
+
* // ```sh
|
|
5618
|
+
* // $ gcloud auth application-default login
|
|
5619
|
+
* // ```
|
|
5620
|
+
* // - Install the npm module by running:
|
|
5621
|
+
* // ```sh
|
|
5622
|
+
* // $ npm install googleapis
|
|
5623
|
+
* // ```
|
|
5624
|
+
*
|
|
5625
|
+
* const {google} = require('googleapis');
|
|
5626
|
+
* const vision = google.vision('v1');
|
|
5627
|
+
*
|
|
5628
|
+
* async function main() {
|
|
5629
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5630
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5631
|
+
* scopes: [
|
|
5632
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5633
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5634
|
+
* ],
|
|
5635
|
+
* });
|
|
5636
|
+
*
|
|
5637
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5638
|
+
* const authClient = await auth.getClient();
|
|
5639
|
+
* google.options({auth: authClient});
|
|
5640
|
+
*
|
|
5641
|
+
* // Do the magic
|
|
5642
|
+
* const res = await vision.operations.delete({
|
|
5643
|
+
* // The name of the operation resource to be deleted.
|
|
5644
|
+
* name: 'operations/.*',
|
|
5645
|
+
* });
|
|
5646
|
+
* console.log(res.data);
|
|
5647
|
+
*
|
|
5648
|
+
* // Example response
|
|
5649
|
+
* // {}
|
|
5650
|
+
* }
|
|
5651
|
+
*
|
|
5652
|
+
* main().catch(e => {
|
|
5653
|
+
* console.error(e);
|
|
5654
|
+
* throw e;
|
|
5655
|
+
* });
|
|
5656
|
+
*
|
|
5657
|
+
* ```
|
|
5273
5658
|
*
|
|
5274
5659
|
* @param params - Parameters for request
|
|
5275
5660
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5284,6 +5669,59 @@ export declare namespace vision_v1 {
|
|
|
5284
5669
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5285
5670
|
/**
|
|
5286
5671
|
* Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
|
5672
|
+
* @example
|
|
5673
|
+
* ```js
|
|
5674
|
+
* // Before running the sample:
|
|
5675
|
+
* // - Enable the API at:
|
|
5676
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5677
|
+
* // - Login into gcloud by running:
|
|
5678
|
+
* // ```sh
|
|
5679
|
+
* // $ gcloud auth application-default login
|
|
5680
|
+
* // ```
|
|
5681
|
+
* // - Install the npm module by running:
|
|
5682
|
+
* // ```sh
|
|
5683
|
+
* // $ npm install googleapis
|
|
5684
|
+
* // ```
|
|
5685
|
+
*
|
|
5686
|
+
* const {google} = require('googleapis');
|
|
5687
|
+
* const vision = google.vision('v1');
|
|
5688
|
+
*
|
|
5689
|
+
* async function main() {
|
|
5690
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5691
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5692
|
+
* scopes: [
|
|
5693
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5694
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5695
|
+
* ],
|
|
5696
|
+
* });
|
|
5697
|
+
*
|
|
5698
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5699
|
+
* const authClient = await auth.getClient();
|
|
5700
|
+
* google.options({auth: authClient});
|
|
5701
|
+
*
|
|
5702
|
+
* // Do the magic
|
|
5703
|
+
* const res = await vision.operations.get({
|
|
5704
|
+
* // The name of the operation resource.
|
|
5705
|
+
* name: 'operations/my-operation',
|
|
5706
|
+
* });
|
|
5707
|
+
* console.log(res.data);
|
|
5708
|
+
*
|
|
5709
|
+
* // Example response
|
|
5710
|
+
* // {
|
|
5711
|
+
* // "done": false,
|
|
5712
|
+
* // "error": {},
|
|
5713
|
+
* // "metadata": {},
|
|
5714
|
+
* // "name": "my_name",
|
|
5715
|
+
* // "response": {}
|
|
5716
|
+
* // }
|
|
5717
|
+
* }
|
|
5718
|
+
*
|
|
5719
|
+
* main().catch(e => {
|
|
5720
|
+
* console.error(e);
|
|
5721
|
+
* throw e;
|
|
5722
|
+
* });
|
|
5723
|
+
*
|
|
5724
|
+
* ```
|
|
5287
5725
|
*
|
|
5288
5726
|
* @param params - Parameters for request
|
|
5289
5727
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5298,6 +5736,62 @@ export declare namespace vision_v1 {
|
|
|
5298
5736
|
get(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5299
5737
|
/**
|
|
5300
5738
|
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
|
|
5739
|
+
* @example
|
|
5740
|
+
* ```js
|
|
5741
|
+
* // Before running the sample:
|
|
5742
|
+
* // - Enable the API at:
|
|
5743
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5744
|
+
* // - Login into gcloud by running:
|
|
5745
|
+
* // ```sh
|
|
5746
|
+
* // $ gcloud auth application-default login
|
|
5747
|
+
* // ```
|
|
5748
|
+
* // - Install the npm module by running:
|
|
5749
|
+
* // ```sh
|
|
5750
|
+
* // $ npm install googleapis
|
|
5751
|
+
* // ```
|
|
5752
|
+
*
|
|
5753
|
+
* const {google} = require('googleapis');
|
|
5754
|
+
* const vision = google.vision('v1');
|
|
5755
|
+
*
|
|
5756
|
+
* async function main() {
|
|
5757
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5758
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5759
|
+
* scopes: [
|
|
5760
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5761
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5762
|
+
* ],
|
|
5763
|
+
* });
|
|
5764
|
+
*
|
|
5765
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5766
|
+
* const authClient = await auth.getClient();
|
|
5767
|
+
* google.options({auth: authClient});
|
|
5768
|
+
*
|
|
5769
|
+
* // Do the magic
|
|
5770
|
+
* const res = await vision.operations.list({
|
|
5771
|
+
* // The standard list filter.
|
|
5772
|
+
* filter: 'placeholder-value',
|
|
5773
|
+
* // The name of the operation's parent resource.
|
|
5774
|
+
* name: 'operations',
|
|
5775
|
+
* // The standard list page size.
|
|
5776
|
+
* pageSize: 'placeholder-value',
|
|
5777
|
+
* // The standard list page token.
|
|
5778
|
+
* pageToken: 'placeholder-value',
|
|
5779
|
+
* });
|
|
5780
|
+
* console.log(res.data);
|
|
5781
|
+
*
|
|
5782
|
+
* // Example response
|
|
5783
|
+
* // {
|
|
5784
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
5785
|
+
* // "operations": []
|
|
5786
|
+
* // }
|
|
5787
|
+
* }
|
|
5788
|
+
*
|
|
5789
|
+
* main().catch(e => {
|
|
5790
|
+
* console.error(e);
|
|
5791
|
+
* throw e;
|
|
5792
|
+
* });
|
|
5793
|
+
*
|
|
5794
|
+
* ```
|
|
5301
5795
|
*
|
|
5302
5796
|
* @param params - Parameters for request
|
|
5303
5797
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5364,6 +5858,65 @@ export declare namespace vision_v1 {
|
|
|
5364
5858
|
constructor(context: APIRequestContext);
|
|
5365
5859
|
/**
|
|
5366
5860
|
* 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.
|
|
5861
|
+
* @example
|
|
5862
|
+
* ```js
|
|
5863
|
+
* // Before running the sample:
|
|
5864
|
+
* // - Enable the API at:
|
|
5865
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5866
|
+
* // - Login into gcloud by running:
|
|
5867
|
+
* // ```sh
|
|
5868
|
+
* // $ gcloud auth application-default login
|
|
5869
|
+
* // ```
|
|
5870
|
+
* // - Install the npm module by running:
|
|
5871
|
+
* // ```sh
|
|
5872
|
+
* // $ npm install googleapis
|
|
5873
|
+
* // ```
|
|
5874
|
+
*
|
|
5875
|
+
* const {google} = require('googleapis');
|
|
5876
|
+
* const vision = google.vision('v1');
|
|
5877
|
+
*
|
|
5878
|
+
* async function main() {
|
|
5879
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5880
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5881
|
+
* scopes: [
|
|
5882
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5883
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5884
|
+
* ],
|
|
5885
|
+
* });
|
|
5886
|
+
*
|
|
5887
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5888
|
+
* const authClient = await auth.getClient();
|
|
5889
|
+
* google.options({auth: authClient});
|
|
5890
|
+
*
|
|
5891
|
+
* // Do the magic
|
|
5892
|
+
* const res = await vision.projects.files.annotate({
|
|
5893
|
+
* // 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`.
|
|
5894
|
+
* parent: 'projects/my-project',
|
|
5895
|
+
*
|
|
5896
|
+
* // Request body metadata
|
|
5897
|
+
* requestBody: {
|
|
5898
|
+
* // request body parameters
|
|
5899
|
+
* // {
|
|
5900
|
+
* // "labels": {},
|
|
5901
|
+
* // "parent": "my_parent",
|
|
5902
|
+
* // "requests": []
|
|
5903
|
+
* // }
|
|
5904
|
+
* },
|
|
5905
|
+
* });
|
|
5906
|
+
* console.log(res.data);
|
|
5907
|
+
*
|
|
5908
|
+
* // Example response
|
|
5909
|
+
* // {
|
|
5910
|
+
* // "responses": []
|
|
5911
|
+
* // }
|
|
5912
|
+
* }
|
|
5913
|
+
*
|
|
5914
|
+
* main().catch(e => {
|
|
5915
|
+
* console.error(e);
|
|
5916
|
+
* throw e;
|
|
5917
|
+
* });
|
|
5918
|
+
*
|
|
5919
|
+
* ```
|
|
5367
5920
|
*
|
|
5368
5921
|
* @param params - Parameters for request
|
|
5369
5922
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5378,6 +5931,69 @@ export declare namespace vision_v1 {
|
|
|
5378
5931
|
annotate(callback: BodyResponseCallback<Schema$BatchAnnotateFilesResponse>): void;
|
|
5379
5932
|
/**
|
|
5380
5933
|
* 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).
|
|
5934
|
+
* @example
|
|
5935
|
+
* ```js
|
|
5936
|
+
* // Before running the sample:
|
|
5937
|
+
* // - Enable the API at:
|
|
5938
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5939
|
+
* // - Login into gcloud by running:
|
|
5940
|
+
* // ```sh
|
|
5941
|
+
* // $ gcloud auth application-default login
|
|
5942
|
+
* // ```
|
|
5943
|
+
* // - Install the npm module by running:
|
|
5944
|
+
* // ```sh
|
|
5945
|
+
* // $ npm install googleapis
|
|
5946
|
+
* // ```
|
|
5947
|
+
*
|
|
5948
|
+
* const {google} = require('googleapis');
|
|
5949
|
+
* const vision = google.vision('v1');
|
|
5950
|
+
*
|
|
5951
|
+
* async function main() {
|
|
5952
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5953
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5954
|
+
* scopes: [
|
|
5955
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5956
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5957
|
+
* ],
|
|
5958
|
+
* });
|
|
5959
|
+
*
|
|
5960
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5961
|
+
* const authClient = await auth.getClient();
|
|
5962
|
+
* google.options({auth: authClient});
|
|
5963
|
+
*
|
|
5964
|
+
* // Do the magic
|
|
5965
|
+
* const res = await vision.projects.files.asyncBatchAnnotate({
|
|
5966
|
+
* // 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`.
|
|
5967
|
+
* parent: 'projects/my-project',
|
|
5968
|
+
*
|
|
5969
|
+
* // Request body metadata
|
|
5970
|
+
* requestBody: {
|
|
5971
|
+
* // request body parameters
|
|
5972
|
+
* // {
|
|
5973
|
+
* // "labels": {},
|
|
5974
|
+
* // "parent": "my_parent",
|
|
5975
|
+
* // "requests": []
|
|
5976
|
+
* // }
|
|
5977
|
+
* },
|
|
5978
|
+
* });
|
|
5979
|
+
* console.log(res.data);
|
|
5980
|
+
*
|
|
5981
|
+
* // Example response
|
|
5982
|
+
* // {
|
|
5983
|
+
* // "done": false,
|
|
5984
|
+
* // "error": {},
|
|
5985
|
+
* // "metadata": {},
|
|
5986
|
+
* // "name": "my_name",
|
|
5987
|
+
* // "response": {}
|
|
5988
|
+
* // }
|
|
5989
|
+
* }
|
|
5990
|
+
*
|
|
5991
|
+
* main().catch(e => {
|
|
5992
|
+
* console.error(e);
|
|
5993
|
+
* throw e;
|
|
5994
|
+
* });
|
|
5995
|
+
*
|
|
5996
|
+
* ```
|
|
5381
5997
|
*
|
|
5382
5998
|
* @param params - Parameters for request
|
|
5383
5999
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5416,6 +6032,65 @@ export declare namespace vision_v1 {
|
|
|
5416
6032
|
constructor(context: APIRequestContext);
|
|
5417
6033
|
/**
|
|
5418
6034
|
* Run image detection and annotation for a batch of images.
|
|
6035
|
+
* @example
|
|
6036
|
+
* ```js
|
|
6037
|
+
* // Before running the sample:
|
|
6038
|
+
* // - Enable the API at:
|
|
6039
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6040
|
+
* // - Login into gcloud by running:
|
|
6041
|
+
* // ```sh
|
|
6042
|
+
* // $ gcloud auth application-default login
|
|
6043
|
+
* // ```
|
|
6044
|
+
* // - Install the npm module by running:
|
|
6045
|
+
* // ```sh
|
|
6046
|
+
* // $ npm install googleapis
|
|
6047
|
+
* // ```
|
|
6048
|
+
*
|
|
6049
|
+
* const {google} = require('googleapis');
|
|
6050
|
+
* const vision = google.vision('v1');
|
|
6051
|
+
*
|
|
6052
|
+
* async function main() {
|
|
6053
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6054
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6055
|
+
* scopes: [
|
|
6056
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6057
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6058
|
+
* ],
|
|
6059
|
+
* });
|
|
6060
|
+
*
|
|
6061
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6062
|
+
* const authClient = await auth.getClient();
|
|
6063
|
+
* google.options({auth: authClient});
|
|
6064
|
+
*
|
|
6065
|
+
* // Do the magic
|
|
6066
|
+
* const res = await vision.projects.images.annotate({
|
|
6067
|
+
* // 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`.
|
|
6068
|
+
* parent: 'projects/my-project',
|
|
6069
|
+
*
|
|
6070
|
+
* // Request body metadata
|
|
6071
|
+
* requestBody: {
|
|
6072
|
+
* // request body parameters
|
|
6073
|
+
* // {
|
|
6074
|
+
* // "labels": {},
|
|
6075
|
+
* // "parent": "my_parent",
|
|
6076
|
+
* // "requests": []
|
|
6077
|
+
* // }
|
|
6078
|
+
* },
|
|
6079
|
+
* });
|
|
6080
|
+
* console.log(res.data);
|
|
6081
|
+
*
|
|
6082
|
+
* // Example response
|
|
6083
|
+
* // {
|
|
6084
|
+
* // "responses": []
|
|
6085
|
+
* // }
|
|
6086
|
+
* }
|
|
6087
|
+
*
|
|
6088
|
+
* main().catch(e => {
|
|
6089
|
+
* console.error(e);
|
|
6090
|
+
* throw e;
|
|
6091
|
+
* });
|
|
6092
|
+
*
|
|
6093
|
+
* ```
|
|
5419
6094
|
*
|
|
5420
6095
|
* @param params - Parameters for request
|
|
5421
6096
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5430,6 +6105,70 @@ export declare namespace vision_v1 {
|
|
|
5430
6105
|
annotate(callback: BodyResponseCallback<Schema$BatchAnnotateImagesResponse>): void;
|
|
5431
6106
|
/**
|
|
5432
6107
|
* 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.
|
|
6108
|
+
* @example
|
|
6109
|
+
* ```js
|
|
6110
|
+
* // Before running the sample:
|
|
6111
|
+
* // - Enable the API at:
|
|
6112
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6113
|
+
* // - Login into gcloud by running:
|
|
6114
|
+
* // ```sh
|
|
6115
|
+
* // $ gcloud auth application-default login
|
|
6116
|
+
* // ```
|
|
6117
|
+
* // - Install the npm module by running:
|
|
6118
|
+
* // ```sh
|
|
6119
|
+
* // $ npm install googleapis
|
|
6120
|
+
* // ```
|
|
6121
|
+
*
|
|
6122
|
+
* const {google} = require('googleapis');
|
|
6123
|
+
* const vision = google.vision('v1');
|
|
6124
|
+
*
|
|
6125
|
+
* async function main() {
|
|
6126
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6127
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6128
|
+
* scopes: [
|
|
6129
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6130
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6131
|
+
* ],
|
|
6132
|
+
* });
|
|
6133
|
+
*
|
|
6134
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6135
|
+
* const authClient = await auth.getClient();
|
|
6136
|
+
* google.options({auth: authClient});
|
|
6137
|
+
*
|
|
6138
|
+
* // Do the magic
|
|
6139
|
+
* const res = await vision.projects.images.asyncBatchAnnotate({
|
|
6140
|
+
* // 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`.
|
|
6141
|
+
* parent: 'projects/my-project',
|
|
6142
|
+
*
|
|
6143
|
+
* // Request body metadata
|
|
6144
|
+
* requestBody: {
|
|
6145
|
+
* // request body parameters
|
|
6146
|
+
* // {
|
|
6147
|
+
* // "labels": {},
|
|
6148
|
+
* // "outputConfig": {},
|
|
6149
|
+
* // "parent": "my_parent",
|
|
6150
|
+
* // "requests": []
|
|
6151
|
+
* // }
|
|
6152
|
+
* },
|
|
6153
|
+
* });
|
|
6154
|
+
* console.log(res.data);
|
|
6155
|
+
*
|
|
6156
|
+
* // Example response
|
|
6157
|
+
* // {
|
|
6158
|
+
* // "done": false,
|
|
6159
|
+
* // "error": {},
|
|
6160
|
+
* // "metadata": {},
|
|
6161
|
+
* // "name": "my_name",
|
|
6162
|
+
* // "response": {}
|
|
6163
|
+
* // }
|
|
6164
|
+
* }
|
|
6165
|
+
*
|
|
6166
|
+
* main().catch(e => {
|
|
6167
|
+
* console.error(e);
|
|
6168
|
+
* throw e;
|
|
6169
|
+
* });
|
|
6170
|
+
*
|
|
6171
|
+
* ```
|
|
5433
6172
|
*
|
|
5434
6173
|
* @param params - Parameters for request
|
|
5435
6174
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5477,6 +6216,65 @@ export declare namespace vision_v1 {
|
|
|
5477
6216
|
constructor(context: APIRequestContext);
|
|
5478
6217
|
/**
|
|
5479
6218
|
* 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.
|
|
6219
|
+
* @example
|
|
6220
|
+
* ```js
|
|
6221
|
+
* // Before running the sample:
|
|
6222
|
+
* // - Enable the API at:
|
|
6223
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6224
|
+
* // - Login into gcloud by running:
|
|
6225
|
+
* // ```sh
|
|
6226
|
+
* // $ gcloud auth application-default login
|
|
6227
|
+
* // ```
|
|
6228
|
+
* // - Install the npm module by running:
|
|
6229
|
+
* // ```sh
|
|
6230
|
+
* // $ npm install googleapis
|
|
6231
|
+
* // ```
|
|
6232
|
+
*
|
|
6233
|
+
* const {google} = require('googleapis');
|
|
6234
|
+
* const vision = google.vision('v1');
|
|
6235
|
+
*
|
|
6236
|
+
* async function main() {
|
|
6237
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6238
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6239
|
+
* scopes: [
|
|
6240
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6241
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6242
|
+
* ],
|
|
6243
|
+
* });
|
|
6244
|
+
*
|
|
6245
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6246
|
+
* const authClient = await auth.getClient();
|
|
6247
|
+
* google.options({auth: authClient});
|
|
6248
|
+
*
|
|
6249
|
+
* // Do the magic
|
|
6250
|
+
* const res = await vision.projects.locations.files.annotate({
|
|
6251
|
+
* // 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`.
|
|
6252
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
6253
|
+
*
|
|
6254
|
+
* // Request body metadata
|
|
6255
|
+
* requestBody: {
|
|
6256
|
+
* // request body parameters
|
|
6257
|
+
* // {
|
|
6258
|
+
* // "labels": {},
|
|
6259
|
+
* // "parent": "my_parent",
|
|
6260
|
+
* // "requests": []
|
|
6261
|
+
* // }
|
|
6262
|
+
* },
|
|
6263
|
+
* });
|
|
6264
|
+
* console.log(res.data);
|
|
6265
|
+
*
|
|
6266
|
+
* // Example response
|
|
6267
|
+
* // {
|
|
6268
|
+
* // "responses": []
|
|
6269
|
+
* // }
|
|
6270
|
+
* }
|
|
6271
|
+
*
|
|
6272
|
+
* main().catch(e => {
|
|
6273
|
+
* console.error(e);
|
|
6274
|
+
* throw e;
|
|
6275
|
+
* });
|
|
6276
|
+
*
|
|
6277
|
+
* ```
|
|
5480
6278
|
*
|
|
5481
6279
|
* @param params - Parameters for request
|
|
5482
6280
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5491,6 +6289,69 @@ export declare namespace vision_v1 {
|
|
|
5491
6289
|
annotate(callback: BodyResponseCallback<Schema$BatchAnnotateFilesResponse>): void;
|
|
5492
6290
|
/**
|
|
5493
6291
|
* 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).
|
|
6292
|
+
* @example
|
|
6293
|
+
* ```js
|
|
6294
|
+
* // Before running the sample:
|
|
6295
|
+
* // - Enable the API at:
|
|
6296
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6297
|
+
* // - Login into gcloud by running:
|
|
6298
|
+
* // ```sh
|
|
6299
|
+
* // $ gcloud auth application-default login
|
|
6300
|
+
* // ```
|
|
6301
|
+
* // - Install the npm module by running:
|
|
6302
|
+
* // ```sh
|
|
6303
|
+
* // $ npm install googleapis
|
|
6304
|
+
* // ```
|
|
6305
|
+
*
|
|
6306
|
+
* const {google} = require('googleapis');
|
|
6307
|
+
* const vision = google.vision('v1');
|
|
6308
|
+
*
|
|
6309
|
+
* async function main() {
|
|
6310
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6311
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6312
|
+
* scopes: [
|
|
6313
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6314
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6315
|
+
* ],
|
|
6316
|
+
* });
|
|
6317
|
+
*
|
|
6318
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6319
|
+
* const authClient = await auth.getClient();
|
|
6320
|
+
* google.options({auth: authClient});
|
|
6321
|
+
*
|
|
6322
|
+
* // Do the magic
|
|
6323
|
+
* const res = await vision.projects.locations.files.asyncBatchAnnotate({
|
|
6324
|
+
* // 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`.
|
|
6325
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
6326
|
+
*
|
|
6327
|
+
* // Request body metadata
|
|
6328
|
+
* requestBody: {
|
|
6329
|
+
* // request body parameters
|
|
6330
|
+
* // {
|
|
6331
|
+
* // "labels": {},
|
|
6332
|
+
* // "parent": "my_parent",
|
|
6333
|
+
* // "requests": []
|
|
6334
|
+
* // }
|
|
6335
|
+
* },
|
|
6336
|
+
* });
|
|
6337
|
+
* console.log(res.data);
|
|
6338
|
+
*
|
|
6339
|
+
* // Example response
|
|
6340
|
+
* // {
|
|
6341
|
+
* // "done": false,
|
|
6342
|
+
* // "error": {},
|
|
6343
|
+
* // "metadata": {},
|
|
6344
|
+
* // "name": "my_name",
|
|
6345
|
+
* // "response": {}
|
|
6346
|
+
* // }
|
|
6347
|
+
* }
|
|
6348
|
+
*
|
|
6349
|
+
* main().catch(e => {
|
|
6350
|
+
* console.error(e);
|
|
6351
|
+
* throw e;
|
|
6352
|
+
* });
|
|
6353
|
+
*
|
|
6354
|
+
* ```
|
|
5494
6355
|
*
|
|
5495
6356
|
* @param params - Parameters for request
|
|
5496
6357
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5529,6 +6390,65 @@ export declare namespace vision_v1 {
|
|
|
5529
6390
|
constructor(context: APIRequestContext);
|
|
5530
6391
|
/**
|
|
5531
6392
|
* Run image detection and annotation for a batch of images.
|
|
6393
|
+
* @example
|
|
6394
|
+
* ```js
|
|
6395
|
+
* // Before running the sample:
|
|
6396
|
+
* // - Enable the API at:
|
|
6397
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6398
|
+
* // - Login into gcloud by running:
|
|
6399
|
+
* // ```sh
|
|
6400
|
+
* // $ gcloud auth application-default login
|
|
6401
|
+
* // ```
|
|
6402
|
+
* // - Install the npm module by running:
|
|
6403
|
+
* // ```sh
|
|
6404
|
+
* // $ npm install googleapis
|
|
6405
|
+
* // ```
|
|
6406
|
+
*
|
|
6407
|
+
* const {google} = require('googleapis');
|
|
6408
|
+
* const vision = google.vision('v1');
|
|
6409
|
+
*
|
|
6410
|
+
* async function main() {
|
|
6411
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6412
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6413
|
+
* scopes: [
|
|
6414
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6415
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6416
|
+
* ],
|
|
6417
|
+
* });
|
|
6418
|
+
*
|
|
6419
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6420
|
+
* const authClient = await auth.getClient();
|
|
6421
|
+
* google.options({auth: authClient});
|
|
6422
|
+
*
|
|
6423
|
+
* // Do the magic
|
|
6424
|
+
* const res = await vision.projects.locations.images.annotate({
|
|
6425
|
+
* // 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`.
|
|
6426
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
6427
|
+
*
|
|
6428
|
+
* // Request body metadata
|
|
6429
|
+
* requestBody: {
|
|
6430
|
+
* // request body parameters
|
|
6431
|
+
* // {
|
|
6432
|
+
* // "labels": {},
|
|
6433
|
+
* // "parent": "my_parent",
|
|
6434
|
+
* // "requests": []
|
|
6435
|
+
* // }
|
|
6436
|
+
* },
|
|
6437
|
+
* });
|
|
6438
|
+
* console.log(res.data);
|
|
6439
|
+
*
|
|
6440
|
+
* // Example response
|
|
6441
|
+
* // {
|
|
6442
|
+
* // "responses": []
|
|
6443
|
+
* // }
|
|
6444
|
+
* }
|
|
6445
|
+
*
|
|
6446
|
+
* main().catch(e => {
|
|
6447
|
+
* console.error(e);
|
|
6448
|
+
* throw e;
|
|
6449
|
+
* });
|
|
6450
|
+
*
|
|
6451
|
+
* ```
|
|
5532
6452
|
*
|
|
5533
6453
|
* @param params - Parameters for request
|
|
5534
6454
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5543,6 +6463,70 @@ export declare namespace vision_v1 {
|
|
|
5543
6463
|
annotate(callback: BodyResponseCallback<Schema$BatchAnnotateImagesResponse>): void;
|
|
5544
6464
|
/**
|
|
5545
6465
|
* 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.
|
|
6466
|
+
* @example
|
|
6467
|
+
* ```js
|
|
6468
|
+
* // Before running the sample:
|
|
6469
|
+
* // - Enable the API at:
|
|
6470
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6471
|
+
* // - Login into gcloud by running:
|
|
6472
|
+
* // ```sh
|
|
6473
|
+
* // $ gcloud auth application-default login
|
|
6474
|
+
* // ```
|
|
6475
|
+
* // - Install the npm module by running:
|
|
6476
|
+
* // ```sh
|
|
6477
|
+
* // $ npm install googleapis
|
|
6478
|
+
* // ```
|
|
6479
|
+
*
|
|
6480
|
+
* const {google} = require('googleapis');
|
|
6481
|
+
* const vision = google.vision('v1');
|
|
6482
|
+
*
|
|
6483
|
+
* async function main() {
|
|
6484
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6485
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6486
|
+
* scopes: [
|
|
6487
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6488
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6489
|
+
* ],
|
|
6490
|
+
* });
|
|
6491
|
+
*
|
|
6492
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6493
|
+
* const authClient = await auth.getClient();
|
|
6494
|
+
* google.options({auth: authClient});
|
|
6495
|
+
*
|
|
6496
|
+
* // Do the magic
|
|
6497
|
+
* const res = await vision.projects.locations.images.asyncBatchAnnotate({
|
|
6498
|
+
* // 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`.
|
|
6499
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
6500
|
+
*
|
|
6501
|
+
* // Request body metadata
|
|
6502
|
+
* requestBody: {
|
|
6503
|
+
* // request body parameters
|
|
6504
|
+
* // {
|
|
6505
|
+
* // "labels": {},
|
|
6506
|
+
* // "outputConfig": {},
|
|
6507
|
+
* // "parent": "my_parent",
|
|
6508
|
+
* // "requests": []
|
|
6509
|
+
* // }
|
|
6510
|
+
* },
|
|
6511
|
+
* });
|
|
6512
|
+
* console.log(res.data);
|
|
6513
|
+
*
|
|
6514
|
+
* // Example response
|
|
6515
|
+
* // {
|
|
6516
|
+
* // "done": false,
|
|
6517
|
+
* // "error": {},
|
|
6518
|
+
* // "metadata": {},
|
|
6519
|
+
* // "name": "my_name",
|
|
6520
|
+
* // "response": {}
|
|
6521
|
+
* // }
|
|
6522
|
+
* }
|
|
6523
|
+
*
|
|
6524
|
+
* main().catch(e => {
|
|
6525
|
+
* console.error(e);
|
|
6526
|
+
* throw e;
|
|
6527
|
+
* });
|
|
6528
|
+
*
|
|
6529
|
+
* ```
|
|
5546
6530
|
*
|
|
5547
6531
|
* @param params - Parameters for request
|
|
5548
6532
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5581,6 +6565,59 @@ export declare namespace vision_v1 {
|
|
|
5581
6565
|
constructor(context: APIRequestContext);
|
|
5582
6566
|
/**
|
|
5583
6567
|
* Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
|
6568
|
+
* @example
|
|
6569
|
+
* ```js
|
|
6570
|
+
* // Before running the sample:
|
|
6571
|
+
* // - Enable the API at:
|
|
6572
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6573
|
+
* // - Login into gcloud by running:
|
|
6574
|
+
* // ```sh
|
|
6575
|
+
* // $ gcloud auth application-default login
|
|
6576
|
+
* // ```
|
|
6577
|
+
* // - Install the npm module by running:
|
|
6578
|
+
* // ```sh
|
|
6579
|
+
* // $ npm install googleapis
|
|
6580
|
+
* // ```
|
|
6581
|
+
*
|
|
6582
|
+
* const {google} = require('googleapis');
|
|
6583
|
+
* const vision = google.vision('v1');
|
|
6584
|
+
*
|
|
6585
|
+
* async function main() {
|
|
6586
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6587
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6588
|
+
* scopes: [
|
|
6589
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6590
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6591
|
+
* ],
|
|
6592
|
+
* });
|
|
6593
|
+
*
|
|
6594
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6595
|
+
* const authClient = await auth.getClient();
|
|
6596
|
+
* google.options({auth: authClient});
|
|
6597
|
+
*
|
|
6598
|
+
* // Do the magic
|
|
6599
|
+
* const res = await vision.projects.locations.operations.get({
|
|
6600
|
+
* // The name of the operation resource.
|
|
6601
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
6602
|
+
* });
|
|
6603
|
+
* console.log(res.data);
|
|
6604
|
+
*
|
|
6605
|
+
* // Example response
|
|
6606
|
+
* // {
|
|
6607
|
+
* // "done": false,
|
|
6608
|
+
* // "error": {},
|
|
6609
|
+
* // "metadata": {},
|
|
6610
|
+
* // "name": "my_name",
|
|
6611
|
+
* // "response": {}
|
|
6612
|
+
* // }
|
|
6613
|
+
* }
|
|
6614
|
+
*
|
|
6615
|
+
* main().catch(e => {
|
|
6616
|
+
* console.error(e);
|
|
6617
|
+
* throw e;
|
|
6618
|
+
* });
|
|
6619
|
+
*
|
|
6620
|
+
* ```
|
|
5584
6621
|
*
|
|
5585
6622
|
* @param params - Parameters for request
|
|
5586
6623
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5606,6 +6643,73 @@ export declare namespace vision_v1 {
|
|
|
5606
6643
|
constructor(context: APIRequestContext);
|
|
5607
6644
|
/**
|
|
5608
6645
|
* Creates and returns a new product resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid.
|
|
6646
|
+
* @example
|
|
6647
|
+
* ```js
|
|
6648
|
+
* // Before running the sample:
|
|
6649
|
+
* // - Enable the API at:
|
|
6650
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6651
|
+
* // - Login into gcloud by running:
|
|
6652
|
+
* // ```sh
|
|
6653
|
+
* // $ gcloud auth application-default login
|
|
6654
|
+
* // ```
|
|
6655
|
+
* // - Install the npm module by running:
|
|
6656
|
+
* // ```sh
|
|
6657
|
+
* // $ npm install googleapis
|
|
6658
|
+
* // ```
|
|
6659
|
+
*
|
|
6660
|
+
* const {google} = require('googleapis');
|
|
6661
|
+
* const vision = google.vision('v1');
|
|
6662
|
+
*
|
|
6663
|
+
* async function main() {
|
|
6664
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6665
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6666
|
+
* scopes: [
|
|
6667
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6668
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6669
|
+
* ],
|
|
6670
|
+
* });
|
|
6671
|
+
*
|
|
6672
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6673
|
+
* const authClient = await auth.getClient();
|
|
6674
|
+
* google.options({auth: authClient});
|
|
6675
|
+
*
|
|
6676
|
+
* // Do the magic
|
|
6677
|
+
* const res = await vision.projects.locations.products.create({
|
|
6678
|
+
* // Required. The project in which the Product should be created. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
6679
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
6680
|
+
* // A user-supplied resource id for this Product. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character `/`.
|
|
6681
|
+
* productId: 'placeholder-value',
|
|
6682
|
+
*
|
|
6683
|
+
* // Request body metadata
|
|
6684
|
+
* requestBody: {
|
|
6685
|
+
* // request body parameters
|
|
6686
|
+
* // {
|
|
6687
|
+
* // "description": "my_description",
|
|
6688
|
+
* // "displayName": "my_displayName",
|
|
6689
|
+
* // "name": "my_name",
|
|
6690
|
+
* // "productCategory": "my_productCategory",
|
|
6691
|
+
* // "productLabels": []
|
|
6692
|
+
* // }
|
|
6693
|
+
* },
|
|
6694
|
+
* });
|
|
6695
|
+
* console.log(res.data);
|
|
6696
|
+
*
|
|
6697
|
+
* // Example response
|
|
6698
|
+
* // {
|
|
6699
|
+
* // "description": "my_description",
|
|
6700
|
+
* // "displayName": "my_displayName",
|
|
6701
|
+
* // "name": "my_name",
|
|
6702
|
+
* // "productCategory": "my_productCategory",
|
|
6703
|
+
* // "productLabels": []
|
|
6704
|
+
* // }
|
|
6705
|
+
* }
|
|
6706
|
+
*
|
|
6707
|
+
* main().catch(e => {
|
|
6708
|
+
* console.error(e);
|
|
6709
|
+
* throw e;
|
|
6710
|
+
* });
|
|
6711
|
+
*
|
|
6712
|
+
* ```
|
|
5609
6713
|
*
|
|
5610
6714
|
* @param params - Parameters for request
|
|
5611
6715
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5620,6 +6724,53 @@ export declare namespace vision_v1 {
|
|
|
5620
6724
|
create(callback: BodyResponseCallback<Schema$Product>): void;
|
|
5621
6725
|
/**
|
|
5622
6726
|
* Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.
|
|
6727
|
+
* @example
|
|
6728
|
+
* ```js
|
|
6729
|
+
* // Before running the sample:
|
|
6730
|
+
* // - Enable the API at:
|
|
6731
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6732
|
+
* // - Login into gcloud by running:
|
|
6733
|
+
* // ```sh
|
|
6734
|
+
* // $ gcloud auth application-default login
|
|
6735
|
+
* // ```
|
|
6736
|
+
* // - Install the npm module by running:
|
|
6737
|
+
* // ```sh
|
|
6738
|
+
* // $ npm install googleapis
|
|
6739
|
+
* // ```
|
|
6740
|
+
*
|
|
6741
|
+
* const {google} = require('googleapis');
|
|
6742
|
+
* const vision = google.vision('v1');
|
|
6743
|
+
*
|
|
6744
|
+
* async function main() {
|
|
6745
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6746
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6747
|
+
* scopes: [
|
|
6748
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6749
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6750
|
+
* ],
|
|
6751
|
+
* });
|
|
6752
|
+
*
|
|
6753
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6754
|
+
* const authClient = await auth.getClient();
|
|
6755
|
+
* google.options({auth: authClient});
|
|
6756
|
+
*
|
|
6757
|
+
* // Do the magic
|
|
6758
|
+
* const res = await vision.projects.locations.products.delete({
|
|
6759
|
+
* // Required. Resource name of product to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
|
|
6760
|
+
* name: 'projects/my-project/locations/my-location/products/my-product',
|
|
6761
|
+
* });
|
|
6762
|
+
* console.log(res.data);
|
|
6763
|
+
*
|
|
6764
|
+
* // Example response
|
|
6765
|
+
* // {}
|
|
6766
|
+
* }
|
|
6767
|
+
*
|
|
6768
|
+
* main().catch(e => {
|
|
6769
|
+
* console.error(e);
|
|
6770
|
+
* throw e;
|
|
6771
|
+
* });
|
|
6772
|
+
*
|
|
6773
|
+
* ```
|
|
5623
6774
|
*
|
|
5624
6775
|
* @param params - Parameters for request
|
|
5625
6776
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5634,6 +6785,59 @@ export declare namespace vision_v1 {
|
|
|
5634
6785
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5635
6786
|
/**
|
|
5636
6787
|
* Gets information associated with a Product. Possible errors: * Returns NOT_FOUND if the Product does not exist.
|
|
6788
|
+
* @example
|
|
6789
|
+
* ```js
|
|
6790
|
+
* // Before running the sample:
|
|
6791
|
+
* // - Enable the API at:
|
|
6792
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6793
|
+
* // - Login into gcloud by running:
|
|
6794
|
+
* // ```sh
|
|
6795
|
+
* // $ gcloud auth application-default login
|
|
6796
|
+
* // ```
|
|
6797
|
+
* // - Install the npm module by running:
|
|
6798
|
+
* // ```sh
|
|
6799
|
+
* // $ npm install googleapis
|
|
6800
|
+
* // ```
|
|
6801
|
+
*
|
|
6802
|
+
* const {google} = require('googleapis');
|
|
6803
|
+
* const vision = google.vision('v1');
|
|
6804
|
+
*
|
|
6805
|
+
* async function main() {
|
|
6806
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6807
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6808
|
+
* scopes: [
|
|
6809
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6810
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6811
|
+
* ],
|
|
6812
|
+
* });
|
|
6813
|
+
*
|
|
6814
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6815
|
+
* const authClient = await auth.getClient();
|
|
6816
|
+
* google.options({auth: authClient});
|
|
6817
|
+
*
|
|
6818
|
+
* // Do the magic
|
|
6819
|
+
* const res = await vision.projects.locations.products.get({
|
|
6820
|
+
* // Required. Resource name of the Product to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
|
|
6821
|
+
* name: 'projects/my-project/locations/my-location/products/my-product',
|
|
6822
|
+
* });
|
|
6823
|
+
* console.log(res.data);
|
|
6824
|
+
*
|
|
6825
|
+
* // Example response
|
|
6826
|
+
* // {
|
|
6827
|
+
* // "description": "my_description",
|
|
6828
|
+
* // "displayName": "my_displayName",
|
|
6829
|
+
* // "name": "my_name",
|
|
6830
|
+
* // "productCategory": "my_productCategory",
|
|
6831
|
+
* // "productLabels": []
|
|
6832
|
+
* // }
|
|
6833
|
+
* }
|
|
6834
|
+
*
|
|
6835
|
+
* main().catch(e => {
|
|
6836
|
+
* console.error(e);
|
|
6837
|
+
* throw e;
|
|
6838
|
+
* });
|
|
6839
|
+
*
|
|
6840
|
+
* ```
|
|
5637
6841
|
*
|
|
5638
6842
|
* @param params - Parameters for request
|
|
5639
6843
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5648,6 +6852,60 @@ export declare namespace vision_v1 {
|
|
|
5648
6852
|
get(callback: BodyResponseCallback<Schema$Product>): void;
|
|
5649
6853
|
/**
|
|
5650
6854
|
* Lists products in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
|
|
6855
|
+
* @example
|
|
6856
|
+
* ```js
|
|
6857
|
+
* // Before running the sample:
|
|
6858
|
+
* // - Enable the API at:
|
|
6859
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6860
|
+
* // - Login into gcloud by running:
|
|
6861
|
+
* // ```sh
|
|
6862
|
+
* // $ gcloud auth application-default login
|
|
6863
|
+
* // ```
|
|
6864
|
+
* // - Install the npm module by running:
|
|
6865
|
+
* // ```sh
|
|
6866
|
+
* // $ npm install googleapis
|
|
6867
|
+
* // ```
|
|
6868
|
+
*
|
|
6869
|
+
* const {google} = require('googleapis');
|
|
6870
|
+
* const vision = google.vision('v1');
|
|
6871
|
+
*
|
|
6872
|
+
* async function main() {
|
|
6873
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6874
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6875
|
+
* scopes: [
|
|
6876
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6877
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6878
|
+
* ],
|
|
6879
|
+
* });
|
|
6880
|
+
*
|
|
6881
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6882
|
+
* const authClient = await auth.getClient();
|
|
6883
|
+
* google.options({auth: authClient});
|
|
6884
|
+
*
|
|
6885
|
+
* // Do the magic
|
|
6886
|
+
* const res = await vision.projects.locations.products.list({
|
|
6887
|
+
* // The maximum number of items to return. Default 10, maximum 100.
|
|
6888
|
+
* pageSize: 'placeholder-value',
|
|
6889
|
+
* // The next_page_token returned from a previous List request, if any.
|
|
6890
|
+
* pageToken: 'placeholder-value',
|
|
6891
|
+
* // Required. The project OR ProductSet from which Products should be listed. Format: `projects/PROJECT_ID/locations/LOC_ID`
|
|
6892
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
6893
|
+
* });
|
|
6894
|
+
* console.log(res.data);
|
|
6895
|
+
*
|
|
6896
|
+
* // Example response
|
|
6897
|
+
* // {
|
|
6898
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
6899
|
+
* // "products": []
|
|
6900
|
+
* // }
|
|
6901
|
+
* }
|
|
6902
|
+
*
|
|
6903
|
+
* main().catch(e => {
|
|
6904
|
+
* console.error(e);
|
|
6905
|
+
* throw e;
|
|
6906
|
+
* });
|
|
6907
|
+
*
|
|
6908
|
+
* ```
|
|
5651
6909
|
*
|
|
5652
6910
|
* @param params - Parameters for request
|
|
5653
6911
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5662,6 +6920,73 @@ export declare namespace vision_v1 {
|
|
|
5662
6920
|
list(callback: BodyResponseCallback<Schema$ListProductsResponse>): void;
|
|
5663
6921
|
/**
|
|
5664
6922
|
* Makes changes to a Product resource. Only the `display_name`, `description`, and `labels` fields can be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. Possible errors: * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask.
|
|
6923
|
+
* @example
|
|
6924
|
+
* ```js
|
|
6925
|
+
* // Before running the sample:
|
|
6926
|
+
* // - Enable the API at:
|
|
6927
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6928
|
+
* // - Login into gcloud by running:
|
|
6929
|
+
* // ```sh
|
|
6930
|
+
* // $ gcloud auth application-default login
|
|
6931
|
+
* // ```
|
|
6932
|
+
* // - Install the npm module by running:
|
|
6933
|
+
* // ```sh
|
|
6934
|
+
* // $ npm install googleapis
|
|
6935
|
+
* // ```
|
|
6936
|
+
*
|
|
6937
|
+
* const {google} = require('googleapis');
|
|
6938
|
+
* const vision = google.vision('v1');
|
|
6939
|
+
*
|
|
6940
|
+
* async function main() {
|
|
6941
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6942
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6943
|
+
* scopes: [
|
|
6944
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6945
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6946
|
+
* ],
|
|
6947
|
+
* });
|
|
6948
|
+
*
|
|
6949
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6950
|
+
* const authClient = await auth.getClient();
|
|
6951
|
+
* google.options({auth: authClient});
|
|
6952
|
+
*
|
|
6953
|
+
* // Do the magic
|
|
6954
|
+
* const res = await vision.projects.locations.products.patch({
|
|
6955
|
+
* // The resource name of the product. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is ignored when creating a product.
|
|
6956
|
+
* name: 'projects/my-project/locations/my-location/products/my-product',
|
|
6957
|
+
* // The FieldMask that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include `product_labels`, `display_name`, and `description`.
|
|
6958
|
+
* updateMask: 'placeholder-value',
|
|
6959
|
+
*
|
|
6960
|
+
* // Request body metadata
|
|
6961
|
+
* requestBody: {
|
|
6962
|
+
* // request body parameters
|
|
6963
|
+
* // {
|
|
6964
|
+
* // "description": "my_description",
|
|
6965
|
+
* // "displayName": "my_displayName",
|
|
6966
|
+
* // "name": "my_name",
|
|
6967
|
+
* // "productCategory": "my_productCategory",
|
|
6968
|
+
* // "productLabels": []
|
|
6969
|
+
* // }
|
|
6970
|
+
* },
|
|
6971
|
+
* });
|
|
6972
|
+
* console.log(res.data);
|
|
6973
|
+
*
|
|
6974
|
+
* // Example response
|
|
6975
|
+
* // {
|
|
6976
|
+
* // "description": "my_description",
|
|
6977
|
+
* // "displayName": "my_displayName",
|
|
6978
|
+
* // "name": "my_name",
|
|
6979
|
+
* // "productCategory": "my_productCategory",
|
|
6980
|
+
* // "productLabels": []
|
|
6981
|
+
* // }
|
|
6982
|
+
* }
|
|
6983
|
+
*
|
|
6984
|
+
* main().catch(e => {
|
|
6985
|
+
* console.error(e);
|
|
6986
|
+
* throw e;
|
|
6987
|
+
* });
|
|
6988
|
+
*
|
|
6989
|
+
* ```
|
|
5665
6990
|
*
|
|
5666
6991
|
* @param params - Parameters for request
|
|
5667
6992
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5676,6 +7001,69 @@ export declare namespace vision_v1 {
|
|
|
5676
7001
|
patch(callback: BodyResponseCallback<Schema$Product>): void;
|
|
5677
7002
|
/**
|
|
5678
7003
|
* Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. `Operation.metadata` contains `BatchOperationMetadata`. (progress)
|
|
7004
|
+
* @example
|
|
7005
|
+
* ```js
|
|
7006
|
+
* // Before running the sample:
|
|
7007
|
+
* // - Enable the API at:
|
|
7008
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7009
|
+
* // - Login into gcloud by running:
|
|
7010
|
+
* // ```sh
|
|
7011
|
+
* // $ gcloud auth application-default login
|
|
7012
|
+
* // ```
|
|
7013
|
+
* // - Install the npm module by running:
|
|
7014
|
+
* // ```sh
|
|
7015
|
+
* // $ npm install googleapis
|
|
7016
|
+
* // ```
|
|
7017
|
+
*
|
|
7018
|
+
* const {google} = require('googleapis');
|
|
7019
|
+
* const vision = google.vision('v1');
|
|
7020
|
+
*
|
|
7021
|
+
* async function main() {
|
|
7022
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7023
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7024
|
+
* scopes: [
|
|
7025
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7026
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7027
|
+
* ],
|
|
7028
|
+
* });
|
|
7029
|
+
*
|
|
7030
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7031
|
+
* const authClient = await auth.getClient();
|
|
7032
|
+
* google.options({auth: authClient});
|
|
7033
|
+
*
|
|
7034
|
+
* // Do the magic
|
|
7035
|
+
* const res = await vision.projects.locations.products.purge({
|
|
7036
|
+
* // Required. The project and location in which the Products should be deleted. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
7037
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
7038
|
+
*
|
|
7039
|
+
* // Request body metadata
|
|
7040
|
+
* requestBody: {
|
|
7041
|
+
* // request body parameters
|
|
7042
|
+
* // {
|
|
7043
|
+
* // "deleteOrphanProducts": false,
|
|
7044
|
+
* // "force": false,
|
|
7045
|
+
* // "productSetPurgeConfig": {}
|
|
7046
|
+
* // }
|
|
7047
|
+
* },
|
|
7048
|
+
* });
|
|
7049
|
+
* console.log(res.data);
|
|
7050
|
+
*
|
|
7051
|
+
* // Example response
|
|
7052
|
+
* // {
|
|
7053
|
+
* // "done": false,
|
|
7054
|
+
* // "error": {},
|
|
7055
|
+
* // "metadata": {},
|
|
7056
|
+
* // "name": "my_name",
|
|
7057
|
+
* // "response": {}
|
|
7058
|
+
* // }
|
|
7059
|
+
* }
|
|
7060
|
+
*
|
|
7061
|
+
* main().catch(e => {
|
|
7062
|
+
* console.error(e);
|
|
7063
|
+
* throw e;
|
|
7064
|
+
* });
|
|
7065
|
+
*
|
|
7066
|
+
* ```
|
|
5679
7067
|
*
|
|
5680
7068
|
* @param params - Parameters for request
|
|
5681
7069
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5758,6 +7146,69 @@ export declare namespace vision_v1 {
|
|
|
5758
7146
|
constructor(context: APIRequestContext);
|
|
5759
7147
|
/**
|
|
5760
7148
|
* Creates and returns a new ReferenceImage resource. The `bounding_poly` field is optional. If `bounding_poly` is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected. * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
|
|
7149
|
+
* @example
|
|
7150
|
+
* ```js
|
|
7151
|
+
* // Before running the sample:
|
|
7152
|
+
* // - Enable the API at:
|
|
7153
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7154
|
+
* // - Login into gcloud by running:
|
|
7155
|
+
* // ```sh
|
|
7156
|
+
* // $ gcloud auth application-default login
|
|
7157
|
+
* // ```
|
|
7158
|
+
* // - Install the npm module by running:
|
|
7159
|
+
* // ```sh
|
|
7160
|
+
* // $ npm install googleapis
|
|
7161
|
+
* // ```
|
|
7162
|
+
*
|
|
7163
|
+
* const {google} = require('googleapis');
|
|
7164
|
+
* const vision = google.vision('v1');
|
|
7165
|
+
*
|
|
7166
|
+
* async function main() {
|
|
7167
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7168
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7169
|
+
* scopes: [
|
|
7170
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7171
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7172
|
+
* ],
|
|
7173
|
+
* });
|
|
7174
|
+
*
|
|
7175
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7176
|
+
* const authClient = await auth.getClient();
|
|
7177
|
+
* google.options({auth: authClient});
|
|
7178
|
+
*
|
|
7179
|
+
* // Do the magic
|
|
7180
|
+
* const res = await vision.projects.locations.products.referenceImages.create({
|
|
7181
|
+
* // Required. Resource name of the product in which to create the reference image. Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
|
|
7182
|
+
* parent: 'projects/my-project/locations/my-location/products/my-product',
|
|
7183
|
+
* // A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character `/`.
|
|
7184
|
+
* referenceImageId: 'placeholder-value',
|
|
7185
|
+
*
|
|
7186
|
+
* // Request body metadata
|
|
7187
|
+
* requestBody: {
|
|
7188
|
+
* // request body parameters
|
|
7189
|
+
* // {
|
|
7190
|
+
* // "boundingPolys": [],
|
|
7191
|
+
* // "name": "my_name",
|
|
7192
|
+
* // "uri": "my_uri"
|
|
7193
|
+
* // }
|
|
7194
|
+
* },
|
|
7195
|
+
* });
|
|
7196
|
+
* console.log(res.data);
|
|
7197
|
+
*
|
|
7198
|
+
* // Example response
|
|
7199
|
+
* // {
|
|
7200
|
+
* // "boundingPolys": [],
|
|
7201
|
+
* // "name": "my_name",
|
|
7202
|
+
* // "uri": "my_uri"
|
|
7203
|
+
* // }
|
|
7204
|
+
* }
|
|
7205
|
+
*
|
|
7206
|
+
* main().catch(e => {
|
|
7207
|
+
* console.error(e);
|
|
7208
|
+
* throw e;
|
|
7209
|
+
* });
|
|
7210
|
+
*
|
|
7211
|
+
* ```
|
|
5761
7212
|
*
|
|
5762
7213
|
* @param params - Parameters for request
|
|
5763
7214
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5772,6 +7223,53 @@ export declare namespace vision_v1 {
|
|
|
5772
7223
|
create(callback: BodyResponseCallback<Schema$ReferenceImage>): void;
|
|
5773
7224
|
/**
|
|
5774
7225
|
* Permanently deletes a reference image. The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage.
|
|
7226
|
+
* @example
|
|
7227
|
+
* ```js
|
|
7228
|
+
* // Before running the sample:
|
|
7229
|
+
* // - Enable the API at:
|
|
7230
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7231
|
+
* // - Login into gcloud by running:
|
|
7232
|
+
* // ```sh
|
|
7233
|
+
* // $ gcloud auth application-default login
|
|
7234
|
+
* // ```
|
|
7235
|
+
* // - Install the npm module by running:
|
|
7236
|
+
* // ```sh
|
|
7237
|
+
* // $ npm install googleapis
|
|
7238
|
+
* // ```
|
|
7239
|
+
*
|
|
7240
|
+
* const {google} = require('googleapis');
|
|
7241
|
+
* const vision = google.vision('v1');
|
|
7242
|
+
*
|
|
7243
|
+
* async function main() {
|
|
7244
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7245
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7246
|
+
* scopes: [
|
|
7247
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7248
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7249
|
+
* ],
|
|
7250
|
+
* });
|
|
7251
|
+
*
|
|
7252
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7253
|
+
* const authClient = await auth.getClient();
|
|
7254
|
+
* google.options({auth: authClient});
|
|
7255
|
+
*
|
|
7256
|
+
* // Do the magic
|
|
7257
|
+
* const res = await vision.projects.locations.products.referenceImages.delete({
|
|
7258
|
+
* // Required. The resource name of the reference image to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
|
|
7259
|
+
* name: 'projects/my-project/locations/my-location/products/my-product/referenceImages/my-referenceImage',
|
|
7260
|
+
* });
|
|
7261
|
+
* console.log(res.data);
|
|
7262
|
+
*
|
|
7263
|
+
* // Example response
|
|
7264
|
+
* // {}
|
|
7265
|
+
* }
|
|
7266
|
+
*
|
|
7267
|
+
* main().catch(e => {
|
|
7268
|
+
* console.error(e);
|
|
7269
|
+
* throw e;
|
|
7270
|
+
* });
|
|
7271
|
+
*
|
|
7272
|
+
* ```
|
|
5775
7273
|
*
|
|
5776
7274
|
* @param params - Parameters for request
|
|
5777
7275
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5786,6 +7284,57 @@ export declare namespace vision_v1 {
|
|
|
5786
7284
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5787
7285
|
/**
|
|
5788
7286
|
* Gets information associated with a ReferenceImage. Possible errors: * Returns NOT_FOUND if the specified image does not exist.
|
|
7287
|
+
* @example
|
|
7288
|
+
* ```js
|
|
7289
|
+
* // Before running the sample:
|
|
7290
|
+
* // - Enable the API at:
|
|
7291
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7292
|
+
* // - Login into gcloud by running:
|
|
7293
|
+
* // ```sh
|
|
7294
|
+
* // $ gcloud auth application-default login
|
|
7295
|
+
* // ```
|
|
7296
|
+
* // - Install the npm module by running:
|
|
7297
|
+
* // ```sh
|
|
7298
|
+
* // $ npm install googleapis
|
|
7299
|
+
* // ```
|
|
7300
|
+
*
|
|
7301
|
+
* const {google} = require('googleapis');
|
|
7302
|
+
* const vision = google.vision('v1');
|
|
7303
|
+
*
|
|
7304
|
+
* async function main() {
|
|
7305
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7306
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7307
|
+
* scopes: [
|
|
7308
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7309
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7310
|
+
* ],
|
|
7311
|
+
* });
|
|
7312
|
+
*
|
|
7313
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7314
|
+
* const authClient = await auth.getClient();
|
|
7315
|
+
* google.options({auth: authClient});
|
|
7316
|
+
*
|
|
7317
|
+
* // Do the magic
|
|
7318
|
+
* const res = await vision.projects.locations.products.referenceImages.get({
|
|
7319
|
+
* // Required. The resource name of the ReferenceImage to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
|
|
7320
|
+
* name: 'projects/my-project/locations/my-location/products/my-product/referenceImages/my-referenceImage',
|
|
7321
|
+
* });
|
|
7322
|
+
* console.log(res.data);
|
|
7323
|
+
*
|
|
7324
|
+
* // Example response
|
|
7325
|
+
* // {
|
|
7326
|
+
* // "boundingPolys": [],
|
|
7327
|
+
* // "name": "my_name",
|
|
7328
|
+
* // "uri": "my_uri"
|
|
7329
|
+
* // }
|
|
7330
|
+
* }
|
|
7331
|
+
*
|
|
7332
|
+
* main().catch(e => {
|
|
7333
|
+
* console.error(e);
|
|
7334
|
+
* throw e;
|
|
7335
|
+
* });
|
|
7336
|
+
*
|
|
7337
|
+
* ```
|
|
5789
7338
|
*
|
|
5790
7339
|
* @param params - Parameters for request
|
|
5791
7340
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5800,6 +7349,61 @@ export declare namespace vision_v1 {
|
|
|
5800
7349
|
get(callback: BodyResponseCallback<Schema$ReferenceImage>): void;
|
|
5801
7350
|
/**
|
|
5802
7351
|
* Lists reference images. Possible errors: * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1.
|
|
7352
|
+
* @example
|
|
7353
|
+
* ```js
|
|
7354
|
+
* // Before running the sample:
|
|
7355
|
+
* // - Enable the API at:
|
|
7356
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7357
|
+
* // - Login into gcloud by running:
|
|
7358
|
+
* // ```sh
|
|
7359
|
+
* // $ gcloud auth application-default login
|
|
7360
|
+
* // ```
|
|
7361
|
+
* // - Install the npm module by running:
|
|
7362
|
+
* // ```sh
|
|
7363
|
+
* // $ npm install googleapis
|
|
7364
|
+
* // ```
|
|
7365
|
+
*
|
|
7366
|
+
* const {google} = require('googleapis');
|
|
7367
|
+
* const vision = google.vision('v1');
|
|
7368
|
+
*
|
|
7369
|
+
* async function main() {
|
|
7370
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7371
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7372
|
+
* scopes: [
|
|
7373
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7374
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7375
|
+
* ],
|
|
7376
|
+
* });
|
|
7377
|
+
*
|
|
7378
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7379
|
+
* const authClient = await auth.getClient();
|
|
7380
|
+
* google.options({auth: authClient});
|
|
7381
|
+
*
|
|
7382
|
+
* // Do the magic
|
|
7383
|
+
* const res = await vision.projects.locations.products.referenceImages.list({
|
|
7384
|
+
* // The maximum number of items to return. Default 10, maximum 100.
|
|
7385
|
+
* pageSize: 'placeholder-value',
|
|
7386
|
+
* // A token identifying a page of results to be returned. This is the value of `nextPageToken` returned in a previous reference image list request. Defaults to the first page if not specified.
|
|
7387
|
+
* pageToken: 'placeholder-value',
|
|
7388
|
+
* // Required. Resource name of the product containing the reference images. Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
|
|
7389
|
+
* parent: 'projects/my-project/locations/my-location/products/my-product',
|
|
7390
|
+
* });
|
|
7391
|
+
* console.log(res.data);
|
|
7392
|
+
*
|
|
7393
|
+
* // Example response
|
|
7394
|
+
* // {
|
|
7395
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
7396
|
+
* // "pageSize": 0,
|
|
7397
|
+
* // "referenceImages": []
|
|
7398
|
+
* // }
|
|
7399
|
+
* }
|
|
7400
|
+
*
|
|
7401
|
+
* main().catch(e => {
|
|
7402
|
+
* console.error(e);
|
|
7403
|
+
* throw e;
|
|
7404
|
+
* });
|
|
7405
|
+
*
|
|
7406
|
+
* ```
|
|
5803
7407
|
*
|
|
5804
7408
|
* @param params - Parameters for request
|
|
5805
7409
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5859,6 +7463,61 @@ export declare namespace vision_v1 {
|
|
|
5859
7463
|
constructor(context: APIRequestContext);
|
|
5860
7464
|
/**
|
|
5861
7465
|
* Adds a Product to the specified ProductSet. If the Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
|
|
7466
|
+
* @example
|
|
7467
|
+
* ```js
|
|
7468
|
+
* // Before running the sample:
|
|
7469
|
+
* // - Enable the API at:
|
|
7470
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7471
|
+
* // - Login into gcloud by running:
|
|
7472
|
+
* // ```sh
|
|
7473
|
+
* // $ gcloud auth application-default login
|
|
7474
|
+
* // ```
|
|
7475
|
+
* // - Install the npm module by running:
|
|
7476
|
+
* // ```sh
|
|
7477
|
+
* // $ npm install googleapis
|
|
7478
|
+
* // ```
|
|
7479
|
+
*
|
|
7480
|
+
* const {google} = require('googleapis');
|
|
7481
|
+
* const vision = google.vision('v1');
|
|
7482
|
+
*
|
|
7483
|
+
* async function main() {
|
|
7484
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7485
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7486
|
+
* scopes: [
|
|
7487
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7488
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7489
|
+
* ],
|
|
7490
|
+
* });
|
|
7491
|
+
*
|
|
7492
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7493
|
+
* const authClient = await auth.getClient();
|
|
7494
|
+
* google.options({auth: authClient});
|
|
7495
|
+
*
|
|
7496
|
+
* // Do the magic
|
|
7497
|
+
* const res = await vision.projects.locations.productSets.addProduct({
|
|
7498
|
+
* // Required. The resource name for the ProductSet to modify. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
7499
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
7500
|
+
*
|
|
7501
|
+
* // Request body metadata
|
|
7502
|
+
* requestBody: {
|
|
7503
|
+
* // request body parameters
|
|
7504
|
+
* // {
|
|
7505
|
+
* // "product": "my_product"
|
|
7506
|
+
* // }
|
|
7507
|
+
* },
|
|
7508
|
+
* });
|
|
7509
|
+
* console.log(res.data);
|
|
7510
|
+
*
|
|
7511
|
+
* // Example response
|
|
7512
|
+
* // {}
|
|
7513
|
+
* }
|
|
7514
|
+
*
|
|
7515
|
+
* main().catch(e => {
|
|
7516
|
+
* console.error(e);
|
|
7517
|
+
* throw e;
|
|
7518
|
+
* });
|
|
7519
|
+
*
|
|
7520
|
+
* ```
|
|
5862
7521
|
*
|
|
5863
7522
|
* @param params - Parameters for request
|
|
5864
7523
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5873,6 +7532,71 @@ export declare namespace vision_v1 {
|
|
|
5873
7532
|
addProduct(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5874
7533
|
/**
|
|
5875
7534
|
* Creates and returns a new ProductSet resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
|
|
7535
|
+
* @example
|
|
7536
|
+
* ```js
|
|
7537
|
+
* // Before running the sample:
|
|
7538
|
+
* // - Enable the API at:
|
|
7539
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7540
|
+
* // - Login into gcloud by running:
|
|
7541
|
+
* // ```sh
|
|
7542
|
+
* // $ gcloud auth application-default login
|
|
7543
|
+
* // ```
|
|
7544
|
+
* // - Install the npm module by running:
|
|
7545
|
+
* // ```sh
|
|
7546
|
+
* // $ npm install googleapis
|
|
7547
|
+
* // ```
|
|
7548
|
+
*
|
|
7549
|
+
* const {google} = require('googleapis');
|
|
7550
|
+
* const vision = google.vision('v1');
|
|
7551
|
+
*
|
|
7552
|
+
* async function main() {
|
|
7553
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7554
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7555
|
+
* scopes: [
|
|
7556
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7557
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7558
|
+
* ],
|
|
7559
|
+
* });
|
|
7560
|
+
*
|
|
7561
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7562
|
+
* const authClient = await auth.getClient();
|
|
7563
|
+
* google.options({auth: authClient});
|
|
7564
|
+
*
|
|
7565
|
+
* // Do the magic
|
|
7566
|
+
* const res = await vision.projects.locations.productSets.create({
|
|
7567
|
+
* // Required. The project in which the ProductSet should be created. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
7568
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
7569
|
+
* // A user-supplied resource id for this ProductSet. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character `/`.
|
|
7570
|
+
* productSetId: 'placeholder-value',
|
|
7571
|
+
*
|
|
7572
|
+
* // Request body metadata
|
|
7573
|
+
* requestBody: {
|
|
7574
|
+
* // request body parameters
|
|
7575
|
+
* // {
|
|
7576
|
+
* // "displayName": "my_displayName",
|
|
7577
|
+
* // "indexError": {},
|
|
7578
|
+
* // "indexTime": "my_indexTime",
|
|
7579
|
+
* // "name": "my_name"
|
|
7580
|
+
* // }
|
|
7581
|
+
* },
|
|
7582
|
+
* });
|
|
7583
|
+
* console.log(res.data);
|
|
7584
|
+
*
|
|
7585
|
+
* // Example response
|
|
7586
|
+
* // {
|
|
7587
|
+
* // "displayName": "my_displayName",
|
|
7588
|
+
* // "indexError": {},
|
|
7589
|
+
* // "indexTime": "my_indexTime",
|
|
7590
|
+
* // "name": "my_name"
|
|
7591
|
+
* // }
|
|
7592
|
+
* }
|
|
7593
|
+
*
|
|
7594
|
+
* main().catch(e => {
|
|
7595
|
+
* console.error(e);
|
|
7596
|
+
* throw e;
|
|
7597
|
+
* });
|
|
7598
|
+
*
|
|
7599
|
+
* ```
|
|
5876
7600
|
*
|
|
5877
7601
|
* @param params - Parameters for request
|
|
5878
7602
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5887,6 +7611,53 @@ export declare namespace vision_v1 {
|
|
|
5887
7611
|
create(callback: BodyResponseCallback<Schema$ProductSet>): void;
|
|
5888
7612
|
/**
|
|
5889
7613
|
* Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted. The actual image files are not deleted from Google Cloud Storage.
|
|
7614
|
+
* @example
|
|
7615
|
+
* ```js
|
|
7616
|
+
* // Before running the sample:
|
|
7617
|
+
* // - Enable the API at:
|
|
7618
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7619
|
+
* // - Login into gcloud by running:
|
|
7620
|
+
* // ```sh
|
|
7621
|
+
* // $ gcloud auth application-default login
|
|
7622
|
+
* // ```
|
|
7623
|
+
* // - Install the npm module by running:
|
|
7624
|
+
* // ```sh
|
|
7625
|
+
* // $ npm install googleapis
|
|
7626
|
+
* // ```
|
|
7627
|
+
*
|
|
7628
|
+
* const {google} = require('googleapis');
|
|
7629
|
+
* const vision = google.vision('v1');
|
|
7630
|
+
*
|
|
7631
|
+
* async function main() {
|
|
7632
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7633
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7634
|
+
* scopes: [
|
|
7635
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7636
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7637
|
+
* ],
|
|
7638
|
+
* });
|
|
7639
|
+
*
|
|
7640
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7641
|
+
* const authClient = await auth.getClient();
|
|
7642
|
+
* google.options({auth: authClient});
|
|
7643
|
+
*
|
|
7644
|
+
* // Do the magic
|
|
7645
|
+
* const res = await vision.projects.locations.productSets.delete({
|
|
7646
|
+
* // Required. Resource name of the ProductSet to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
7647
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
7648
|
+
* });
|
|
7649
|
+
* console.log(res.data);
|
|
7650
|
+
*
|
|
7651
|
+
* // Example response
|
|
7652
|
+
* // {}
|
|
7653
|
+
* }
|
|
7654
|
+
*
|
|
7655
|
+
* main().catch(e => {
|
|
7656
|
+
* console.error(e);
|
|
7657
|
+
* throw e;
|
|
7658
|
+
* });
|
|
7659
|
+
*
|
|
7660
|
+
* ```
|
|
5890
7661
|
*
|
|
5891
7662
|
* @param params - Parameters for request
|
|
5892
7663
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5901,6 +7672,58 @@ export declare namespace vision_v1 {
|
|
|
5901
7672
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5902
7673
|
/**
|
|
5903
7674
|
* Gets information associated with a ProductSet. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist.
|
|
7675
|
+
* @example
|
|
7676
|
+
* ```js
|
|
7677
|
+
* // Before running the sample:
|
|
7678
|
+
* // - Enable the API at:
|
|
7679
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7680
|
+
* // - Login into gcloud by running:
|
|
7681
|
+
* // ```sh
|
|
7682
|
+
* // $ gcloud auth application-default login
|
|
7683
|
+
* // ```
|
|
7684
|
+
* // - Install the npm module by running:
|
|
7685
|
+
* // ```sh
|
|
7686
|
+
* // $ npm install googleapis
|
|
7687
|
+
* // ```
|
|
7688
|
+
*
|
|
7689
|
+
* const {google} = require('googleapis');
|
|
7690
|
+
* const vision = google.vision('v1');
|
|
7691
|
+
*
|
|
7692
|
+
* async function main() {
|
|
7693
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7694
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7695
|
+
* scopes: [
|
|
7696
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7697
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7698
|
+
* ],
|
|
7699
|
+
* });
|
|
7700
|
+
*
|
|
7701
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7702
|
+
* const authClient = await auth.getClient();
|
|
7703
|
+
* google.options({auth: authClient});
|
|
7704
|
+
*
|
|
7705
|
+
* // Do the magic
|
|
7706
|
+
* const res = await vision.projects.locations.productSets.get({
|
|
7707
|
+
* // Required. Resource name of the ProductSet to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
7708
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
7709
|
+
* });
|
|
7710
|
+
* console.log(res.data);
|
|
7711
|
+
*
|
|
7712
|
+
* // Example response
|
|
7713
|
+
* // {
|
|
7714
|
+
* // "displayName": "my_displayName",
|
|
7715
|
+
* // "indexError": {},
|
|
7716
|
+
* // "indexTime": "my_indexTime",
|
|
7717
|
+
* // "name": "my_name"
|
|
7718
|
+
* // }
|
|
7719
|
+
* }
|
|
7720
|
+
*
|
|
7721
|
+
* main().catch(e => {
|
|
7722
|
+
* console.error(e);
|
|
7723
|
+
* throw e;
|
|
7724
|
+
* });
|
|
7725
|
+
*
|
|
7726
|
+
* ```
|
|
5904
7727
|
*
|
|
5905
7728
|
* @param params - Parameters for request
|
|
5906
7729
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5915,6 +7738,67 @@ export declare namespace vision_v1 {
|
|
|
5915
7738
|
get(callback: BodyResponseCallback<Schema$ProductSet>): void;
|
|
5916
7739
|
/**
|
|
5917
7740
|
* Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see ImportProductSetsGcsSource.csv_file_uri.
|
|
7741
|
+
* @example
|
|
7742
|
+
* ```js
|
|
7743
|
+
* // Before running the sample:
|
|
7744
|
+
* // - Enable the API at:
|
|
7745
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7746
|
+
* // - Login into gcloud by running:
|
|
7747
|
+
* // ```sh
|
|
7748
|
+
* // $ gcloud auth application-default login
|
|
7749
|
+
* // ```
|
|
7750
|
+
* // - Install the npm module by running:
|
|
7751
|
+
* // ```sh
|
|
7752
|
+
* // $ npm install googleapis
|
|
7753
|
+
* // ```
|
|
7754
|
+
*
|
|
7755
|
+
* const {google} = require('googleapis');
|
|
7756
|
+
* const vision = google.vision('v1');
|
|
7757
|
+
*
|
|
7758
|
+
* async function main() {
|
|
7759
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7760
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7761
|
+
* scopes: [
|
|
7762
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7763
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7764
|
+
* ],
|
|
7765
|
+
* });
|
|
7766
|
+
*
|
|
7767
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7768
|
+
* const authClient = await auth.getClient();
|
|
7769
|
+
* google.options({auth: authClient});
|
|
7770
|
+
*
|
|
7771
|
+
* // Do the magic
|
|
7772
|
+
* const res = await vision.projects.locations.productSets.import({
|
|
7773
|
+
* // Required. The project in which the ProductSets should be imported. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
7774
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
7775
|
+
*
|
|
7776
|
+
* // Request body metadata
|
|
7777
|
+
* requestBody: {
|
|
7778
|
+
* // request body parameters
|
|
7779
|
+
* // {
|
|
7780
|
+
* // "inputConfig": {}
|
|
7781
|
+
* // }
|
|
7782
|
+
* },
|
|
7783
|
+
* });
|
|
7784
|
+
* console.log(res.data);
|
|
7785
|
+
*
|
|
7786
|
+
* // Example response
|
|
7787
|
+
* // {
|
|
7788
|
+
* // "done": false,
|
|
7789
|
+
* // "error": {},
|
|
7790
|
+
* // "metadata": {},
|
|
7791
|
+
* // "name": "my_name",
|
|
7792
|
+
* // "response": {}
|
|
7793
|
+
* // }
|
|
7794
|
+
* }
|
|
7795
|
+
*
|
|
7796
|
+
* main().catch(e => {
|
|
7797
|
+
* console.error(e);
|
|
7798
|
+
* throw e;
|
|
7799
|
+
* });
|
|
7800
|
+
*
|
|
7801
|
+
* ```
|
|
5918
7802
|
*
|
|
5919
7803
|
* @param params - Parameters for request
|
|
5920
7804
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5929,6 +7813,60 @@ export declare namespace vision_v1 {
|
|
|
5929
7813
|
import(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5930
7814
|
/**
|
|
5931
7815
|
* Lists ProductSets in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
|
|
7816
|
+
* @example
|
|
7817
|
+
* ```js
|
|
7818
|
+
* // Before running the sample:
|
|
7819
|
+
* // - Enable the API at:
|
|
7820
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7821
|
+
* // - Login into gcloud by running:
|
|
7822
|
+
* // ```sh
|
|
7823
|
+
* // $ gcloud auth application-default login
|
|
7824
|
+
* // ```
|
|
7825
|
+
* // - Install the npm module by running:
|
|
7826
|
+
* // ```sh
|
|
7827
|
+
* // $ npm install googleapis
|
|
7828
|
+
* // ```
|
|
7829
|
+
*
|
|
7830
|
+
* const {google} = require('googleapis');
|
|
7831
|
+
* const vision = google.vision('v1');
|
|
7832
|
+
*
|
|
7833
|
+
* async function main() {
|
|
7834
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7835
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7836
|
+
* scopes: [
|
|
7837
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7838
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7839
|
+
* ],
|
|
7840
|
+
* });
|
|
7841
|
+
*
|
|
7842
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7843
|
+
* const authClient = await auth.getClient();
|
|
7844
|
+
* google.options({auth: authClient});
|
|
7845
|
+
*
|
|
7846
|
+
* // Do the magic
|
|
7847
|
+
* const res = await vision.projects.locations.productSets.list({
|
|
7848
|
+
* // The maximum number of items to return. Default 10, maximum 100.
|
|
7849
|
+
* pageSize: 'placeholder-value',
|
|
7850
|
+
* // The next_page_token returned from a previous List request, if any.
|
|
7851
|
+
* pageToken: 'placeholder-value',
|
|
7852
|
+
* // Required. The project from which ProductSets should be listed. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
7853
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
7854
|
+
* });
|
|
7855
|
+
* console.log(res.data);
|
|
7856
|
+
*
|
|
7857
|
+
* // Example response
|
|
7858
|
+
* // {
|
|
7859
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
7860
|
+
* // "productSets": []
|
|
7861
|
+
* // }
|
|
7862
|
+
* }
|
|
7863
|
+
*
|
|
7864
|
+
* main().catch(e => {
|
|
7865
|
+
* console.error(e);
|
|
7866
|
+
* throw e;
|
|
7867
|
+
* });
|
|
7868
|
+
*
|
|
7869
|
+
* ```
|
|
5932
7870
|
*
|
|
5933
7871
|
* @param params - Parameters for request
|
|
5934
7872
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5943,6 +7881,71 @@ export declare namespace vision_v1 {
|
|
|
5943
7881
|
list(callback: BodyResponseCallback<Schema$ListProductSetsResponse>): void;
|
|
5944
7882
|
/**
|
|
5945
7883
|
* Makes changes to a ProductSet resource. Only display_name can be updated currently. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.
|
|
7884
|
+
* @example
|
|
7885
|
+
* ```js
|
|
7886
|
+
* // Before running the sample:
|
|
7887
|
+
* // - Enable the API at:
|
|
7888
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7889
|
+
* // - Login into gcloud by running:
|
|
7890
|
+
* // ```sh
|
|
7891
|
+
* // $ gcloud auth application-default login
|
|
7892
|
+
* // ```
|
|
7893
|
+
* // - Install the npm module by running:
|
|
7894
|
+
* // ```sh
|
|
7895
|
+
* // $ npm install googleapis
|
|
7896
|
+
* // ```
|
|
7897
|
+
*
|
|
7898
|
+
* const {google} = require('googleapis');
|
|
7899
|
+
* const vision = google.vision('v1');
|
|
7900
|
+
*
|
|
7901
|
+
* async function main() {
|
|
7902
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7903
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7904
|
+
* scopes: [
|
|
7905
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7906
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7907
|
+
* ],
|
|
7908
|
+
* });
|
|
7909
|
+
*
|
|
7910
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7911
|
+
* const authClient = await auth.getClient();
|
|
7912
|
+
* google.options({auth: authClient});
|
|
7913
|
+
*
|
|
7914
|
+
* // Do the magic
|
|
7915
|
+
* const res = await vision.projects.locations.productSets.patch({
|
|
7916
|
+
* // The resource name of the ProductSet. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. This field is ignored when creating a ProductSet.
|
|
7917
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
7918
|
+
* // The FieldMask that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask path is `display_name`.
|
|
7919
|
+
* updateMask: 'placeholder-value',
|
|
7920
|
+
*
|
|
7921
|
+
* // Request body metadata
|
|
7922
|
+
* requestBody: {
|
|
7923
|
+
* // request body parameters
|
|
7924
|
+
* // {
|
|
7925
|
+
* // "displayName": "my_displayName",
|
|
7926
|
+
* // "indexError": {},
|
|
7927
|
+
* // "indexTime": "my_indexTime",
|
|
7928
|
+
* // "name": "my_name"
|
|
7929
|
+
* // }
|
|
7930
|
+
* },
|
|
7931
|
+
* });
|
|
7932
|
+
* console.log(res.data);
|
|
7933
|
+
*
|
|
7934
|
+
* // Example response
|
|
7935
|
+
* // {
|
|
7936
|
+
* // "displayName": "my_displayName",
|
|
7937
|
+
* // "indexError": {},
|
|
7938
|
+
* // "indexTime": "my_indexTime",
|
|
7939
|
+
* // "name": "my_name"
|
|
7940
|
+
* // }
|
|
7941
|
+
* }
|
|
7942
|
+
*
|
|
7943
|
+
* main().catch(e => {
|
|
7944
|
+
* console.error(e);
|
|
7945
|
+
* throw e;
|
|
7946
|
+
* });
|
|
7947
|
+
*
|
|
7948
|
+
* ```
|
|
5946
7949
|
*
|
|
5947
7950
|
* @param params - Parameters for request
|
|
5948
7951
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5957,6 +7960,61 @@ export declare namespace vision_v1 {
|
|
|
5957
7960
|
patch(callback: BodyResponseCallback<Schema$ProductSet>): void;
|
|
5958
7961
|
/**
|
|
5959
7962
|
* Removes a Product from the specified ProductSet.
|
|
7963
|
+
* @example
|
|
7964
|
+
* ```js
|
|
7965
|
+
* // Before running the sample:
|
|
7966
|
+
* // - Enable the API at:
|
|
7967
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7968
|
+
* // - Login into gcloud by running:
|
|
7969
|
+
* // ```sh
|
|
7970
|
+
* // $ gcloud auth application-default login
|
|
7971
|
+
* // ```
|
|
7972
|
+
* // - Install the npm module by running:
|
|
7973
|
+
* // ```sh
|
|
7974
|
+
* // $ npm install googleapis
|
|
7975
|
+
* // ```
|
|
7976
|
+
*
|
|
7977
|
+
* const {google} = require('googleapis');
|
|
7978
|
+
* const vision = google.vision('v1');
|
|
7979
|
+
*
|
|
7980
|
+
* async function main() {
|
|
7981
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7982
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7983
|
+
* scopes: [
|
|
7984
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7985
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7986
|
+
* ],
|
|
7987
|
+
* });
|
|
7988
|
+
*
|
|
7989
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7990
|
+
* const authClient = await auth.getClient();
|
|
7991
|
+
* google.options({auth: authClient});
|
|
7992
|
+
*
|
|
7993
|
+
* // Do the magic
|
|
7994
|
+
* const res = await vision.projects.locations.productSets.removeProduct({
|
|
7995
|
+
* // Required. The resource name for the ProductSet to modify. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
7996
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
7997
|
+
*
|
|
7998
|
+
* // Request body metadata
|
|
7999
|
+
* requestBody: {
|
|
8000
|
+
* // request body parameters
|
|
8001
|
+
* // {
|
|
8002
|
+
* // "product": "my_product"
|
|
8003
|
+
* // }
|
|
8004
|
+
* },
|
|
8005
|
+
* });
|
|
8006
|
+
* console.log(res.data);
|
|
8007
|
+
*
|
|
8008
|
+
* // Example response
|
|
8009
|
+
* // {}
|
|
8010
|
+
* }
|
|
8011
|
+
*
|
|
8012
|
+
* main().catch(e => {
|
|
8013
|
+
* console.error(e);
|
|
8014
|
+
* throw e;
|
|
8015
|
+
* });
|
|
8016
|
+
*
|
|
8017
|
+
* ```
|
|
5960
8018
|
*
|
|
5961
8019
|
* @param params - Parameters for request
|
|
5962
8020
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6059,6 +8117,60 @@ export declare namespace vision_v1 {
|
|
|
6059
8117
|
constructor(context: APIRequestContext);
|
|
6060
8118
|
/**
|
|
6061
8119
|
* Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
|
|
8120
|
+
* @example
|
|
8121
|
+
* ```js
|
|
8122
|
+
* // Before running the sample:
|
|
8123
|
+
* // - Enable the API at:
|
|
8124
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
8125
|
+
* // - Login into gcloud by running:
|
|
8126
|
+
* // ```sh
|
|
8127
|
+
* // $ gcloud auth application-default login
|
|
8128
|
+
* // ```
|
|
8129
|
+
* // - Install the npm module by running:
|
|
8130
|
+
* // ```sh
|
|
8131
|
+
* // $ npm install googleapis
|
|
8132
|
+
* // ```
|
|
8133
|
+
*
|
|
8134
|
+
* const {google} = require('googleapis');
|
|
8135
|
+
* const vision = google.vision('v1');
|
|
8136
|
+
*
|
|
8137
|
+
* async function main() {
|
|
8138
|
+
* const auth = new google.auth.GoogleAuth({
|
|
8139
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
8140
|
+
* scopes: [
|
|
8141
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
8142
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
8143
|
+
* ],
|
|
8144
|
+
* });
|
|
8145
|
+
*
|
|
8146
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
8147
|
+
* const authClient = await auth.getClient();
|
|
8148
|
+
* google.options({auth: authClient});
|
|
8149
|
+
*
|
|
8150
|
+
* // Do the magic
|
|
8151
|
+
* const res = await vision.projects.locations.productSets.products.list({
|
|
8152
|
+
* // Required. The ProductSet resource for which to retrieve Products. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
8153
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
8154
|
+
* // The maximum number of items to return. Default 10, maximum 100.
|
|
8155
|
+
* pageSize: 'placeholder-value',
|
|
8156
|
+
* // The next_page_token returned from a previous List request, if any.
|
|
8157
|
+
* pageToken: 'placeholder-value',
|
|
8158
|
+
* });
|
|
8159
|
+
* console.log(res.data);
|
|
8160
|
+
*
|
|
8161
|
+
* // Example response
|
|
8162
|
+
* // {
|
|
8163
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
8164
|
+
* // "products": []
|
|
8165
|
+
* // }
|
|
8166
|
+
* }
|
|
8167
|
+
*
|
|
8168
|
+
* main().catch(e => {
|
|
8169
|
+
* console.error(e);
|
|
8170
|
+
* throw e;
|
|
8171
|
+
* });
|
|
8172
|
+
*
|
|
8173
|
+
* ```
|
|
6062
8174
|
*
|
|
6063
8175
|
* @param params - Parameters for request
|
|
6064
8176
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6091,6 +8203,59 @@ export declare namespace vision_v1 {
|
|
|
6091
8203
|
constructor(context: APIRequestContext);
|
|
6092
8204
|
/**
|
|
6093
8205
|
* Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
|
8206
|
+
* @example
|
|
8207
|
+
* ```js
|
|
8208
|
+
* // Before running the sample:
|
|
8209
|
+
* // - Enable the API at:
|
|
8210
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
8211
|
+
* // - Login into gcloud by running:
|
|
8212
|
+
* // ```sh
|
|
8213
|
+
* // $ gcloud auth application-default login
|
|
8214
|
+
* // ```
|
|
8215
|
+
* // - Install the npm module by running:
|
|
8216
|
+
* // ```sh
|
|
8217
|
+
* // $ npm install googleapis
|
|
8218
|
+
* // ```
|
|
8219
|
+
*
|
|
8220
|
+
* const {google} = require('googleapis');
|
|
8221
|
+
* const vision = google.vision('v1');
|
|
8222
|
+
*
|
|
8223
|
+
* async function main() {
|
|
8224
|
+
* const auth = new google.auth.GoogleAuth({
|
|
8225
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
8226
|
+
* scopes: [
|
|
8227
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
8228
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
8229
|
+
* ],
|
|
8230
|
+
* });
|
|
8231
|
+
*
|
|
8232
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
8233
|
+
* const authClient = await auth.getClient();
|
|
8234
|
+
* google.options({auth: authClient});
|
|
8235
|
+
*
|
|
8236
|
+
* // Do the magic
|
|
8237
|
+
* const res = await vision.projects.operations.get({
|
|
8238
|
+
* // The name of the operation resource.
|
|
8239
|
+
* name: 'projects/my-project/operations/my-operation',
|
|
8240
|
+
* });
|
|
8241
|
+
* console.log(res.data);
|
|
8242
|
+
*
|
|
8243
|
+
* // Example response
|
|
8244
|
+
* // {
|
|
8245
|
+
* // "done": false,
|
|
8246
|
+
* // "error": {},
|
|
8247
|
+
* // "metadata": {},
|
|
8248
|
+
* // "name": "my_name",
|
|
8249
|
+
* // "response": {}
|
|
8250
|
+
* // }
|
|
8251
|
+
* }
|
|
8252
|
+
*
|
|
8253
|
+
* main().catch(e => {
|
|
8254
|
+
* console.error(e);
|
|
8255
|
+
* throw e;
|
|
8256
|
+
* });
|
|
8257
|
+
*
|
|
8258
|
+
* ```
|
|
6094
8259
|
*
|
|
6095
8260
|
* @param params - Parameters for request
|
|
6096
8261
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|