@googleapis/vision 1.5.4 → 3.0.1
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 +43 -0
- package/build/index.d.ts +1 -1
- package/build/index.js.map +1 -1
- package/build/v1.d.ts +2243 -77
- package/build/v1.js.map +1 -1
- package/build/v1p1beta1.d.ts +748 -25
- package/build/v1p1beta1.js.map +1 -1
- package/build/v1p2beta1.d.ts +748 -25
- package/build/v1p2beta1.js.map +1 -1
- package/index.ts +0 -1
- package/package.json +2 -2
- package/v1.ts +2377 -126
- package/v1p1beta1.ts +808 -43
- package/v1p2beta1.ts +808 -43
package/v1.ts
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
Compute,
|
|
24
24
|
UserRefreshClient,
|
|
25
25
|
BaseExternalAccountClient,
|
|
26
|
-
|
|
26
|
+
GaxiosResponseWithHTTP2,
|
|
27
27
|
GoogleConfigurable,
|
|
28
28
|
createAPIRequest,
|
|
29
29
|
MethodOptions,
|
|
@@ -5184,6 +5184,62 @@ export namespace vision_v1 {
|
|
|
5184
5184
|
|
|
5185
5185
|
/**
|
|
5186
5186
|
* 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.
|
|
5187
|
+
* @example
|
|
5188
|
+
* ```js
|
|
5189
|
+
* // Before running the sample:
|
|
5190
|
+
* // - Enable the API at:
|
|
5191
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5192
|
+
* // - Login into gcloud by running:
|
|
5193
|
+
* // ```sh
|
|
5194
|
+
* // $ gcloud auth application-default login
|
|
5195
|
+
* // ```
|
|
5196
|
+
* // - Install the npm module by running:
|
|
5197
|
+
* // ```sh
|
|
5198
|
+
* // $ npm install googleapis
|
|
5199
|
+
* // ```
|
|
5200
|
+
*
|
|
5201
|
+
* const {google} = require('googleapis');
|
|
5202
|
+
* const vision = google.vision('v1');
|
|
5203
|
+
*
|
|
5204
|
+
* async function main() {
|
|
5205
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5206
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5207
|
+
* scopes: [
|
|
5208
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5209
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5210
|
+
* ],
|
|
5211
|
+
* });
|
|
5212
|
+
*
|
|
5213
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5214
|
+
* const authClient = await auth.getClient();
|
|
5215
|
+
* google.options({auth: authClient});
|
|
5216
|
+
*
|
|
5217
|
+
* // Do the magic
|
|
5218
|
+
* const res = await vision.files.annotate({
|
|
5219
|
+
* // Request body metadata
|
|
5220
|
+
* requestBody: {
|
|
5221
|
+
* // request body parameters
|
|
5222
|
+
* // {
|
|
5223
|
+
* // "labels": {},
|
|
5224
|
+
* // "parent": "my_parent",
|
|
5225
|
+
* // "requests": []
|
|
5226
|
+
* // }
|
|
5227
|
+
* },
|
|
5228
|
+
* });
|
|
5229
|
+
* console.log(res.data);
|
|
5230
|
+
*
|
|
5231
|
+
* // Example response
|
|
5232
|
+
* // {
|
|
5233
|
+
* // "responses": []
|
|
5234
|
+
* // }
|
|
5235
|
+
* }
|
|
5236
|
+
*
|
|
5237
|
+
* main().catch(e => {
|
|
5238
|
+
* console.error(e);
|
|
5239
|
+
* throw e;
|
|
5240
|
+
* });
|
|
5241
|
+
*
|
|
5242
|
+
* ```
|
|
5187
5243
|
*
|
|
5188
5244
|
* @param params - Parameters for request
|
|
5189
5245
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5193,11 +5249,11 @@ export namespace vision_v1 {
|
|
|
5193
5249
|
annotate(
|
|
5194
5250
|
params: Params$Resource$Files$Annotate,
|
|
5195
5251
|
options: StreamMethodOptions
|
|
5196
|
-
):
|
|
5252
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5197
5253
|
annotate(
|
|
5198
5254
|
params?: Params$Resource$Files$Annotate,
|
|
5199
5255
|
options?: MethodOptions
|
|
5200
|
-
):
|
|
5256
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateFilesResponse>>;
|
|
5201
5257
|
annotate(
|
|
5202
5258
|
params: Params$Resource$Files$Annotate,
|
|
5203
5259
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5232,8 +5288,8 @@ export namespace vision_v1 {
|
|
|
5232
5288
|
| BodyResponseCallback<Readable>
|
|
5233
5289
|
):
|
|
5234
5290
|
| void
|
|
5235
|
-
|
|
|
5236
|
-
|
|
|
5291
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateFilesResponse>>
|
|
5292
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5237
5293
|
let params = (paramsOrCallback || {}) as Params$Resource$Files$Annotate;
|
|
5238
5294
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
5239
5295
|
|
|
@@ -5275,6 +5331,66 @@ export namespace vision_v1 {
|
|
|
5275
5331
|
|
|
5276
5332
|
/**
|
|
5277
5333
|
* 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).
|
|
5334
|
+
* @example
|
|
5335
|
+
* ```js
|
|
5336
|
+
* // Before running the sample:
|
|
5337
|
+
* // - Enable the API at:
|
|
5338
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5339
|
+
* // - Login into gcloud by running:
|
|
5340
|
+
* // ```sh
|
|
5341
|
+
* // $ gcloud auth application-default login
|
|
5342
|
+
* // ```
|
|
5343
|
+
* // - Install the npm module by running:
|
|
5344
|
+
* // ```sh
|
|
5345
|
+
* // $ npm install googleapis
|
|
5346
|
+
* // ```
|
|
5347
|
+
*
|
|
5348
|
+
* const {google} = require('googleapis');
|
|
5349
|
+
* const vision = google.vision('v1');
|
|
5350
|
+
*
|
|
5351
|
+
* async function main() {
|
|
5352
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5353
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5354
|
+
* scopes: [
|
|
5355
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5356
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5357
|
+
* ],
|
|
5358
|
+
* });
|
|
5359
|
+
*
|
|
5360
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5361
|
+
* const authClient = await auth.getClient();
|
|
5362
|
+
* google.options({auth: authClient});
|
|
5363
|
+
*
|
|
5364
|
+
* // Do the magic
|
|
5365
|
+
* const res = await vision.files.asyncBatchAnnotate({
|
|
5366
|
+
* // Request body metadata
|
|
5367
|
+
* requestBody: {
|
|
5368
|
+
* // request body parameters
|
|
5369
|
+
* // {
|
|
5370
|
+
* // "labels": {},
|
|
5371
|
+
* // "parent": "my_parent",
|
|
5372
|
+
* // "requests": []
|
|
5373
|
+
* // }
|
|
5374
|
+
* },
|
|
5375
|
+
* });
|
|
5376
|
+
* console.log(res.data);
|
|
5377
|
+
*
|
|
5378
|
+
* // Example response
|
|
5379
|
+
* // {
|
|
5380
|
+
* // "done": false,
|
|
5381
|
+
* // "error": {},
|
|
5382
|
+
* // "metadata": {},
|
|
5383
|
+
* // "name": "my_name",
|
|
5384
|
+
* // "response": {}
|
|
5385
|
+
* // }
|
|
5386
|
+
* }
|
|
5387
|
+
*
|
|
5388
|
+
* main().catch(e => {
|
|
5389
|
+
* console.error(e);
|
|
5390
|
+
* throw e;
|
|
5391
|
+
* });
|
|
5392
|
+
*
|
|
5393
|
+
* ```
|
|
5278
5394
|
*
|
|
5279
5395
|
* @param params - Parameters for request
|
|
5280
5396
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5284,11 +5400,11 @@ export namespace vision_v1 {
|
|
|
5284
5400
|
asyncBatchAnnotate(
|
|
5285
5401
|
params: Params$Resource$Files$Asyncbatchannotate,
|
|
5286
5402
|
options: StreamMethodOptions
|
|
5287
|
-
):
|
|
5403
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5288
5404
|
asyncBatchAnnotate(
|
|
5289
5405
|
params?: Params$Resource$Files$Asyncbatchannotate,
|
|
5290
5406
|
options?: MethodOptions
|
|
5291
|
-
):
|
|
5407
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5292
5408
|
asyncBatchAnnotate(
|
|
5293
5409
|
params: Params$Resource$Files$Asyncbatchannotate,
|
|
5294
5410
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5317,7 +5433,10 @@ export namespace vision_v1 {
|
|
|
5317
5433
|
callback?:
|
|
5318
5434
|
| BodyResponseCallback<Schema$Operation>
|
|
5319
5435
|
| BodyResponseCallback<Readable>
|
|
5320
|
-
):
|
|
5436
|
+
):
|
|
5437
|
+
| void
|
|
5438
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
|
|
5439
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5321
5440
|
let params = (paramsOrCallback ||
|
|
5322
5441
|
{}) as Params$Resource$Files$Asyncbatchannotate;
|
|
5323
5442
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -5384,6 +5503,62 @@ export namespace vision_v1 {
|
|
|
5384
5503
|
|
|
5385
5504
|
/**
|
|
5386
5505
|
* Run image detection and annotation for a batch of images.
|
|
5506
|
+
* @example
|
|
5507
|
+
* ```js
|
|
5508
|
+
* // Before running the sample:
|
|
5509
|
+
* // - Enable the API at:
|
|
5510
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5511
|
+
* // - Login into gcloud by running:
|
|
5512
|
+
* // ```sh
|
|
5513
|
+
* // $ gcloud auth application-default login
|
|
5514
|
+
* // ```
|
|
5515
|
+
* // - Install the npm module by running:
|
|
5516
|
+
* // ```sh
|
|
5517
|
+
* // $ npm install googleapis
|
|
5518
|
+
* // ```
|
|
5519
|
+
*
|
|
5520
|
+
* const {google} = require('googleapis');
|
|
5521
|
+
* const vision = google.vision('v1');
|
|
5522
|
+
*
|
|
5523
|
+
* async function main() {
|
|
5524
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5525
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5526
|
+
* scopes: [
|
|
5527
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5528
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5529
|
+
* ],
|
|
5530
|
+
* });
|
|
5531
|
+
*
|
|
5532
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5533
|
+
* const authClient = await auth.getClient();
|
|
5534
|
+
* google.options({auth: authClient});
|
|
5535
|
+
*
|
|
5536
|
+
* // Do the magic
|
|
5537
|
+
* const res = await vision.images.annotate({
|
|
5538
|
+
* // Request body metadata
|
|
5539
|
+
* requestBody: {
|
|
5540
|
+
* // request body parameters
|
|
5541
|
+
* // {
|
|
5542
|
+
* // "labels": {},
|
|
5543
|
+
* // "parent": "my_parent",
|
|
5544
|
+
* // "requests": []
|
|
5545
|
+
* // }
|
|
5546
|
+
* },
|
|
5547
|
+
* });
|
|
5548
|
+
* console.log(res.data);
|
|
5549
|
+
*
|
|
5550
|
+
* // Example response
|
|
5551
|
+
* // {
|
|
5552
|
+
* // "responses": []
|
|
5553
|
+
* // }
|
|
5554
|
+
* }
|
|
5555
|
+
*
|
|
5556
|
+
* main().catch(e => {
|
|
5557
|
+
* console.error(e);
|
|
5558
|
+
* throw e;
|
|
5559
|
+
* });
|
|
5560
|
+
*
|
|
5561
|
+
* ```
|
|
5387
5562
|
*
|
|
5388
5563
|
* @param params - Parameters for request
|
|
5389
5564
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5393,11 +5568,11 @@ export namespace vision_v1 {
|
|
|
5393
5568
|
annotate(
|
|
5394
5569
|
params: Params$Resource$Images$Annotate,
|
|
5395
5570
|
options: StreamMethodOptions
|
|
5396
|
-
):
|
|
5571
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5397
5572
|
annotate(
|
|
5398
5573
|
params?: Params$Resource$Images$Annotate,
|
|
5399
5574
|
options?: MethodOptions
|
|
5400
|
-
):
|
|
5575
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateImagesResponse>>;
|
|
5401
5576
|
annotate(
|
|
5402
5577
|
params: Params$Resource$Images$Annotate,
|
|
5403
5578
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5432,8 +5607,8 @@ export namespace vision_v1 {
|
|
|
5432
5607
|
| BodyResponseCallback<Readable>
|
|
5433
5608
|
):
|
|
5434
5609
|
| void
|
|
5435
|
-
|
|
|
5436
|
-
|
|
|
5610
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateImagesResponse>>
|
|
5611
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5437
5612
|
let params = (paramsOrCallback || {}) as Params$Resource$Images$Annotate;
|
|
5438
5613
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
5439
5614
|
|
|
@@ -5478,6 +5653,67 @@ export namespace vision_v1 {
|
|
|
5478
5653
|
|
|
5479
5654
|
/**
|
|
5480
5655
|
* 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.
|
|
5656
|
+
* @example
|
|
5657
|
+
* ```js
|
|
5658
|
+
* // Before running the sample:
|
|
5659
|
+
* // - Enable the API at:
|
|
5660
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5661
|
+
* // - Login into gcloud by running:
|
|
5662
|
+
* // ```sh
|
|
5663
|
+
* // $ gcloud auth application-default login
|
|
5664
|
+
* // ```
|
|
5665
|
+
* // - Install the npm module by running:
|
|
5666
|
+
* // ```sh
|
|
5667
|
+
* // $ npm install googleapis
|
|
5668
|
+
* // ```
|
|
5669
|
+
*
|
|
5670
|
+
* const {google} = require('googleapis');
|
|
5671
|
+
* const vision = google.vision('v1');
|
|
5672
|
+
*
|
|
5673
|
+
* async function main() {
|
|
5674
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5675
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5676
|
+
* scopes: [
|
|
5677
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5678
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5679
|
+
* ],
|
|
5680
|
+
* });
|
|
5681
|
+
*
|
|
5682
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5683
|
+
* const authClient = await auth.getClient();
|
|
5684
|
+
* google.options({auth: authClient});
|
|
5685
|
+
*
|
|
5686
|
+
* // Do the magic
|
|
5687
|
+
* const res = await vision.images.asyncBatchAnnotate({
|
|
5688
|
+
* // Request body metadata
|
|
5689
|
+
* requestBody: {
|
|
5690
|
+
* // request body parameters
|
|
5691
|
+
* // {
|
|
5692
|
+
* // "labels": {},
|
|
5693
|
+
* // "outputConfig": {},
|
|
5694
|
+
* // "parent": "my_parent",
|
|
5695
|
+
* // "requests": []
|
|
5696
|
+
* // }
|
|
5697
|
+
* },
|
|
5698
|
+
* });
|
|
5699
|
+
* console.log(res.data);
|
|
5700
|
+
*
|
|
5701
|
+
* // Example response
|
|
5702
|
+
* // {
|
|
5703
|
+
* // "done": false,
|
|
5704
|
+
* // "error": {},
|
|
5705
|
+
* // "metadata": {},
|
|
5706
|
+
* // "name": "my_name",
|
|
5707
|
+
* // "response": {}
|
|
5708
|
+
* // }
|
|
5709
|
+
* }
|
|
5710
|
+
*
|
|
5711
|
+
* main().catch(e => {
|
|
5712
|
+
* console.error(e);
|
|
5713
|
+
* throw e;
|
|
5714
|
+
* });
|
|
5715
|
+
*
|
|
5716
|
+
* ```
|
|
5481
5717
|
*
|
|
5482
5718
|
* @param params - Parameters for request
|
|
5483
5719
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5487,11 +5723,11 @@ export namespace vision_v1 {
|
|
|
5487
5723
|
asyncBatchAnnotate(
|
|
5488
5724
|
params: Params$Resource$Images$Asyncbatchannotate,
|
|
5489
5725
|
options: StreamMethodOptions
|
|
5490
|
-
):
|
|
5726
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5491
5727
|
asyncBatchAnnotate(
|
|
5492
5728
|
params?: Params$Resource$Images$Asyncbatchannotate,
|
|
5493
5729
|
options?: MethodOptions
|
|
5494
|
-
):
|
|
5730
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5495
5731
|
asyncBatchAnnotate(
|
|
5496
5732
|
params: Params$Resource$Images$Asyncbatchannotate,
|
|
5497
5733
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5520,7 +5756,10 @@ export namespace vision_v1 {
|
|
|
5520
5756
|
callback?:
|
|
5521
5757
|
| BodyResponseCallback<Schema$Operation>
|
|
5522
5758
|
| BodyResponseCallback<Readable>
|
|
5523
|
-
):
|
|
5759
|
+
):
|
|
5760
|
+
| void
|
|
5761
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
|
|
5762
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5524
5763
|
let params = (paramsOrCallback ||
|
|
5525
5764
|
{}) as Params$Resource$Images$Asyncbatchannotate;
|
|
5526
5765
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -5596,6 +5835,59 @@ export namespace vision_v1 {
|
|
|
5596
5835
|
|
|
5597
5836
|
/**
|
|
5598
5837
|
* 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.
|
|
5838
|
+
* @example
|
|
5839
|
+
* ```js
|
|
5840
|
+
* // Before running the sample:
|
|
5841
|
+
* // - Enable the API at:
|
|
5842
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5843
|
+
* // - Login into gcloud by running:
|
|
5844
|
+
* // ```sh
|
|
5845
|
+
* // $ gcloud auth application-default login
|
|
5846
|
+
* // ```
|
|
5847
|
+
* // - Install the npm module by running:
|
|
5848
|
+
* // ```sh
|
|
5849
|
+
* // $ npm install googleapis
|
|
5850
|
+
* // ```
|
|
5851
|
+
*
|
|
5852
|
+
* const {google} = require('googleapis');
|
|
5853
|
+
* const vision = google.vision('v1');
|
|
5854
|
+
*
|
|
5855
|
+
* async function main() {
|
|
5856
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5857
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5858
|
+
* scopes: [
|
|
5859
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5860
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5861
|
+
* ],
|
|
5862
|
+
* });
|
|
5863
|
+
*
|
|
5864
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5865
|
+
* const authClient = await auth.getClient();
|
|
5866
|
+
* google.options({auth: authClient});
|
|
5867
|
+
*
|
|
5868
|
+
* // Do the magic
|
|
5869
|
+
* const res = await vision.locations.operations.get({
|
|
5870
|
+
* // The name of the operation resource.
|
|
5871
|
+
* name: 'locations/my-location/operations/my-operation',
|
|
5872
|
+
* });
|
|
5873
|
+
* console.log(res.data);
|
|
5874
|
+
*
|
|
5875
|
+
* // Example response
|
|
5876
|
+
* // {
|
|
5877
|
+
* // "done": false,
|
|
5878
|
+
* // "error": {},
|
|
5879
|
+
* // "metadata": {},
|
|
5880
|
+
* // "name": "my_name",
|
|
5881
|
+
* // "response": {}
|
|
5882
|
+
* // }
|
|
5883
|
+
* }
|
|
5884
|
+
*
|
|
5885
|
+
* main().catch(e => {
|
|
5886
|
+
* console.error(e);
|
|
5887
|
+
* throw e;
|
|
5888
|
+
* });
|
|
5889
|
+
*
|
|
5890
|
+
* ```
|
|
5599
5891
|
*
|
|
5600
5892
|
* @param params - Parameters for request
|
|
5601
5893
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5605,11 +5897,11 @@ export namespace vision_v1 {
|
|
|
5605
5897
|
get(
|
|
5606
5898
|
params: Params$Resource$Locations$Operations$Get,
|
|
5607
5899
|
options: StreamMethodOptions
|
|
5608
|
-
):
|
|
5900
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5609
5901
|
get(
|
|
5610
5902
|
params?: Params$Resource$Locations$Operations$Get,
|
|
5611
5903
|
options?: MethodOptions
|
|
5612
|
-
):
|
|
5904
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5613
5905
|
get(
|
|
5614
5906
|
params: Params$Resource$Locations$Operations$Get,
|
|
5615
5907
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5638,7 +5930,10 @@ export namespace vision_v1 {
|
|
|
5638
5930
|
callback?:
|
|
5639
5931
|
| BodyResponseCallback<Schema$Operation>
|
|
5640
5932
|
| BodyResponseCallback<Readable>
|
|
5641
|
-
):
|
|
5933
|
+
):
|
|
5934
|
+
| void
|
|
5935
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
|
|
5936
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5642
5937
|
let params = (paramsOrCallback ||
|
|
5643
5938
|
{}) as Params$Resource$Locations$Operations$Get;
|
|
5644
5939
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -5696,6 +5991,59 @@ export namespace vision_v1 {
|
|
|
5696
5991
|
|
|
5697
5992
|
/**
|
|
5698
5993
|
* 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`.
|
|
5994
|
+
* @example
|
|
5995
|
+
* ```js
|
|
5996
|
+
* // Before running the sample:
|
|
5997
|
+
* // - Enable the API at:
|
|
5998
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5999
|
+
* // - Login into gcloud by running:
|
|
6000
|
+
* // ```sh
|
|
6001
|
+
* // $ gcloud auth application-default login
|
|
6002
|
+
* // ```
|
|
6003
|
+
* // - Install the npm module by running:
|
|
6004
|
+
* // ```sh
|
|
6005
|
+
* // $ npm install googleapis
|
|
6006
|
+
* // ```
|
|
6007
|
+
*
|
|
6008
|
+
* const {google} = require('googleapis');
|
|
6009
|
+
* const vision = google.vision('v1');
|
|
6010
|
+
*
|
|
6011
|
+
* async function main() {
|
|
6012
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6013
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6014
|
+
* scopes: [
|
|
6015
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6016
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6017
|
+
* ],
|
|
6018
|
+
* });
|
|
6019
|
+
*
|
|
6020
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6021
|
+
* const authClient = await auth.getClient();
|
|
6022
|
+
* google.options({auth: authClient});
|
|
6023
|
+
*
|
|
6024
|
+
* // Do the magic
|
|
6025
|
+
* const res = await vision.operations.cancel({
|
|
6026
|
+
* // The name of the operation resource to be cancelled.
|
|
6027
|
+
* name: 'operations/.*',
|
|
6028
|
+
*
|
|
6029
|
+
* // Request body metadata
|
|
6030
|
+
* requestBody: {
|
|
6031
|
+
* // request body parameters
|
|
6032
|
+
* // {}
|
|
6033
|
+
* },
|
|
6034
|
+
* });
|
|
6035
|
+
* console.log(res.data);
|
|
6036
|
+
*
|
|
6037
|
+
* // Example response
|
|
6038
|
+
* // {}
|
|
6039
|
+
* }
|
|
6040
|
+
*
|
|
6041
|
+
* main().catch(e => {
|
|
6042
|
+
* console.error(e);
|
|
6043
|
+
* throw e;
|
|
6044
|
+
* });
|
|
6045
|
+
*
|
|
6046
|
+
* ```
|
|
5699
6047
|
*
|
|
5700
6048
|
* @param params - Parameters for request
|
|
5701
6049
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5705,11 +6053,11 @@ export namespace vision_v1 {
|
|
|
5705
6053
|
cancel(
|
|
5706
6054
|
params: Params$Resource$Operations$Cancel,
|
|
5707
6055
|
options: StreamMethodOptions
|
|
5708
|
-
):
|
|
6056
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5709
6057
|
cancel(
|
|
5710
6058
|
params?: Params$Resource$Operations$Cancel,
|
|
5711
6059
|
options?: MethodOptions
|
|
5712
|
-
):
|
|
6060
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
5713
6061
|
cancel(
|
|
5714
6062
|
params: Params$Resource$Operations$Cancel,
|
|
5715
6063
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5738,7 +6086,10 @@ export namespace vision_v1 {
|
|
|
5738
6086
|
callback?:
|
|
5739
6087
|
| BodyResponseCallback<Schema$Empty>
|
|
5740
6088
|
| BodyResponseCallback<Readable>
|
|
5741
|
-
):
|
|
6089
|
+
):
|
|
6090
|
+
| void
|
|
6091
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
|
|
6092
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5742
6093
|
let params = (paramsOrCallback ||
|
|
5743
6094
|
{}) as Params$Resource$Operations$Cancel;
|
|
5744
6095
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -5781,6 +6132,53 @@ export namespace vision_v1 {
|
|
|
5781
6132
|
|
|
5782
6133
|
/**
|
|
5783
6134
|
* 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`.
|
|
6135
|
+
* @example
|
|
6136
|
+
* ```js
|
|
6137
|
+
* // Before running the sample:
|
|
6138
|
+
* // - Enable the API at:
|
|
6139
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6140
|
+
* // - Login into gcloud by running:
|
|
6141
|
+
* // ```sh
|
|
6142
|
+
* // $ gcloud auth application-default login
|
|
6143
|
+
* // ```
|
|
6144
|
+
* // - Install the npm module by running:
|
|
6145
|
+
* // ```sh
|
|
6146
|
+
* // $ npm install googleapis
|
|
6147
|
+
* // ```
|
|
6148
|
+
*
|
|
6149
|
+
* const {google} = require('googleapis');
|
|
6150
|
+
* const vision = google.vision('v1');
|
|
6151
|
+
*
|
|
6152
|
+
* async function main() {
|
|
6153
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6154
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6155
|
+
* scopes: [
|
|
6156
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6157
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6158
|
+
* ],
|
|
6159
|
+
* });
|
|
6160
|
+
*
|
|
6161
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6162
|
+
* const authClient = await auth.getClient();
|
|
6163
|
+
* google.options({auth: authClient});
|
|
6164
|
+
*
|
|
6165
|
+
* // Do the magic
|
|
6166
|
+
* const res = await vision.operations.delete({
|
|
6167
|
+
* // The name of the operation resource to be deleted.
|
|
6168
|
+
* name: 'operations/.*',
|
|
6169
|
+
* });
|
|
6170
|
+
* console.log(res.data);
|
|
6171
|
+
*
|
|
6172
|
+
* // Example response
|
|
6173
|
+
* // {}
|
|
6174
|
+
* }
|
|
6175
|
+
*
|
|
6176
|
+
* main().catch(e => {
|
|
6177
|
+
* console.error(e);
|
|
6178
|
+
* throw e;
|
|
6179
|
+
* });
|
|
6180
|
+
*
|
|
6181
|
+
* ```
|
|
5784
6182
|
*
|
|
5785
6183
|
* @param params - Parameters for request
|
|
5786
6184
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5790,11 +6188,11 @@ export namespace vision_v1 {
|
|
|
5790
6188
|
delete(
|
|
5791
6189
|
params: Params$Resource$Operations$Delete,
|
|
5792
6190
|
options: StreamMethodOptions
|
|
5793
|
-
):
|
|
6191
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5794
6192
|
delete(
|
|
5795
6193
|
params?: Params$Resource$Operations$Delete,
|
|
5796
6194
|
options?: MethodOptions
|
|
5797
|
-
):
|
|
6195
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
5798
6196
|
delete(
|
|
5799
6197
|
params: Params$Resource$Operations$Delete,
|
|
5800
6198
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5823,7 +6221,10 @@ export namespace vision_v1 {
|
|
|
5823
6221
|
callback?:
|
|
5824
6222
|
| BodyResponseCallback<Schema$Empty>
|
|
5825
6223
|
| BodyResponseCallback<Readable>
|
|
5826
|
-
):
|
|
6224
|
+
):
|
|
6225
|
+
| void
|
|
6226
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
|
|
6227
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5827
6228
|
let params = (paramsOrCallback ||
|
|
5828
6229
|
{}) as Params$Resource$Operations$Delete;
|
|
5829
6230
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -5866,6 +6267,59 @@ export namespace vision_v1 {
|
|
|
5866
6267
|
|
|
5867
6268
|
/**
|
|
5868
6269
|
* 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.
|
|
6270
|
+
* @example
|
|
6271
|
+
* ```js
|
|
6272
|
+
* // Before running the sample:
|
|
6273
|
+
* // - Enable the API at:
|
|
6274
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6275
|
+
* // - Login into gcloud by running:
|
|
6276
|
+
* // ```sh
|
|
6277
|
+
* // $ gcloud auth application-default login
|
|
6278
|
+
* // ```
|
|
6279
|
+
* // - Install the npm module by running:
|
|
6280
|
+
* // ```sh
|
|
6281
|
+
* // $ npm install googleapis
|
|
6282
|
+
* // ```
|
|
6283
|
+
*
|
|
6284
|
+
* const {google} = require('googleapis');
|
|
6285
|
+
* const vision = google.vision('v1');
|
|
6286
|
+
*
|
|
6287
|
+
* async function main() {
|
|
6288
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6289
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6290
|
+
* scopes: [
|
|
6291
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6292
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6293
|
+
* ],
|
|
6294
|
+
* });
|
|
6295
|
+
*
|
|
6296
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6297
|
+
* const authClient = await auth.getClient();
|
|
6298
|
+
* google.options({auth: authClient});
|
|
6299
|
+
*
|
|
6300
|
+
* // Do the magic
|
|
6301
|
+
* const res = await vision.operations.get({
|
|
6302
|
+
* // The name of the operation resource.
|
|
6303
|
+
* name: 'operations/my-operation',
|
|
6304
|
+
* });
|
|
6305
|
+
* console.log(res.data);
|
|
6306
|
+
*
|
|
6307
|
+
* // Example response
|
|
6308
|
+
* // {
|
|
6309
|
+
* // "done": false,
|
|
6310
|
+
* // "error": {},
|
|
6311
|
+
* // "metadata": {},
|
|
6312
|
+
* // "name": "my_name",
|
|
6313
|
+
* // "response": {}
|
|
6314
|
+
* // }
|
|
6315
|
+
* }
|
|
6316
|
+
*
|
|
6317
|
+
* main().catch(e => {
|
|
6318
|
+
* console.error(e);
|
|
6319
|
+
* throw e;
|
|
6320
|
+
* });
|
|
6321
|
+
*
|
|
6322
|
+
* ```
|
|
5869
6323
|
*
|
|
5870
6324
|
* @param params - Parameters for request
|
|
5871
6325
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5875,11 +6329,11 @@ export namespace vision_v1 {
|
|
|
5875
6329
|
get(
|
|
5876
6330
|
params: Params$Resource$Operations$Get,
|
|
5877
6331
|
options: StreamMethodOptions
|
|
5878
|
-
):
|
|
6332
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5879
6333
|
get(
|
|
5880
6334
|
params?: Params$Resource$Operations$Get,
|
|
5881
6335
|
options?: MethodOptions
|
|
5882
|
-
):
|
|
6336
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5883
6337
|
get(
|
|
5884
6338
|
params: Params$Resource$Operations$Get,
|
|
5885
6339
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5908,7 +6362,10 @@ export namespace vision_v1 {
|
|
|
5908
6362
|
callback?:
|
|
5909
6363
|
| BodyResponseCallback<Schema$Operation>
|
|
5910
6364
|
| BodyResponseCallback<Readable>
|
|
5911
|
-
):
|
|
6365
|
+
):
|
|
6366
|
+
| void
|
|
6367
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
|
|
6368
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
5912
6369
|
let params = (paramsOrCallback || {}) as Params$Resource$Operations$Get;
|
|
5913
6370
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
5914
6371
|
|
|
@@ -5950,6 +6407,62 @@ export namespace vision_v1 {
|
|
|
5950
6407
|
|
|
5951
6408
|
/**
|
|
5952
6409
|
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
|
|
6410
|
+
* @example
|
|
6411
|
+
* ```js
|
|
6412
|
+
* // Before running the sample:
|
|
6413
|
+
* // - Enable the API at:
|
|
6414
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6415
|
+
* // - Login into gcloud by running:
|
|
6416
|
+
* // ```sh
|
|
6417
|
+
* // $ gcloud auth application-default login
|
|
6418
|
+
* // ```
|
|
6419
|
+
* // - Install the npm module by running:
|
|
6420
|
+
* // ```sh
|
|
6421
|
+
* // $ npm install googleapis
|
|
6422
|
+
* // ```
|
|
6423
|
+
*
|
|
6424
|
+
* const {google} = require('googleapis');
|
|
6425
|
+
* const vision = google.vision('v1');
|
|
6426
|
+
*
|
|
6427
|
+
* async function main() {
|
|
6428
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6429
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6430
|
+
* scopes: [
|
|
6431
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6432
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6433
|
+
* ],
|
|
6434
|
+
* });
|
|
6435
|
+
*
|
|
6436
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6437
|
+
* const authClient = await auth.getClient();
|
|
6438
|
+
* google.options({auth: authClient});
|
|
6439
|
+
*
|
|
6440
|
+
* // Do the magic
|
|
6441
|
+
* const res = await vision.operations.list({
|
|
6442
|
+
* // The standard list filter.
|
|
6443
|
+
* filter: 'placeholder-value',
|
|
6444
|
+
* // The name of the operation's parent resource.
|
|
6445
|
+
* name: 'operations',
|
|
6446
|
+
* // The standard list page size.
|
|
6447
|
+
* pageSize: 'placeholder-value',
|
|
6448
|
+
* // The standard list page token.
|
|
6449
|
+
* pageToken: 'placeholder-value',
|
|
6450
|
+
* });
|
|
6451
|
+
* console.log(res.data);
|
|
6452
|
+
*
|
|
6453
|
+
* // Example response
|
|
6454
|
+
* // {
|
|
6455
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
6456
|
+
* // "operations": []
|
|
6457
|
+
* // }
|
|
6458
|
+
* }
|
|
6459
|
+
*
|
|
6460
|
+
* main().catch(e => {
|
|
6461
|
+
* console.error(e);
|
|
6462
|
+
* throw e;
|
|
6463
|
+
* });
|
|
6464
|
+
*
|
|
6465
|
+
* ```
|
|
5953
6466
|
*
|
|
5954
6467
|
* @param params - Parameters for request
|
|
5955
6468
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5959,11 +6472,11 @@ export namespace vision_v1 {
|
|
|
5959
6472
|
list(
|
|
5960
6473
|
params: Params$Resource$Operations$List,
|
|
5961
6474
|
options: StreamMethodOptions
|
|
5962
|
-
):
|
|
6475
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5963
6476
|
list(
|
|
5964
6477
|
params?: Params$Resource$Operations$List,
|
|
5965
6478
|
options?: MethodOptions
|
|
5966
|
-
):
|
|
6479
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$ListOperationsResponse>>;
|
|
5967
6480
|
list(
|
|
5968
6481
|
params: Params$Resource$Operations$List,
|
|
5969
6482
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -5996,8 +6509,8 @@ export namespace vision_v1 {
|
|
|
5996
6509
|
| BodyResponseCallback<Readable>
|
|
5997
6510
|
):
|
|
5998
6511
|
| void
|
|
5999
|
-
|
|
|
6000
|
-
|
|
|
6512
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$ListOperationsResponse>>
|
|
6513
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6001
6514
|
let params = (paramsOrCallback || {}) as Params$Resource$Operations$List;
|
|
6002
6515
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
6003
6516
|
|
|
@@ -6105,6 +6618,65 @@ export namespace vision_v1 {
|
|
|
6105
6618
|
|
|
6106
6619
|
/**
|
|
6107
6620
|
* 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.
|
|
6621
|
+
* @example
|
|
6622
|
+
* ```js
|
|
6623
|
+
* // Before running the sample:
|
|
6624
|
+
* // - Enable the API at:
|
|
6625
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6626
|
+
* // - Login into gcloud by running:
|
|
6627
|
+
* // ```sh
|
|
6628
|
+
* // $ gcloud auth application-default login
|
|
6629
|
+
* // ```
|
|
6630
|
+
* // - Install the npm module by running:
|
|
6631
|
+
* // ```sh
|
|
6632
|
+
* // $ npm install googleapis
|
|
6633
|
+
* // ```
|
|
6634
|
+
*
|
|
6635
|
+
* const {google} = require('googleapis');
|
|
6636
|
+
* const vision = google.vision('v1');
|
|
6637
|
+
*
|
|
6638
|
+
* async function main() {
|
|
6639
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6640
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6641
|
+
* scopes: [
|
|
6642
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6643
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6644
|
+
* ],
|
|
6645
|
+
* });
|
|
6646
|
+
*
|
|
6647
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6648
|
+
* const authClient = await auth.getClient();
|
|
6649
|
+
* google.options({auth: authClient});
|
|
6650
|
+
*
|
|
6651
|
+
* // Do the magic
|
|
6652
|
+
* const res = await vision.projects.files.annotate({
|
|
6653
|
+
* // 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`.
|
|
6654
|
+
* parent: 'projects/my-project',
|
|
6655
|
+
*
|
|
6656
|
+
* // Request body metadata
|
|
6657
|
+
* requestBody: {
|
|
6658
|
+
* // request body parameters
|
|
6659
|
+
* // {
|
|
6660
|
+
* // "labels": {},
|
|
6661
|
+
* // "parent": "my_parent",
|
|
6662
|
+
* // "requests": []
|
|
6663
|
+
* // }
|
|
6664
|
+
* },
|
|
6665
|
+
* });
|
|
6666
|
+
* console.log(res.data);
|
|
6667
|
+
*
|
|
6668
|
+
* // Example response
|
|
6669
|
+
* // {
|
|
6670
|
+
* // "responses": []
|
|
6671
|
+
* // }
|
|
6672
|
+
* }
|
|
6673
|
+
*
|
|
6674
|
+
* main().catch(e => {
|
|
6675
|
+
* console.error(e);
|
|
6676
|
+
* throw e;
|
|
6677
|
+
* });
|
|
6678
|
+
*
|
|
6679
|
+
* ```
|
|
6108
6680
|
*
|
|
6109
6681
|
* @param params - Parameters for request
|
|
6110
6682
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6114,11 +6686,11 @@ export namespace vision_v1 {
|
|
|
6114
6686
|
annotate(
|
|
6115
6687
|
params: Params$Resource$Projects$Files$Annotate,
|
|
6116
6688
|
options: StreamMethodOptions
|
|
6117
|
-
):
|
|
6689
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6118
6690
|
annotate(
|
|
6119
6691
|
params?: Params$Resource$Projects$Files$Annotate,
|
|
6120
6692
|
options?: MethodOptions
|
|
6121
|
-
):
|
|
6693
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateFilesResponse>>;
|
|
6122
6694
|
annotate(
|
|
6123
6695
|
params: Params$Resource$Projects$Files$Annotate,
|
|
6124
6696
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6153,8 +6725,8 @@ export namespace vision_v1 {
|
|
|
6153
6725
|
| BodyResponseCallback<Readable>
|
|
6154
6726
|
):
|
|
6155
6727
|
| void
|
|
6156
|
-
|
|
|
6157
|
-
|
|
|
6728
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateFilesResponse>>
|
|
6729
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6158
6730
|
let params = (paramsOrCallback ||
|
|
6159
6731
|
{}) as Params$Resource$Projects$Files$Annotate;
|
|
6160
6732
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6200,6 +6772,69 @@ export namespace vision_v1 {
|
|
|
6200
6772
|
|
|
6201
6773
|
/**
|
|
6202
6774
|
* 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).
|
|
6775
|
+
* @example
|
|
6776
|
+
* ```js
|
|
6777
|
+
* // Before running the sample:
|
|
6778
|
+
* // - Enable the API at:
|
|
6779
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6780
|
+
* // - Login into gcloud by running:
|
|
6781
|
+
* // ```sh
|
|
6782
|
+
* // $ gcloud auth application-default login
|
|
6783
|
+
* // ```
|
|
6784
|
+
* // - Install the npm module by running:
|
|
6785
|
+
* // ```sh
|
|
6786
|
+
* // $ npm install googleapis
|
|
6787
|
+
* // ```
|
|
6788
|
+
*
|
|
6789
|
+
* const {google} = require('googleapis');
|
|
6790
|
+
* const vision = google.vision('v1');
|
|
6791
|
+
*
|
|
6792
|
+
* async function main() {
|
|
6793
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6794
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6795
|
+
* scopes: [
|
|
6796
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6797
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6798
|
+
* ],
|
|
6799
|
+
* });
|
|
6800
|
+
*
|
|
6801
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6802
|
+
* const authClient = await auth.getClient();
|
|
6803
|
+
* google.options({auth: authClient});
|
|
6804
|
+
*
|
|
6805
|
+
* // Do the magic
|
|
6806
|
+
* const res = await vision.projects.files.asyncBatchAnnotate({
|
|
6807
|
+
* // 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`.
|
|
6808
|
+
* parent: 'projects/my-project',
|
|
6809
|
+
*
|
|
6810
|
+
* // Request body metadata
|
|
6811
|
+
* requestBody: {
|
|
6812
|
+
* // request body parameters
|
|
6813
|
+
* // {
|
|
6814
|
+
* // "labels": {},
|
|
6815
|
+
* // "parent": "my_parent",
|
|
6816
|
+
* // "requests": []
|
|
6817
|
+
* // }
|
|
6818
|
+
* },
|
|
6819
|
+
* });
|
|
6820
|
+
* console.log(res.data);
|
|
6821
|
+
*
|
|
6822
|
+
* // Example response
|
|
6823
|
+
* // {
|
|
6824
|
+
* // "done": false,
|
|
6825
|
+
* // "error": {},
|
|
6826
|
+
* // "metadata": {},
|
|
6827
|
+
* // "name": "my_name",
|
|
6828
|
+
* // "response": {}
|
|
6829
|
+
* // }
|
|
6830
|
+
* }
|
|
6831
|
+
*
|
|
6832
|
+
* main().catch(e => {
|
|
6833
|
+
* console.error(e);
|
|
6834
|
+
* throw e;
|
|
6835
|
+
* });
|
|
6836
|
+
*
|
|
6837
|
+
* ```
|
|
6203
6838
|
*
|
|
6204
6839
|
* @param params - Parameters for request
|
|
6205
6840
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6209,11 +6844,11 @@ export namespace vision_v1 {
|
|
|
6209
6844
|
asyncBatchAnnotate(
|
|
6210
6845
|
params: Params$Resource$Projects$Files$Asyncbatchannotate,
|
|
6211
6846
|
options: StreamMethodOptions
|
|
6212
|
-
):
|
|
6847
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6213
6848
|
asyncBatchAnnotate(
|
|
6214
6849
|
params?: Params$Resource$Projects$Files$Asyncbatchannotate,
|
|
6215
6850
|
options?: MethodOptions
|
|
6216
|
-
):
|
|
6851
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
6217
6852
|
asyncBatchAnnotate(
|
|
6218
6853
|
params: Params$Resource$Projects$Files$Asyncbatchannotate,
|
|
6219
6854
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6242,7 +6877,10 @@ export namespace vision_v1 {
|
|
|
6242
6877
|
callback?:
|
|
6243
6878
|
| BodyResponseCallback<Schema$Operation>
|
|
6244
6879
|
| BodyResponseCallback<Readable>
|
|
6245
|
-
):
|
|
6880
|
+
):
|
|
6881
|
+
| void
|
|
6882
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
|
|
6883
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6246
6884
|
let params = (paramsOrCallback ||
|
|
6247
6885
|
{}) as Params$Resource$Projects$Files$Asyncbatchannotate;
|
|
6248
6886
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6320,6 +6958,65 @@ export namespace vision_v1 {
|
|
|
6320
6958
|
|
|
6321
6959
|
/**
|
|
6322
6960
|
* Run image detection and annotation for a batch of images.
|
|
6961
|
+
* @example
|
|
6962
|
+
* ```js
|
|
6963
|
+
* // Before running the sample:
|
|
6964
|
+
* // - Enable the API at:
|
|
6965
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6966
|
+
* // - Login into gcloud by running:
|
|
6967
|
+
* // ```sh
|
|
6968
|
+
* // $ gcloud auth application-default login
|
|
6969
|
+
* // ```
|
|
6970
|
+
* // - Install the npm module by running:
|
|
6971
|
+
* // ```sh
|
|
6972
|
+
* // $ npm install googleapis
|
|
6973
|
+
* // ```
|
|
6974
|
+
*
|
|
6975
|
+
* const {google} = require('googleapis');
|
|
6976
|
+
* const vision = google.vision('v1');
|
|
6977
|
+
*
|
|
6978
|
+
* async function main() {
|
|
6979
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6980
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6981
|
+
* scopes: [
|
|
6982
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6983
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6984
|
+
* ],
|
|
6985
|
+
* });
|
|
6986
|
+
*
|
|
6987
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6988
|
+
* const authClient = await auth.getClient();
|
|
6989
|
+
* google.options({auth: authClient});
|
|
6990
|
+
*
|
|
6991
|
+
* // Do the magic
|
|
6992
|
+
* const res = await vision.projects.images.annotate({
|
|
6993
|
+
* // 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`.
|
|
6994
|
+
* parent: 'projects/my-project',
|
|
6995
|
+
*
|
|
6996
|
+
* // Request body metadata
|
|
6997
|
+
* requestBody: {
|
|
6998
|
+
* // request body parameters
|
|
6999
|
+
* // {
|
|
7000
|
+
* // "labels": {},
|
|
7001
|
+
* // "parent": "my_parent",
|
|
7002
|
+
* // "requests": []
|
|
7003
|
+
* // }
|
|
7004
|
+
* },
|
|
7005
|
+
* });
|
|
7006
|
+
* console.log(res.data);
|
|
7007
|
+
*
|
|
7008
|
+
* // Example response
|
|
7009
|
+
* // {
|
|
7010
|
+
* // "responses": []
|
|
7011
|
+
* // }
|
|
7012
|
+
* }
|
|
7013
|
+
*
|
|
7014
|
+
* main().catch(e => {
|
|
7015
|
+
* console.error(e);
|
|
7016
|
+
* throw e;
|
|
7017
|
+
* });
|
|
7018
|
+
*
|
|
7019
|
+
* ```
|
|
6323
7020
|
*
|
|
6324
7021
|
* @param params - Parameters for request
|
|
6325
7022
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6329,11 +7026,11 @@ export namespace vision_v1 {
|
|
|
6329
7026
|
annotate(
|
|
6330
7027
|
params: Params$Resource$Projects$Images$Annotate,
|
|
6331
7028
|
options: StreamMethodOptions
|
|
6332
|
-
):
|
|
7029
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6333
7030
|
annotate(
|
|
6334
7031
|
params?: Params$Resource$Projects$Images$Annotate,
|
|
6335
7032
|
options?: MethodOptions
|
|
6336
|
-
):
|
|
7033
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateImagesResponse>>;
|
|
6337
7034
|
annotate(
|
|
6338
7035
|
params: Params$Resource$Projects$Images$Annotate,
|
|
6339
7036
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6368,8 +7065,8 @@ export namespace vision_v1 {
|
|
|
6368
7065
|
| BodyResponseCallback<Readable>
|
|
6369
7066
|
):
|
|
6370
7067
|
| void
|
|
6371
|
-
|
|
|
6372
|
-
|
|
|
7068
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateImagesResponse>>
|
|
7069
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6373
7070
|
let params = (paramsOrCallback ||
|
|
6374
7071
|
{}) as Params$Resource$Projects$Images$Annotate;
|
|
6375
7072
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6415,6 +7112,70 @@ export namespace vision_v1 {
|
|
|
6415
7112
|
|
|
6416
7113
|
/**
|
|
6417
7114
|
* 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.
|
|
7115
|
+
* @example
|
|
7116
|
+
* ```js
|
|
7117
|
+
* // Before running the sample:
|
|
7118
|
+
* // - Enable the API at:
|
|
7119
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7120
|
+
* // - Login into gcloud by running:
|
|
7121
|
+
* // ```sh
|
|
7122
|
+
* // $ gcloud auth application-default login
|
|
7123
|
+
* // ```
|
|
7124
|
+
* // - Install the npm module by running:
|
|
7125
|
+
* // ```sh
|
|
7126
|
+
* // $ npm install googleapis
|
|
7127
|
+
* // ```
|
|
7128
|
+
*
|
|
7129
|
+
* const {google} = require('googleapis');
|
|
7130
|
+
* const vision = google.vision('v1');
|
|
7131
|
+
*
|
|
7132
|
+
* async function main() {
|
|
7133
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7134
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7135
|
+
* scopes: [
|
|
7136
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7137
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7138
|
+
* ],
|
|
7139
|
+
* });
|
|
7140
|
+
*
|
|
7141
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7142
|
+
* const authClient = await auth.getClient();
|
|
7143
|
+
* google.options({auth: authClient});
|
|
7144
|
+
*
|
|
7145
|
+
* // Do the magic
|
|
7146
|
+
* const res = await vision.projects.images.asyncBatchAnnotate({
|
|
7147
|
+
* // 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`.
|
|
7148
|
+
* parent: 'projects/my-project',
|
|
7149
|
+
*
|
|
7150
|
+
* // Request body metadata
|
|
7151
|
+
* requestBody: {
|
|
7152
|
+
* // request body parameters
|
|
7153
|
+
* // {
|
|
7154
|
+
* // "labels": {},
|
|
7155
|
+
* // "outputConfig": {},
|
|
7156
|
+
* // "parent": "my_parent",
|
|
7157
|
+
* // "requests": []
|
|
7158
|
+
* // }
|
|
7159
|
+
* },
|
|
7160
|
+
* });
|
|
7161
|
+
* console.log(res.data);
|
|
7162
|
+
*
|
|
7163
|
+
* // Example response
|
|
7164
|
+
* // {
|
|
7165
|
+
* // "done": false,
|
|
7166
|
+
* // "error": {},
|
|
7167
|
+
* // "metadata": {},
|
|
7168
|
+
* // "name": "my_name",
|
|
7169
|
+
* // "response": {}
|
|
7170
|
+
* // }
|
|
7171
|
+
* }
|
|
7172
|
+
*
|
|
7173
|
+
* main().catch(e => {
|
|
7174
|
+
* console.error(e);
|
|
7175
|
+
* throw e;
|
|
7176
|
+
* });
|
|
7177
|
+
*
|
|
7178
|
+
* ```
|
|
6418
7179
|
*
|
|
6419
7180
|
* @param params - Parameters for request
|
|
6420
7181
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6424,11 +7185,11 @@ export namespace vision_v1 {
|
|
|
6424
7185
|
asyncBatchAnnotate(
|
|
6425
7186
|
params: Params$Resource$Projects$Images$Asyncbatchannotate,
|
|
6426
7187
|
options: StreamMethodOptions
|
|
6427
|
-
):
|
|
7188
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6428
7189
|
asyncBatchAnnotate(
|
|
6429
7190
|
params?: Params$Resource$Projects$Images$Asyncbatchannotate,
|
|
6430
7191
|
options?: MethodOptions
|
|
6431
|
-
):
|
|
7192
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
6432
7193
|
asyncBatchAnnotate(
|
|
6433
7194
|
params: Params$Resource$Projects$Images$Asyncbatchannotate,
|
|
6434
7195
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6457,7 +7218,10 @@ export namespace vision_v1 {
|
|
|
6457
7218
|
callback?:
|
|
6458
7219
|
| BodyResponseCallback<Schema$Operation>
|
|
6459
7220
|
| BodyResponseCallback<Readable>
|
|
6460
|
-
):
|
|
7221
|
+
):
|
|
7222
|
+
| void
|
|
7223
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
|
|
7224
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6461
7225
|
let params = (paramsOrCallback ||
|
|
6462
7226
|
{}) as Params$Resource$Projects$Images$Asyncbatchannotate;
|
|
6463
7227
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6556,6 +7320,65 @@ export namespace vision_v1 {
|
|
|
6556
7320
|
|
|
6557
7321
|
/**
|
|
6558
7322
|
* 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.
|
|
7323
|
+
* @example
|
|
7324
|
+
* ```js
|
|
7325
|
+
* // Before running the sample:
|
|
7326
|
+
* // - Enable the API at:
|
|
7327
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7328
|
+
* // - Login into gcloud by running:
|
|
7329
|
+
* // ```sh
|
|
7330
|
+
* // $ gcloud auth application-default login
|
|
7331
|
+
* // ```
|
|
7332
|
+
* // - Install the npm module by running:
|
|
7333
|
+
* // ```sh
|
|
7334
|
+
* // $ npm install googleapis
|
|
7335
|
+
* // ```
|
|
7336
|
+
*
|
|
7337
|
+
* const {google} = require('googleapis');
|
|
7338
|
+
* const vision = google.vision('v1');
|
|
7339
|
+
*
|
|
7340
|
+
* async function main() {
|
|
7341
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7342
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7343
|
+
* scopes: [
|
|
7344
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7345
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7346
|
+
* ],
|
|
7347
|
+
* });
|
|
7348
|
+
*
|
|
7349
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7350
|
+
* const authClient = await auth.getClient();
|
|
7351
|
+
* google.options({auth: authClient});
|
|
7352
|
+
*
|
|
7353
|
+
* // Do the magic
|
|
7354
|
+
* const res = await vision.projects.locations.files.annotate({
|
|
7355
|
+
* // 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`.
|
|
7356
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
7357
|
+
*
|
|
7358
|
+
* // Request body metadata
|
|
7359
|
+
* requestBody: {
|
|
7360
|
+
* // request body parameters
|
|
7361
|
+
* // {
|
|
7362
|
+
* // "labels": {},
|
|
7363
|
+
* // "parent": "my_parent",
|
|
7364
|
+
* // "requests": []
|
|
7365
|
+
* // }
|
|
7366
|
+
* },
|
|
7367
|
+
* });
|
|
7368
|
+
* console.log(res.data);
|
|
7369
|
+
*
|
|
7370
|
+
* // Example response
|
|
7371
|
+
* // {
|
|
7372
|
+
* // "responses": []
|
|
7373
|
+
* // }
|
|
7374
|
+
* }
|
|
7375
|
+
*
|
|
7376
|
+
* main().catch(e => {
|
|
7377
|
+
* console.error(e);
|
|
7378
|
+
* throw e;
|
|
7379
|
+
* });
|
|
7380
|
+
*
|
|
7381
|
+
* ```
|
|
6559
7382
|
*
|
|
6560
7383
|
* @param params - Parameters for request
|
|
6561
7384
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6565,11 +7388,11 @@ export namespace vision_v1 {
|
|
|
6565
7388
|
annotate(
|
|
6566
7389
|
params: Params$Resource$Projects$Locations$Files$Annotate,
|
|
6567
7390
|
options: StreamMethodOptions
|
|
6568
|
-
):
|
|
7391
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6569
7392
|
annotate(
|
|
6570
7393
|
params?: Params$Resource$Projects$Locations$Files$Annotate,
|
|
6571
7394
|
options?: MethodOptions
|
|
6572
|
-
):
|
|
7395
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateFilesResponse>>;
|
|
6573
7396
|
annotate(
|
|
6574
7397
|
params: Params$Resource$Projects$Locations$Files$Annotate,
|
|
6575
7398
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6604,8 +7427,8 @@ export namespace vision_v1 {
|
|
|
6604
7427
|
| BodyResponseCallback<Readable>
|
|
6605
7428
|
):
|
|
6606
7429
|
| void
|
|
6607
|
-
|
|
|
6608
|
-
|
|
|
7430
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateFilesResponse>>
|
|
7431
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6609
7432
|
let params = (paramsOrCallback ||
|
|
6610
7433
|
{}) as Params$Resource$Projects$Locations$Files$Annotate;
|
|
6611
7434
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6651,6 +7474,69 @@ export namespace vision_v1 {
|
|
|
6651
7474
|
|
|
6652
7475
|
/**
|
|
6653
7476
|
* 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).
|
|
7477
|
+
* @example
|
|
7478
|
+
* ```js
|
|
7479
|
+
* // Before running the sample:
|
|
7480
|
+
* // - Enable the API at:
|
|
7481
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7482
|
+
* // - Login into gcloud by running:
|
|
7483
|
+
* // ```sh
|
|
7484
|
+
* // $ gcloud auth application-default login
|
|
7485
|
+
* // ```
|
|
7486
|
+
* // - Install the npm module by running:
|
|
7487
|
+
* // ```sh
|
|
7488
|
+
* // $ npm install googleapis
|
|
7489
|
+
* // ```
|
|
7490
|
+
*
|
|
7491
|
+
* const {google} = require('googleapis');
|
|
7492
|
+
* const vision = google.vision('v1');
|
|
7493
|
+
*
|
|
7494
|
+
* async function main() {
|
|
7495
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7496
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7497
|
+
* scopes: [
|
|
7498
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7499
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7500
|
+
* ],
|
|
7501
|
+
* });
|
|
7502
|
+
*
|
|
7503
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7504
|
+
* const authClient = await auth.getClient();
|
|
7505
|
+
* google.options({auth: authClient});
|
|
7506
|
+
*
|
|
7507
|
+
* // Do the magic
|
|
7508
|
+
* const res = await vision.projects.locations.files.asyncBatchAnnotate({
|
|
7509
|
+
* // 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`.
|
|
7510
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
7511
|
+
*
|
|
7512
|
+
* // Request body metadata
|
|
7513
|
+
* requestBody: {
|
|
7514
|
+
* // request body parameters
|
|
7515
|
+
* // {
|
|
7516
|
+
* // "labels": {},
|
|
7517
|
+
* // "parent": "my_parent",
|
|
7518
|
+
* // "requests": []
|
|
7519
|
+
* // }
|
|
7520
|
+
* },
|
|
7521
|
+
* });
|
|
7522
|
+
* console.log(res.data);
|
|
7523
|
+
*
|
|
7524
|
+
* // Example response
|
|
7525
|
+
* // {
|
|
7526
|
+
* // "done": false,
|
|
7527
|
+
* // "error": {},
|
|
7528
|
+
* // "metadata": {},
|
|
7529
|
+
* // "name": "my_name",
|
|
7530
|
+
* // "response": {}
|
|
7531
|
+
* // }
|
|
7532
|
+
* }
|
|
7533
|
+
*
|
|
7534
|
+
* main().catch(e => {
|
|
7535
|
+
* console.error(e);
|
|
7536
|
+
* throw e;
|
|
7537
|
+
* });
|
|
7538
|
+
*
|
|
7539
|
+
* ```
|
|
6654
7540
|
*
|
|
6655
7541
|
* @param params - Parameters for request
|
|
6656
7542
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6660,11 +7546,11 @@ export namespace vision_v1 {
|
|
|
6660
7546
|
asyncBatchAnnotate(
|
|
6661
7547
|
params: Params$Resource$Projects$Locations$Files$Asyncbatchannotate,
|
|
6662
7548
|
options: StreamMethodOptions
|
|
6663
|
-
):
|
|
7549
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6664
7550
|
asyncBatchAnnotate(
|
|
6665
7551
|
params?: Params$Resource$Projects$Locations$Files$Asyncbatchannotate,
|
|
6666
7552
|
options?: MethodOptions
|
|
6667
|
-
):
|
|
7553
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
6668
7554
|
asyncBatchAnnotate(
|
|
6669
7555
|
params: Params$Resource$Projects$Locations$Files$Asyncbatchannotate,
|
|
6670
7556
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6693,7 +7579,10 @@ export namespace vision_v1 {
|
|
|
6693
7579
|
callback?:
|
|
6694
7580
|
| BodyResponseCallback<Schema$Operation>
|
|
6695
7581
|
| BodyResponseCallback<Readable>
|
|
6696
|
-
):
|
|
7582
|
+
):
|
|
7583
|
+
| void
|
|
7584
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
|
|
7585
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6697
7586
|
let params = (paramsOrCallback ||
|
|
6698
7587
|
{}) as Params$Resource$Projects$Locations$Files$Asyncbatchannotate;
|
|
6699
7588
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6772,6 +7661,65 @@ export namespace vision_v1 {
|
|
|
6772
7661
|
|
|
6773
7662
|
/**
|
|
6774
7663
|
* Run image detection and annotation for a batch of images.
|
|
7664
|
+
* @example
|
|
7665
|
+
* ```js
|
|
7666
|
+
* // Before running the sample:
|
|
7667
|
+
* // - Enable the API at:
|
|
7668
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7669
|
+
* // - Login into gcloud by running:
|
|
7670
|
+
* // ```sh
|
|
7671
|
+
* // $ gcloud auth application-default login
|
|
7672
|
+
* // ```
|
|
7673
|
+
* // - Install the npm module by running:
|
|
7674
|
+
* // ```sh
|
|
7675
|
+
* // $ npm install googleapis
|
|
7676
|
+
* // ```
|
|
7677
|
+
*
|
|
7678
|
+
* const {google} = require('googleapis');
|
|
7679
|
+
* const vision = google.vision('v1');
|
|
7680
|
+
*
|
|
7681
|
+
* async function main() {
|
|
7682
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7683
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7684
|
+
* scopes: [
|
|
7685
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7686
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7687
|
+
* ],
|
|
7688
|
+
* });
|
|
7689
|
+
*
|
|
7690
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7691
|
+
* const authClient = await auth.getClient();
|
|
7692
|
+
* google.options({auth: authClient});
|
|
7693
|
+
*
|
|
7694
|
+
* // Do the magic
|
|
7695
|
+
* const res = await vision.projects.locations.images.annotate({
|
|
7696
|
+
* // 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`.
|
|
7697
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
7698
|
+
*
|
|
7699
|
+
* // Request body metadata
|
|
7700
|
+
* requestBody: {
|
|
7701
|
+
* // request body parameters
|
|
7702
|
+
* // {
|
|
7703
|
+
* // "labels": {},
|
|
7704
|
+
* // "parent": "my_parent",
|
|
7705
|
+
* // "requests": []
|
|
7706
|
+
* // }
|
|
7707
|
+
* },
|
|
7708
|
+
* });
|
|
7709
|
+
* console.log(res.data);
|
|
7710
|
+
*
|
|
7711
|
+
* // Example response
|
|
7712
|
+
* // {
|
|
7713
|
+
* // "responses": []
|
|
7714
|
+
* // }
|
|
7715
|
+
* }
|
|
7716
|
+
*
|
|
7717
|
+
* main().catch(e => {
|
|
7718
|
+
* console.error(e);
|
|
7719
|
+
* throw e;
|
|
7720
|
+
* });
|
|
7721
|
+
*
|
|
7722
|
+
* ```
|
|
6775
7723
|
*
|
|
6776
7724
|
* @param params - Parameters for request
|
|
6777
7725
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6781,11 +7729,11 @@ export namespace vision_v1 {
|
|
|
6781
7729
|
annotate(
|
|
6782
7730
|
params: Params$Resource$Projects$Locations$Images$Annotate,
|
|
6783
7731
|
options: StreamMethodOptions
|
|
6784
|
-
):
|
|
7732
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6785
7733
|
annotate(
|
|
6786
7734
|
params?: Params$Resource$Projects$Locations$Images$Annotate,
|
|
6787
7735
|
options?: MethodOptions
|
|
6788
|
-
):
|
|
7736
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateImagesResponse>>;
|
|
6789
7737
|
annotate(
|
|
6790
7738
|
params: Params$Resource$Projects$Locations$Images$Annotate,
|
|
6791
7739
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6820,8 +7768,8 @@ export namespace vision_v1 {
|
|
|
6820
7768
|
| BodyResponseCallback<Readable>
|
|
6821
7769
|
):
|
|
6822
7770
|
| void
|
|
6823
|
-
|
|
|
6824
|
-
|
|
|
7771
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateImagesResponse>>
|
|
7772
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6825
7773
|
let params = (paramsOrCallback ||
|
|
6826
7774
|
{}) as Params$Resource$Projects$Locations$Images$Annotate;
|
|
6827
7775
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6867,6 +7815,70 @@ export namespace vision_v1 {
|
|
|
6867
7815
|
|
|
6868
7816
|
/**
|
|
6869
7817
|
* 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.
|
|
7818
|
+
* @example
|
|
7819
|
+
* ```js
|
|
7820
|
+
* // Before running the sample:
|
|
7821
|
+
* // - Enable the API at:
|
|
7822
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7823
|
+
* // - Login into gcloud by running:
|
|
7824
|
+
* // ```sh
|
|
7825
|
+
* // $ gcloud auth application-default login
|
|
7826
|
+
* // ```
|
|
7827
|
+
* // - Install the npm module by running:
|
|
7828
|
+
* // ```sh
|
|
7829
|
+
* // $ npm install googleapis
|
|
7830
|
+
* // ```
|
|
7831
|
+
*
|
|
7832
|
+
* const {google} = require('googleapis');
|
|
7833
|
+
* const vision = google.vision('v1');
|
|
7834
|
+
*
|
|
7835
|
+
* async function main() {
|
|
7836
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7837
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7838
|
+
* scopes: [
|
|
7839
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7840
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7841
|
+
* ],
|
|
7842
|
+
* });
|
|
7843
|
+
*
|
|
7844
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7845
|
+
* const authClient = await auth.getClient();
|
|
7846
|
+
* google.options({auth: authClient});
|
|
7847
|
+
*
|
|
7848
|
+
* // Do the magic
|
|
7849
|
+
* const res = await vision.projects.locations.images.asyncBatchAnnotate({
|
|
7850
|
+
* // 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`.
|
|
7851
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
7852
|
+
*
|
|
7853
|
+
* // Request body metadata
|
|
7854
|
+
* requestBody: {
|
|
7855
|
+
* // request body parameters
|
|
7856
|
+
* // {
|
|
7857
|
+
* // "labels": {},
|
|
7858
|
+
* // "outputConfig": {},
|
|
7859
|
+
* // "parent": "my_parent",
|
|
7860
|
+
* // "requests": []
|
|
7861
|
+
* // }
|
|
7862
|
+
* },
|
|
7863
|
+
* });
|
|
7864
|
+
* console.log(res.data);
|
|
7865
|
+
*
|
|
7866
|
+
* // Example response
|
|
7867
|
+
* // {
|
|
7868
|
+
* // "done": false,
|
|
7869
|
+
* // "error": {},
|
|
7870
|
+
* // "metadata": {},
|
|
7871
|
+
* // "name": "my_name",
|
|
7872
|
+
* // "response": {}
|
|
7873
|
+
* // }
|
|
7874
|
+
* }
|
|
7875
|
+
*
|
|
7876
|
+
* main().catch(e => {
|
|
7877
|
+
* console.error(e);
|
|
7878
|
+
* throw e;
|
|
7879
|
+
* });
|
|
7880
|
+
*
|
|
7881
|
+
* ```
|
|
6870
7882
|
*
|
|
6871
7883
|
* @param params - Parameters for request
|
|
6872
7884
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6876,11 +7888,11 @@ export namespace vision_v1 {
|
|
|
6876
7888
|
asyncBatchAnnotate(
|
|
6877
7889
|
params: Params$Resource$Projects$Locations$Images$Asyncbatchannotate,
|
|
6878
7890
|
options: StreamMethodOptions
|
|
6879
|
-
):
|
|
7891
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6880
7892
|
asyncBatchAnnotate(
|
|
6881
7893
|
params?: Params$Resource$Projects$Locations$Images$Asyncbatchannotate,
|
|
6882
7894
|
options?: MethodOptions
|
|
6883
|
-
):
|
|
7895
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
6884
7896
|
asyncBatchAnnotate(
|
|
6885
7897
|
params: Params$Resource$Projects$Locations$Images$Asyncbatchannotate,
|
|
6886
7898
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -6909,7 +7921,10 @@ export namespace vision_v1 {
|
|
|
6909
7921
|
callback?:
|
|
6910
7922
|
| BodyResponseCallback<Schema$Operation>
|
|
6911
7923
|
| BodyResponseCallback<Readable>
|
|
6912
|
-
):
|
|
7924
|
+
):
|
|
7925
|
+
| void
|
|
7926
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
|
|
7927
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
6913
7928
|
let params = (paramsOrCallback ||
|
|
6914
7929
|
{}) as Params$Resource$Projects$Locations$Images$Asyncbatchannotate;
|
|
6915
7930
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -6988,6 +8003,59 @@ export namespace vision_v1 {
|
|
|
6988
8003
|
|
|
6989
8004
|
/**
|
|
6990
8005
|
* 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.
|
|
8006
|
+
* @example
|
|
8007
|
+
* ```js
|
|
8008
|
+
* // Before running the sample:
|
|
8009
|
+
* // - Enable the API at:
|
|
8010
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
8011
|
+
* // - Login into gcloud by running:
|
|
8012
|
+
* // ```sh
|
|
8013
|
+
* // $ gcloud auth application-default login
|
|
8014
|
+
* // ```
|
|
8015
|
+
* // - Install the npm module by running:
|
|
8016
|
+
* // ```sh
|
|
8017
|
+
* // $ npm install googleapis
|
|
8018
|
+
* // ```
|
|
8019
|
+
*
|
|
8020
|
+
* const {google} = require('googleapis');
|
|
8021
|
+
* const vision = google.vision('v1');
|
|
8022
|
+
*
|
|
8023
|
+
* async function main() {
|
|
8024
|
+
* const auth = new google.auth.GoogleAuth({
|
|
8025
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
8026
|
+
* scopes: [
|
|
8027
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
8028
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
8029
|
+
* ],
|
|
8030
|
+
* });
|
|
8031
|
+
*
|
|
8032
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
8033
|
+
* const authClient = await auth.getClient();
|
|
8034
|
+
* google.options({auth: authClient});
|
|
8035
|
+
*
|
|
8036
|
+
* // Do the magic
|
|
8037
|
+
* const res = await vision.projects.locations.operations.get({
|
|
8038
|
+
* // The name of the operation resource.
|
|
8039
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
8040
|
+
* });
|
|
8041
|
+
* console.log(res.data);
|
|
8042
|
+
*
|
|
8043
|
+
* // Example response
|
|
8044
|
+
* // {
|
|
8045
|
+
* // "done": false,
|
|
8046
|
+
* // "error": {},
|
|
8047
|
+
* // "metadata": {},
|
|
8048
|
+
* // "name": "my_name",
|
|
8049
|
+
* // "response": {}
|
|
8050
|
+
* // }
|
|
8051
|
+
* }
|
|
8052
|
+
*
|
|
8053
|
+
* main().catch(e => {
|
|
8054
|
+
* console.error(e);
|
|
8055
|
+
* throw e;
|
|
8056
|
+
* });
|
|
8057
|
+
*
|
|
8058
|
+
* ```
|
|
6991
8059
|
*
|
|
6992
8060
|
* @param params - Parameters for request
|
|
6993
8061
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -6997,11 +8065,11 @@ export namespace vision_v1 {
|
|
|
6997
8065
|
get(
|
|
6998
8066
|
params: Params$Resource$Projects$Locations$Operations$Get,
|
|
6999
8067
|
options: StreamMethodOptions
|
|
7000
|
-
):
|
|
8068
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7001
8069
|
get(
|
|
7002
8070
|
params?: Params$Resource$Projects$Locations$Operations$Get,
|
|
7003
8071
|
options?: MethodOptions
|
|
7004
|
-
):
|
|
8072
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
7005
8073
|
get(
|
|
7006
8074
|
params: Params$Resource$Projects$Locations$Operations$Get,
|
|
7007
8075
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -7030,7 +8098,10 @@ export namespace vision_v1 {
|
|
|
7030
8098
|
callback?:
|
|
7031
8099
|
| BodyResponseCallback<Schema$Operation>
|
|
7032
8100
|
| BodyResponseCallback<Readable>
|
|
7033
|
-
):
|
|
8101
|
+
):
|
|
8102
|
+
| void
|
|
8103
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
|
|
8104
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
7034
8105
|
let params = (paramsOrCallback ||
|
|
7035
8106
|
{}) as Params$Resource$Projects$Locations$Operations$Get;
|
|
7036
8107
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -7091,6 +8162,73 @@ export namespace vision_v1 {
|
|
|
7091
8162
|
|
|
7092
8163
|
/**
|
|
7093
8164
|
* 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.
|
|
8165
|
+
* @example
|
|
8166
|
+
* ```js
|
|
8167
|
+
* // Before running the sample:
|
|
8168
|
+
* // - Enable the API at:
|
|
8169
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
8170
|
+
* // - Login into gcloud by running:
|
|
8171
|
+
* // ```sh
|
|
8172
|
+
* // $ gcloud auth application-default login
|
|
8173
|
+
* // ```
|
|
8174
|
+
* // - Install the npm module by running:
|
|
8175
|
+
* // ```sh
|
|
8176
|
+
* // $ npm install googleapis
|
|
8177
|
+
* // ```
|
|
8178
|
+
*
|
|
8179
|
+
* const {google} = require('googleapis');
|
|
8180
|
+
* const vision = google.vision('v1');
|
|
8181
|
+
*
|
|
8182
|
+
* async function main() {
|
|
8183
|
+
* const auth = new google.auth.GoogleAuth({
|
|
8184
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
8185
|
+
* scopes: [
|
|
8186
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
8187
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
8188
|
+
* ],
|
|
8189
|
+
* });
|
|
8190
|
+
*
|
|
8191
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
8192
|
+
* const authClient = await auth.getClient();
|
|
8193
|
+
* google.options({auth: authClient});
|
|
8194
|
+
*
|
|
8195
|
+
* // Do the magic
|
|
8196
|
+
* const res = await vision.projects.locations.products.create({
|
|
8197
|
+
* // Required. The project in which the Product should be created. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
8198
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
8199
|
+
* // 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 `/`.
|
|
8200
|
+
* productId: 'placeholder-value',
|
|
8201
|
+
*
|
|
8202
|
+
* // Request body metadata
|
|
8203
|
+
* requestBody: {
|
|
8204
|
+
* // request body parameters
|
|
8205
|
+
* // {
|
|
8206
|
+
* // "description": "my_description",
|
|
8207
|
+
* // "displayName": "my_displayName",
|
|
8208
|
+
* // "name": "my_name",
|
|
8209
|
+
* // "productCategory": "my_productCategory",
|
|
8210
|
+
* // "productLabels": []
|
|
8211
|
+
* // }
|
|
8212
|
+
* },
|
|
8213
|
+
* });
|
|
8214
|
+
* console.log(res.data);
|
|
8215
|
+
*
|
|
8216
|
+
* // Example response
|
|
8217
|
+
* // {
|
|
8218
|
+
* // "description": "my_description",
|
|
8219
|
+
* // "displayName": "my_displayName",
|
|
8220
|
+
* // "name": "my_name",
|
|
8221
|
+
* // "productCategory": "my_productCategory",
|
|
8222
|
+
* // "productLabels": []
|
|
8223
|
+
* // }
|
|
8224
|
+
* }
|
|
8225
|
+
*
|
|
8226
|
+
* main().catch(e => {
|
|
8227
|
+
* console.error(e);
|
|
8228
|
+
* throw e;
|
|
8229
|
+
* });
|
|
8230
|
+
*
|
|
8231
|
+
* ```
|
|
7094
8232
|
*
|
|
7095
8233
|
* @param params - Parameters for request
|
|
7096
8234
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -7100,11 +8238,11 @@ export namespace vision_v1 {
|
|
|
7100
8238
|
create(
|
|
7101
8239
|
params: Params$Resource$Projects$Locations$Products$Create,
|
|
7102
8240
|
options: StreamMethodOptions
|
|
7103
|
-
):
|
|
8241
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7104
8242
|
create(
|
|
7105
8243
|
params?: Params$Resource$Projects$Locations$Products$Create,
|
|
7106
8244
|
options?: MethodOptions
|
|
7107
|
-
):
|
|
8245
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Product>>;
|
|
7108
8246
|
create(
|
|
7109
8247
|
params: Params$Resource$Projects$Locations$Products$Create,
|
|
7110
8248
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -7133,7 +8271,10 @@ export namespace vision_v1 {
|
|
|
7133
8271
|
callback?:
|
|
7134
8272
|
| BodyResponseCallback<Schema$Product>
|
|
7135
8273
|
| BodyResponseCallback<Readable>
|
|
7136
|
-
):
|
|
8274
|
+
):
|
|
8275
|
+
| void
|
|
8276
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Product>>
|
|
8277
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
7137
8278
|
let params = (paramsOrCallback ||
|
|
7138
8279
|
{}) as Params$Resource$Projects$Locations$Products$Create;
|
|
7139
8280
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -7179,6 +8320,53 @@ export namespace vision_v1 {
|
|
|
7179
8320
|
|
|
7180
8321
|
/**
|
|
7181
8322
|
* 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.
|
|
8323
|
+
* @example
|
|
8324
|
+
* ```js
|
|
8325
|
+
* // Before running the sample:
|
|
8326
|
+
* // - Enable the API at:
|
|
8327
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
8328
|
+
* // - Login into gcloud by running:
|
|
8329
|
+
* // ```sh
|
|
8330
|
+
* // $ gcloud auth application-default login
|
|
8331
|
+
* // ```
|
|
8332
|
+
* // - Install the npm module by running:
|
|
8333
|
+
* // ```sh
|
|
8334
|
+
* // $ npm install googleapis
|
|
8335
|
+
* // ```
|
|
8336
|
+
*
|
|
8337
|
+
* const {google} = require('googleapis');
|
|
8338
|
+
* const vision = google.vision('v1');
|
|
8339
|
+
*
|
|
8340
|
+
* async function main() {
|
|
8341
|
+
* const auth = new google.auth.GoogleAuth({
|
|
8342
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
8343
|
+
* scopes: [
|
|
8344
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
8345
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
8346
|
+
* ],
|
|
8347
|
+
* });
|
|
8348
|
+
*
|
|
8349
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
8350
|
+
* const authClient = await auth.getClient();
|
|
8351
|
+
* google.options({auth: authClient});
|
|
8352
|
+
*
|
|
8353
|
+
* // Do the magic
|
|
8354
|
+
* const res = await vision.projects.locations.products.delete({
|
|
8355
|
+
* // Required. Resource name of product to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
|
|
8356
|
+
* name: 'projects/my-project/locations/my-location/products/my-product',
|
|
8357
|
+
* });
|
|
8358
|
+
* console.log(res.data);
|
|
8359
|
+
*
|
|
8360
|
+
* // Example response
|
|
8361
|
+
* // {}
|
|
8362
|
+
* }
|
|
8363
|
+
*
|
|
8364
|
+
* main().catch(e => {
|
|
8365
|
+
* console.error(e);
|
|
8366
|
+
* throw e;
|
|
8367
|
+
* });
|
|
8368
|
+
*
|
|
8369
|
+
* ```
|
|
7182
8370
|
*
|
|
7183
8371
|
* @param params - Parameters for request
|
|
7184
8372
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -7188,11 +8376,11 @@ export namespace vision_v1 {
|
|
|
7188
8376
|
delete(
|
|
7189
8377
|
params: Params$Resource$Projects$Locations$Products$Delete,
|
|
7190
8378
|
options: StreamMethodOptions
|
|
7191
|
-
):
|
|
8379
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7192
8380
|
delete(
|
|
7193
8381
|
params?: Params$Resource$Projects$Locations$Products$Delete,
|
|
7194
8382
|
options?: MethodOptions
|
|
7195
|
-
):
|
|
8383
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
7196
8384
|
delete(
|
|
7197
8385
|
params: Params$Resource$Projects$Locations$Products$Delete,
|
|
7198
8386
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -7221,7 +8409,10 @@ export namespace vision_v1 {
|
|
|
7221
8409
|
callback?:
|
|
7222
8410
|
| BodyResponseCallback<Schema$Empty>
|
|
7223
8411
|
| BodyResponseCallback<Readable>
|
|
7224
|
-
):
|
|
8412
|
+
):
|
|
8413
|
+
| void
|
|
8414
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
|
|
8415
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
7225
8416
|
let params = (paramsOrCallback ||
|
|
7226
8417
|
{}) as Params$Resource$Projects$Locations$Products$Delete;
|
|
7227
8418
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -7264,6 +8455,59 @@ export namespace vision_v1 {
|
|
|
7264
8455
|
|
|
7265
8456
|
/**
|
|
7266
8457
|
* Gets information associated with a Product. Possible errors: * Returns NOT_FOUND if the Product does not exist.
|
|
8458
|
+
* @example
|
|
8459
|
+
* ```js
|
|
8460
|
+
* // Before running the sample:
|
|
8461
|
+
* // - Enable the API at:
|
|
8462
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
8463
|
+
* // - Login into gcloud by running:
|
|
8464
|
+
* // ```sh
|
|
8465
|
+
* // $ gcloud auth application-default login
|
|
8466
|
+
* // ```
|
|
8467
|
+
* // - Install the npm module by running:
|
|
8468
|
+
* // ```sh
|
|
8469
|
+
* // $ npm install googleapis
|
|
8470
|
+
* // ```
|
|
8471
|
+
*
|
|
8472
|
+
* const {google} = require('googleapis');
|
|
8473
|
+
* const vision = google.vision('v1');
|
|
8474
|
+
*
|
|
8475
|
+
* async function main() {
|
|
8476
|
+
* const auth = new google.auth.GoogleAuth({
|
|
8477
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
8478
|
+
* scopes: [
|
|
8479
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
8480
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
8481
|
+
* ],
|
|
8482
|
+
* });
|
|
8483
|
+
*
|
|
8484
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
8485
|
+
* const authClient = await auth.getClient();
|
|
8486
|
+
* google.options({auth: authClient});
|
|
8487
|
+
*
|
|
8488
|
+
* // Do the magic
|
|
8489
|
+
* const res = await vision.projects.locations.products.get({
|
|
8490
|
+
* // Required. Resource name of the Product to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
|
|
8491
|
+
* name: 'projects/my-project/locations/my-location/products/my-product',
|
|
8492
|
+
* });
|
|
8493
|
+
* console.log(res.data);
|
|
8494
|
+
*
|
|
8495
|
+
* // Example response
|
|
8496
|
+
* // {
|
|
8497
|
+
* // "description": "my_description",
|
|
8498
|
+
* // "displayName": "my_displayName",
|
|
8499
|
+
* // "name": "my_name",
|
|
8500
|
+
* // "productCategory": "my_productCategory",
|
|
8501
|
+
* // "productLabels": []
|
|
8502
|
+
* // }
|
|
8503
|
+
* }
|
|
8504
|
+
*
|
|
8505
|
+
* main().catch(e => {
|
|
8506
|
+
* console.error(e);
|
|
8507
|
+
* throw e;
|
|
8508
|
+
* });
|
|
8509
|
+
*
|
|
8510
|
+
* ```
|
|
7267
8511
|
*
|
|
7268
8512
|
* @param params - Parameters for request
|
|
7269
8513
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -7273,11 +8517,11 @@ export namespace vision_v1 {
|
|
|
7273
8517
|
get(
|
|
7274
8518
|
params: Params$Resource$Projects$Locations$Products$Get,
|
|
7275
8519
|
options: StreamMethodOptions
|
|
7276
|
-
):
|
|
8520
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7277
8521
|
get(
|
|
7278
8522
|
params?: Params$Resource$Projects$Locations$Products$Get,
|
|
7279
8523
|
options?: MethodOptions
|
|
7280
|
-
):
|
|
8524
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Product>>;
|
|
7281
8525
|
get(
|
|
7282
8526
|
params: Params$Resource$Projects$Locations$Products$Get,
|
|
7283
8527
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -7306,7 +8550,10 @@ export namespace vision_v1 {
|
|
|
7306
8550
|
callback?:
|
|
7307
8551
|
| BodyResponseCallback<Schema$Product>
|
|
7308
8552
|
| BodyResponseCallback<Readable>
|
|
7309
|
-
):
|
|
8553
|
+
):
|
|
8554
|
+
| void
|
|
8555
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Product>>
|
|
8556
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
7310
8557
|
let params = (paramsOrCallback ||
|
|
7311
8558
|
{}) as Params$Resource$Projects$Locations$Products$Get;
|
|
7312
8559
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -7349,6 +8596,60 @@ export namespace vision_v1 {
|
|
|
7349
8596
|
|
|
7350
8597
|
/**
|
|
7351
8598
|
* Lists products in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
|
|
8599
|
+
* @example
|
|
8600
|
+
* ```js
|
|
8601
|
+
* // Before running the sample:
|
|
8602
|
+
* // - Enable the API at:
|
|
8603
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
8604
|
+
* // - Login into gcloud by running:
|
|
8605
|
+
* // ```sh
|
|
8606
|
+
* // $ gcloud auth application-default login
|
|
8607
|
+
* // ```
|
|
8608
|
+
* // - Install the npm module by running:
|
|
8609
|
+
* // ```sh
|
|
8610
|
+
* // $ npm install googleapis
|
|
8611
|
+
* // ```
|
|
8612
|
+
*
|
|
8613
|
+
* const {google} = require('googleapis');
|
|
8614
|
+
* const vision = google.vision('v1');
|
|
8615
|
+
*
|
|
8616
|
+
* async function main() {
|
|
8617
|
+
* const auth = new google.auth.GoogleAuth({
|
|
8618
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
8619
|
+
* scopes: [
|
|
8620
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
8621
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
8622
|
+
* ],
|
|
8623
|
+
* });
|
|
8624
|
+
*
|
|
8625
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
8626
|
+
* const authClient = await auth.getClient();
|
|
8627
|
+
* google.options({auth: authClient});
|
|
8628
|
+
*
|
|
8629
|
+
* // Do the magic
|
|
8630
|
+
* const res = await vision.projects.locations.products.list({
|
|
8631
|
+
* // The maximum number of items to return. Default 10, maximum 100.
|
|
8632
|
+
* pageSize: 'placeholder-value',
|
|
8633
|
+
* // The next_page_token returned from a previous List request, if any.
|
|
8634
|
+
* pageToken: 'placeholder-value',
|
|
8635
|
+
* // Required. The project OR ProductSet from which Products should be listed. Format: `projects/PROJECT_ID/locations/LOC_ID`
|
|
8636
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
8637
|
+
* });
|
|
8638
|
+
* console.log(res.data);
|
|
8639
|
+
*
|
|
8640
|
+
* // Example response
|
|
8641
|
+
* // {
|
|
8642
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
8643
|
+
* // "products": []
|
|
8644
|
+
* // }
|
|
8645
|
+
* }
|
|
8646
|
+
*
|
|
8647
|
+
* main().catch(e => {
|
|
8648
|
+
* console.error(e);
|
|
8649
|
+
* throw e;
|
|
8650
|
+
* });
|
|
8651
|
+
*
|
|
8652
|
+
* ```
|
|
7352
8653
|
*
|
|
7353
8654
|
* @param params - Parameters for request
|
|
7354
8655
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -7358,11 +8659,11 @@ export namespace vision_v1 {
|
|
|
7358
8659
|
list(
|
|
7359
8660
|
params: Params$Resource$Projects$Locations$Products$List,
|
|
7360
8661
|
options: StreamMethodOptions
|
|
7361
|
-
):
|
|
8662
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7362
8663
|
list(
|
|
7363
8664
|
params?: Params$Resource$Projects$Locations$Products$List,
|
|
7364
8665
|
options?: MethodOptions
|
|
7365
|
-
):
|
|
8666
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$ListProductsResponse>>;
|
|
7366
8667
|
list(
|
|
7367
8668
|
params: Params$Resource$Projects$Locations$Products$List,
|
|
7368
8669
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -7395,8 +8696,8 @@ export namespace vision_v1 {
|
|
|
7395
8696
|
| BodyResponseCallback<Readable>
|
|
7396
8697
|
):
|
|
7397
8698
|
| void
|
|
7398
|
-
|
|
|
7399
|
-
|
|
|
8699
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$ListProductsResponse>>
|
|
8700
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
7400
8701
|
let params = (paramsOrCallback ||
|
|
7401
8702
|
{}) as Params$Resource$Projects$Locations$Products$List;
|
|
7402
8703
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -7442,6 +8743,73 @@ export namespace vision_v1 {
|
|
|
7442
8743
|
|
|
7443
8744
|
/**
|
|
7444
8745
|
* 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.
|
|
8746
|
+
* @example
|
|
8747
|
+
* ```js
|
|
8748
|
+
* // Before running the sample:
|
|
8749
|
+
* // - Enable the API at:
|
|
8750
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
8751
|
+
* // - Login into gcloud by running:
|
|
8752
|
+
* // ```sh
|
|
8753
|
+
* // $ gcloud auth application-default login
|
|
8754
|
+
* // ```
|
|
8755
|
+
* // - Install the npm module by running:
|
|
8756
|
+
* // ```sh
|
|
8757
|
+
* // $ npm install googleapis
|
|
8758
|
+
* // ```
|
|
8759
|
+
*
|
|
8760
|
+
* const {google} = require('googleapis');
|
|
8761
|
+
* const vision = google.vision('v1');
|
|
8762
|
+
*
|
|
8763
|
+
* async function main() {
|
|
8764
|
+
* const auth = new google.auth.GoogleAuth({
|
|
8765
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
8766
|
+
* scopes: [
|
|
8767
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
8768
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
8769
|
+
* ],
|
|
8770
|
+
* });
|
|
8771
|
+
*
|
|
8772
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
8773
|
+
* const authClient = await auth.getClient();
|
|
8774
|
+
* google.options({auth: authClient});
|
|
8775
|
+
*
|
|
8776
|
+
* // Do the magic
|
|
8777
|
+
* const res = await vision.projects.locations.products.patch({
|
|
8778
|
+
* // 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.
|
|
8779
|
+
* name: 'projects/my-project/locations/my-location/products/my-product',
|
|
8780
|
+
* // 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`.
|
|
8781
|
+
* updateMask: 'placeholder-value',
|
|
8782
|
+
*
|
|
8783
|
+
* // Request body metadata
|
|
8784
|
+
* requestBody: {
|
|
8785
|
+
* // request body parameters
|
|
8786
|
+
* // {
|
|
8787
|
+
* // "description": "my_description",
|
|
8788
|
+
* // "displayName": "my_displayName",
|
|
8789
|
+
* // "name": "my_name",
|
|
8790
|
+
* // "productCategory": "my_productCategory",
|
|
8791
|
+
* // "productLabels": []
|
|
8792
|
+
* // }
|
|
8793
|
+
* },
|
|
8794
|
+
* });
|
|
8795
|
+
* console.log(res.data);
|
|
8796
|
+
*
|
|
8797
|
+
* // Example response
|
|
8798
|
+
* // {
|
|
8799
|
+
* // "description": "my_description",
|
|
8800
|
+
* // "displayName": "my_displayName",
|
|
8801
|
+
* // "name": "my_name",
|
|
8802
|
+
* // "productCategory": "my_productCategory",
|
|
8803
|
+
* // "productLabels": []
|
|
8804
|
+
* // }
|
|
8805
|
+
* }
|
|
8806
|
+
*
|
|
8807
|
+
* main().catch(e => {
|
|
8808
|
+
* console.error(e);
|
|
8809
|
+
* throw e;
|
|
8810
|
+
* });
|
|
8811
|
+
*
|
|
8812
|
+
* ```
|
|
7445
8813
|
*
|
|
7446
8814
|
* @param params - Parameters for request
|
|
7447
8815
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -7451,11 +8819,11 @@ export namespace vision_v1 {
|
|
|
7451
8819
|
patch(
|
|
7452
8820
|
params: Params$Resource$Projects$Locations$Products$Patch,
|
|
7453
8821
|
options: StreamMethodOptions
|
|
7454
|
-
):
|
|
8822
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7455
8823
|
patch(
|
|
7456
8824
|
params?: Params$Resource$Projects$Locations$Products$Patch,
|
|
7457
8825
|
options?: MethodOptions
|
|
7458
|
-
):
|
|
8826
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Product>>;
|
|
7459
8827
|
patch(
|
|
7460
8828
|
params: Params$Resource$Projects$Locations$Products$Patch,
|
|
7461
8829
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -7484,7 +8852,10 @@ export namespace vision_v1 {
|
|
|
7484
8852
|
callback?:
|
|
7485
8853
|
| BodyResponseCallback<Schema$Product>
|
|
7486
8854
|
| BodyResponseCallback<Readable>
|
|
7487
|
-
):
|
|
8855
|
+
):
|
|
8856
|
+
| void
|
|
8857
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Product>>
|
|
8858
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
7488
8859
|
let params = (paramsOrCallback ||
|
|
7489
8860
|
{}) as Params$Resource$Projects$Locations$Products$Patch;
|
|
7490
8861
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -7527,6 +8898,69 @@ export namespace vision_v1 {
|
|
|
7527
8898
|
|
|
7528
8899
|
/**
|
|
7529
8900
|
* 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)
|
|
8901
|
+
* @example
|
|
8902
|
+
* ```js
|
|
8903
|
+
* // Before running the sample:
|
|
8904
|
+
* // - Enable the API at:
|
|
8905
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
8906
|
+
* // - Login into gcloud by running:
|
|
8907
|
+
* // ```sh
|
|
8908
|
+
* // $ gcloud auth application-default login
|
|
8909
|
+
* // ```
|
|
8910
|
+
* // - Install the npm module by running:
|
|
8911
|
+
* // ```sh
|
|
8912
|
+
* // $ npm install googleapis
|
|
8913
|
+
* // ```
|
|
8914
|
+
*
|
|
8915
|
+
* const {google} = require('googleapis');
|
|
8916
|
+
* const vision = google.vision('v1');
|
|
8917
|
+
*
|
|
8918
|
+
* async function main() {
|
|
8919
|
+
* const auth = new google.auth.GoogleAuth({
|
|
8920
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
8921
|
+
* scopes: [
|
|
8922
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
8923
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
8924
|
+
* ],
|
|
8925
|
+
* });
|
|
8926
|
+
*
|
|
8927
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
8928
|
+
* const authClient = await auth.getClient();
|
|
8929
|
+
* google.options({auth: authClient});
|
|
8930
|
+
*
|
|
8931
|
+
* // Do the magic
|
|
8932
|
+
* const res = await vision.projects.locations.products.purge({
|
|
8933
|
+
* // Required. The project and location in which the Products should be deleted. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
8934
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
8935
|
+
*
|
|
8936
|
+
* // Request body metadata
|
|
8937
|
+
* requestBody: {
|
|
8938
|
+
* // request body parameters
|
|
8939
|
+
* // {
|
|
8940
|
+
* // "deleteOrphanProducts": false,
|
|
8941
|
+
* // "force": false,
|
|
8942
|
+
* // "productSetPurgeConfig": {}
|
|
8943
|
+
* // }
|
|
8944
|
+
* },
|
|
8945
|
+
* });
|
|
8946
|
+
* console.log(res.data);
|
|
8947
|
+
*
|
|
8948
|
+
* // Example response
|
|
8949
|
+
* // {
|
|
8950
|
+
* // "done": false,
|
|
8951
|
+
* // "error": {},
|
|
8952
|
+
* // "metadata": {},
|
|
8953
|
+
* // "name": "my_name",
|
|
8954
|
+
* // "response": {}
|
|
8955
|
+
* // }
|
|
8956
|
+
* }
|
|
8957
|
+
*
|
|
8958
|
+
* main().catch(e => {
|
|
8959
|
+
* console.error(e);
|
|
8960
|
+
* throw e;
|
|
8961
|
+
* });
|
|
8962
|
+
*
|
|
8963
|
+
* ```
|
|
7530
8964
|
*
|
|
7531
8965
|
* @param params - Parameters for request
|
|
7532
8966
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -7536,11 +8970,11 @@ export namespace vision_v1 {
|
|
|
7536
8970
|
purge(
|
|
7537
8971
|
params: Params$Resource$Projects$Locations$Products$Purge,
|
|
7538
8972
|
options: StreamMethodOptions
|
|
7539
|
-
):
|
|
8973
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7540
8974
|
purge(
|
|
7541
8975
|
params?: Params$Resource$Projects$Locations$Products$Purge,
|
|
7542
8976
|
options?: MethodOptions
|
|
7543
|
-
):
|
|
8977
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
7544
8978
|
purge(
|
|
7545
8979
|
params: Params$Resource$Projects$Locations$Products$Purge,
|
|
7546
8980
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -7569,7 +9003,10 @@ export namespace vision_v1 {
|
|
|
7569
9003
|
callback?:
|
|
7570
9004
|
| BodyResponseCallback<Schema$Operation>
|
|
7571
9005
|
| BodyResponseCallback<Readable>
|
|
7572
|
-
):
|
|
9006
|
+
):
|
|
9007
|
+
| void
|
|
9008
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
|
|
9009
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
7573
9010
|
let params = (paramsOrCallback ||
|
|
7574
9011
|
{}) as Params$Resource$Projects$Locations$Products$Purge;
|
|
7575
9012
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -7696,6 +9133,69 @@ export namespace vision_v1 {
|
|
|
7696
9133
|
|
|
7697
9134
|
/**
|
|
7698
9135
|
* 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.
|
|
9136
|
+
* @example
|
|
9137
|
+
* ```js
|
|
9138
|
+
* // Before running the sample:
|
|
9139
|
+
* // - Enable the API at:
|
|
9140
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
9141
|
+
* // - Login into gcloud by running:
|
|
9142
|
+
* // ```sh
|
|
9143
|
+
* // $ gcloud auth application-default login
|
|
9144
|
+
* // ```
|
|
9145
|
+
* // - Install the npm module by running:
|
|
9146
|
+
* // ```sh
|
|
9147
|
+
* // $ npm install googleapis
|
|
9148
|
+
* // ```
|
|
9149
|
+
*
|
|
9150
|
+
* const {google} = require('googleapis');
|
|
9151
|
+
* const vision = google.vision('v1');
|
|
9152
|
+
*
|
|
9153
|
+
* async function main() {
|
|
9154
|
+
* const auth = new google.auth.GoogleAuth({
|
|
9155
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
9156
|
+
* scopes: [
|
|
9157
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
9158
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
9159
|
+
* ],
|
|
9160
|
+
* });
|
|
9161
|
+
*
|
|
9162
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
9163
|
+
* const authClient = await auth.getClient();
|
|
9164
|
+
* google.options({auth: authClient});
|
|
9165
|
+
*
|
|
9166
|
+
* // Do the magic
|
|
9167
|
+
* const res = await vision.projects.locations.products.referenceImages.create({
|
|
9168
|
+
* // Required. Resource name of the product in which to create the reference image. Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
|
|
9169
|
+
* parent: 'projects/my-project/locations/my-location/products/my-product',
|
|
9170
|
+
* // 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 `/`.
|
|
9171
|
+
* referenceImageId: 'placeholder-value',
|
|
9172
|
+
*
|
|
9173
|
+
* // Request body metadata
|
|
9174
|
+
* requestBody: {
|
|
9175
|
+
* // request body parameters
|
|
9176
|
+
* // {
|
|
9177
|
+
* // "boundingPolys": [],
|
|
9178
|
+
* // "name": "my_name",
|
|
9179
|
+
* // "uri": "my_uri"
|
|
9180
|
+
* // }
|
|
9181
|
+
* },
|
|
9182
|
+
* });
|
|
9183
|
+
* console.log(res.data);
|
|
9184
|
+
*
|
|
9185
|
+
* // Example response
|
|
9186
|
+
* // {
|
|
9187
|
+
* // "boundingPolys": [],
|
|
9188
|
+
* // "name": "my_name",
|
|
9189
|
+
* // "uri": "my_uri"
|
|
9190
|
+
* // }
|
|
9191
|
+
* }
|
|
9192
|
+
*
|
|
9193
|
+
* main().catch(e => {
|
|
9194
|
+
* console.error(e);
|
|
9195
|
+
* throw e;
|
|
9196
|
+
* });
|
|
9197
|
+
*
|
|
9198
|
+
* ```
|
|
7699
9199
|
*
|
|
7700
9200
|
* @param params - Parameters for request
|
|
7701
9201
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -7705,11 +9205,11 @@ export namespace vision_v1 {
|
|
|
7705
9205
|
create(
|
|
7706
9206
|
params: Params$Resource$Projects$Locations$Products$Referenceimages$Create,
|
|
7707
9207
|
options: StreamMethodOptions
|
|
7708
|
-
):
|
|
9208
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7709
9209
|
create(
|
|
7710
9210
|
params?: Params$Resource$Projects$Locations$Products$Referenceimages$Create,
|
|
7711
9211
|
options?: MethodOptions
|
|
7712
|
-
):
|
|
9212
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$ReferenceImage>>;
|
|
7713
9213
|
create(
|
|
7714
9214
|
params: Params$Resource$Projects$Locations$Products$Referenceimages$Create,
|
|
7715
9215
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -7738,7 +9238,10 @@ export namespace vision_v1 {
|
|
|
7738
9238
|
callback?:
|
|
7739
9239
|
| BodyResponseCallback<Schema$ReferenceImage>
|
|
7740
9240
|
| BodyResponseCallback<Readable>
|
|
7741
|
-
):
|
|
9241
|
+
):
|
|
9242
|
+
| void
|
|
9243
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$ReferenceImage>>
|
|
9244
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
7742
9245
|
let params = (paramsOrCallback ||
|
|
7743
9246
|
{}) as Params$Resource$Projects$Locations$Products$Referenceimages$Create;
|
|
7744
9247
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -7785,6 +9288,53 @@ export namespace vision_v1 {
|
|
|
7785
9288
|
|
|
7786
9289
|
/**
|
|
7787
9290
|
* 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.
|
|
9291
|
+
* @example
|
|
9292
|
+
* ```js
|
|
9293
|
+
* // Before running the sample:
|
|
9294
|
+
* // - Enable the API at:
|
|
9295
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
9296
|
+
* // - Login into gcloud by running:
|
|
9297
|
+
* // ```sh
|
|
9298
|
+
* // $ gcloud auth application-default login
|
|
9299
|
+
* // ```
|
|
9300
|
+
* // - Install the npm module by running:
|
|
9301
|
+
* // ```sh
|
|
9302
|
+
* // $ npm install googleapis
|
|
9303
|
+
* // ```
|
|
9304
|
+
*
|
|
9305
|
+
* const {google} = require('googleapis');
|
|
9306
|
+
* const vision = google.vision('v1');
|
|
9307
|
+
*
|
|
9308
|
+
* async function main() {
|
|
9309
|
+
* const auth = new google.auth.GoogleAuth({
|
|
9310
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
9311
|
+
* scopes: [
|
|
9312
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
9313
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
9314
|
+
* ],
|
|
9315
|
+
* });
|
|
9316
|
+
*
|
|
9317
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
9318
|
+
* const authClient = await auth.getClient();
|
|
9319
|
+
* google.options({auth: authClient});
|
|
9320
|
+
*
|
|
9321
|
+
* // Do the magic
|
|
9322
|
+
* const res = await vision.projects.locations.products.referenceImages.delete({
|
|
9323
|
+
* // Required. The resource name of the reference image to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
|
|
9324
|
+
* name: 'projects/my-project/locations/my-location/products/my-product/referenceImages/my-referenceImage',
|
|
9325
|
+
* });
|
|
9326
|
+
* console.log(res.data);
|
|
9327
|
+
*
|
|
9328
|
+
* // Example response
|
|
9329
|
+
* // {}
|
|
9330
|
+
* }
|
|
9331
|
+
*
|
|
9332
|
+
* main().catch(e => {
|
|
9333
|
+
* console.error(e);
|
|
9334
|
+
* throw e;
|
|
9335
|
+
* });
|
|
9336
|
+
*
|
|
9337
|
+
* ```
|
|
7788
9338
|
*
|
|
7789
9339
|
* @param params - Parameters for request
|
|
7790
9340
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -7794,11 +9344,11 @@ export namespace vision_v1 {
|
|
|
7794
9344
|
delete(
|
|
7795
9345
|
params: Params$Resource$Projects$Locations$Products$Referenceimages$Delete,
|
|
7796
9346
|
options: StreamMethodOptions
|
|
7797
|
-
):
|
|
9347
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7798
9348
|
delete(
|
|
7799
9349
|
params?: Params$Resource$Projects$Locations$Products$Referenceimages$Delete,
|
|
7800
9350
|
options?: MethodOptions
|
|
7801
|
-
):
|
|
9351
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
7802
9352
|
delete(
|
|
7803
9353
|
params: Params$Resource$Projects$Locations$Products$Referenceimages$Delete,
|
|
7804
9354
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -7827,7 +9377,10 @@ export namespace vision_v1 {
|
|
|
7827
9377
|
callback?:
|
|
7828
9378
|
| BodyResponseCallback<Schema$Empty>
|
|
7829
9379
|
| BodyResponseCallback<Readable>
|
|
7830
|
-
):
|
|
9380
|
+
):
|
|
9381
|
+
| void
|
|
9382
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
|
|
9383
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
7831
9384
|
let params = (paramsOrCallback ||
|
|
7832
9385
|
{}) as Params$Resource$Projects$Locations$Products$Referenceimages$Delete;
|
|
7833
9386
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -7871,6 +9424,57 @@ export namespace vision_v1 {
|
|
|
7871
9424
|
|
|
7872
9425
|
/**
|
|
7873
9426
|
* Gets information associated with a ReferenceImage. Possible errors: * Returns NOT_FOUND if the specified image does not exist.
|
|
9427
|
+
* @example
|
|
9428
|
+
* ```js
|
|
9429
|
+
* // Before running the sample:
|
|
9430
|
+
* // - Enable the API at:
|
|
9431
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
9432
|
+
* // - Login into gcloud by running:
|
|
9433
|
+
* // ```sh
|
|
9434
|
+
* // $ gcloud auth application-default login
|
|
9435
|
+
* // ```
|
|
9436
|
+
* // - Install the npm module by running:
|
|
9437
|
+
* // ```sh
|
|
9438
|
+
* // $ npm install googleapis
|
|
9439
|
+
* // ```
|
|
9440
|
+
*
|
|
9441
|
+
* const {google} = require('googleapis');
|
|
9442
|
+
* const vision = google.vision('v1');
|
|
9443
|
+
*
|
|
9444
|
+
* async function main() {
|
|
9445
|
+
* const auth = new google.auth.GoogleAuth({
|
|
9446
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
9447
|
+
* scopes: [
|
|
9448
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
9449
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
9450
|
+
* ],
|
|
9451
|
+
* });
|
|
9452
|
+
*
|
|
9453
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
9454
|
+
* const authClient = await auth.getClient();
|
|
9455
|
+
* google.options({auth: authClient});
|
|
9456
|
+
*
|
|
9457
|
+
* // Do the magic
|
|
9458
|
+
* const res = await vision.projects.locations.products.referenceImages.get({
|
|
9459
|
+
* // Required. The resource name of the ReferenceImage to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
|
|
9460
|
+
* name: 'projects/my-project/locations/my-location/products/my-product/referenceImages/my-referenceImage',
|
|
9461
|
+
* });
|
|
9462
|
+
* console.log(res.data);
|
|
9463
|
+
*
|
|
9464
|
+
* // Example response
|
|
9465
|
+
* // {
|
|
9466
|
+
* // "boundingPolys": [],
|
|
9467
|
+
* // "name": "my_name",
|
|
9468
|
+
* // "uri": "my_uri"
|
|
9469
|
+
* // }
|
|
9470
|
+
* }
|
|
9471
|
+
*
|
|
9472
|
+
* main().catch(e => {
|
|
9473
|
+
* console.error(e);
|
|
9474
|
+
* throw e;
|
|
9475
|
+
* });
|
|
9476
|
+
*
|
|
9477
|
+
* ```
|
|
7874
9478
|
*
|
|
7875
9479
|
* @param params - Parameters for request
|
|
7876
9480
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -7880,11 +9484,11 @@ export namespace vision_v1 {
|
|
|
7880
9484
|
get(
|
|
7881
9485
|
params: Params$Resource$Projects$Locations$Products$Referenceimages$Get,
|
|
7882
9486
|
options: StreamMethodOptions
|
|
7883
|
-
):
|
|
9487
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7884
9488
|
get(
|
|
7885
9489
|
params?: Params$Resource$Projects$Locations$Products$Referenceimages$Get,
|
|
7886
9490
|
options?: MethodOptions
|
|
7887
|
-
):
|
|
9491
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$ReferenceImage>>;
|
|
7888
9492
|
get(
|
|
7889
9493
|
params: Params$Resource$Projects$Locations$Products$Referenceimages$Get,
|
|
7890
9494
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -7913,7 +9517,10 @@ export namespace vision_v1 {
|
|
|
7913
9517
|
callback?:
|
|
7914
9518
|
| BodyResponseCallback<Schema$ReferenceImage>
|
|
7915
9519
|
| BodyResponseCallback<Readable>
|
|
7916
|
-
):
|
|
9520
|
+
):
|
|
9521
|
+
| void
|
|
9522
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$ReferenceImage>>
|
|
9523
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
7917
9524
|
let params = (paramsOrCallback ||
|
|
7918
9525
|
{}) as Params$Resource$Projects$Locations$Products$Referenceimages$Get;
|
|
7919
9526
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -7957,6 +9564,61 @@ export namespace vision_v1 {
|
|
|
7957
9564
|
|
|
7958
9565
|
/**
|
|
7959
9566
|
* 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.
|
|
9567
|
+
* @example
|
|
9568
|
+
* ```js
|
|
9569
|
+
* // Before running the sample:
|
|
9570
|
+
* // - Enable the API at:
|
|
9571
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
9572
|
+
* // - Login into gcloud by running:
|
|
9573
|
+
* // ```sh
|
|
9574
|
+
* // $ gcloud auth application-default login
|
|
9575
|
+
* // ```
|
|
9576
|
+
* // - Install the npm module by running:
|
|
9577
|
+
* // ```sh
|
|
9578
|
+
* // $ npm install googleapis
|
|
9579
|
+
* // ```
|
|
9580
|
+
*
|
|
9581
|
+
* const {google} = require('googleapis');
|
|
9582
|
+
* const vision = google.vision('v1');
|
|
9583
|
+
*
|
|
9584
|
+
* async function main() {
|
|
9585
|
+
* const auth = new google.auth.GoogleAuth({
|
|
9586
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
9587
|
+
* scopes: [
|
|
9588
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
9589
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
9590
|
+
* ],
|
|
9591
|
+
* });
|
|
9592
|
+
*
|
|
9593
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
9594
|
+
* const authClient = await auth.getClient();
|
|
9595
|
+
* google.options({auth: authClient});
|
|
9596
|
+
*
|
|
9597
|
+
* // Do the magic
|
|
9598
|
+
* const res = await vision.projects.locations.products.referenceImages.list({
|
|
9599
|
+
* // The maximum number of items to return. Default 10, maximum 100.
|
|
9600
|
+
* pageSize: 'placeholder-value',
|
|
9601
|
+
* // 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.
|
|
9602
|
+
* pageToken: 'placeholder-value',
|
|
9603
|
+
* // Required. Resource name of the product containing the reference images. Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
|
|
9604
|
+
* parent: 'projects/my-project/locations/my-location/products/my-product',
|
|
9605
|
+
* });
|
|
9606
|
+
* console.log(res.data);
|
|
9607
|
+
*
|
|
9608
|
+
* // Example response
|
|
9609
|
+
* // {
|
|
9610
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
9611
|
+
* // "pageSize": 0,
|
|
9612
|
+
* // "referenceImages": []
|
|
9613
|
+
* // }
|
|
9614
|
+
* }
|
|
9615
|
+
*
|
|
9616
|
+
* main().catch(e => {
|
|
9617
|
+
* console.error(e);
|
|
9618
|
+
* throw e;
|
|
9619
|
+
* });
|
|
9620
|
+
*
|
|
9621
|
+
* ```
|
|
7960
9622
|
*
|
|
7961
9623
|
* @param params - Parameters for request
|
|
7962
9624
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -7966,11 +9628,11 @@ export namespace vision_v1 {
|
|
|
7966
9628
|
list(
|
|
7967
9629
|
params: Params$Resource$Projects$Locations$Products$Referenceimages$List,
|
|
7968
9630
|
options: StreamMethodOptions
|
|
7969
|
-
):
|
|
9631
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7970
9632
|
list(
|
|
7971
9633
|
params?: Params$Resource$Projects$Locations$Products$Referenceimages$List,
|
|
7972
9634
|
options?: MethodOptions
|
|
7973
|
-
):
|
|
9635
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$ListReferenceImagesResponse>>;
|
|
7974
9636
|
list(
|
|
7975
9637
|
params: Params$Resource$Projects$Locations$Products$Referenceimages$List,
|
|
7976
9638
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -8005,8 +9667,8 @@ export namespace vision_v1 {
|
|
|
8005
9667
|
| BodyResponseCallback<Readable>
|
|
8006
9668
|
):
|
|
8007
9669
|
| void
|
|
8008
|
-
|
|
|
8009
|
-
|
|
|
9670
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$ListReferenceImagesResponse>>
|
|
9671
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
8010
9672
|
let params = (paramsOrCallback ||
|
|
8011
9673
|
{}) as Params$Resource$Projects$Locations$Products$Referenceimages$List;
|
|
8012
9674
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -8110,6 +9772,61 @@ export namespace vision_v1 {
|
|
|
8110
9772
|
|
|
8111
9773
|
/**
|
|
8112
9774
|
* 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.
|
|
9775
|
+
* @example
|
|
9776
|
+
* ```js
|
|
9777
|
+
* // Before running the sample:
|
|
9778
|
+
* // - Enable the API at:
|
|
9779
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
9780
|
+
* // - Login into gcloud by running:
|
|
9781
|
+
* // ```sh
|
|
9782
|
+
* // $ gcloud auth application-default login
|
|
9783
|
+
* // ```
|
|
9784
|
+
* // - Install the npm module by running:
|
|
9785
|
+
* // ```sh
|
|
9786
|
+
* // $ npm install googleapis
|
|
9787
|
+
* // ```
|
|
9788
|
+
*
|
|
9789
|
+
* const {google} = require('googleapis');
|
|
9790
|
+
* const vision = google.vision('v1');
|
|
9791
|
+
*
|
|
9792
|
+
* async function main() {
|
|
9793
|
+
* const auth = new google.auth.GoogleAuth({
|
|
9794
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
9795
|
+
* scopes: [
|
|
9796
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
9797
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
9798
|
+
* ],
|
|
9799
|
+
* });
|
|
9800
|
+
*
|
|
9801
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
9802
|
+
* const authClient = await auth.getClient();
|
|
9803
|
+
* google.options({auth: authClient});
|
|
9804
|
+
*
|
|
9805
|
+
* // Do the magic
|
|
9806
|
+
* const res = await vision.projects.locations.productSets.addProduct({
|
|
9807
|
+
* // Required. The resource name for the ProductSet to modify. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
9808
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
9809
|
+
*
|
|
9810
|
+
* // Request body metadata
|
|
9811
|
+
* requestBody: {
|
|
9812
|
+
* // request body parameters
|
|
9813
|
+
* // {
|
|
9814
|
+
* // "product": "my_product"
|
|
9815
|
+
* // }
|
|
9816
|
+
* },
|
|
9817
|
+
* });
|
|
9818
|
+
* console.log(res.data);
|
|
9819
|
+
*
|
|
9820
|
+
* // Example response
|
|
9821
|
+
* // {}
|
|
9822
|
+
* }
|
|
9823
|
+
*
|
|
9824
|
+
* main().catch(e => {
|
|
9825
|
+
* console.error(e);
|
|
9826
|
+
* throw e;
|
|
9827
|
+
* });
|
|
9828
|
+
*
|
|
9829
|
+
* ```
|
|
8113
9830
|
*
|
|
8114
9831
|
* @param params - Parameters for request
|
|
8115
9832
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -8119,11 +9836,11 @@ export namespace vision_v1 {
|
|
|
8119
9836
|
addProduct(
|
|
8120
9837
|
params: Params$Resource$Projects$Locations$Productsets$Addproduct,
|
|
8121
9838
|
options: StreamMethodOptions
|
|
8122
|
-
):
|
|
9839
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
8123
9840
|
addProduct(
|
|
8124
9841
|
params?: Params$Resource$Projects$Locations$Productsets$Addproduct,
|
|
8125
9842
|
options?: MethodOptions
|
|
8126
|
-
):
|
|
9843
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
8127
9844
|
addProduct(
|
|
8128
9845
|
params: Params$Resource$Projects$Locations$Productsets$Addproduct,
|
|
8129
9846
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -8152,7 +9869,10 @@ export namespace vision_v1 {
|
|
|
8152
9869
|
callback?:
|
|
8153
9870
|
| BodyResponseCallback<Schema$Empty>
|
|
8154
9871
|
| BodyResponseCallback<Readable>
|
|
8155
|
-
):
|
|
9872
|
+
):
|
|
9873
|
+
| void
|
|
9874
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
|
|
9875
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
8156
9876
|
let params = (paramsOrCallback ||
|
|
8157
9877
|
{}) as Params$Resource$Projects$Locations$Productsets$Addproduct;
|
|
8158
9878
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -8199,6 +9919,71 @@ export namespace vision_v1 {
|
|
|
8199
9919
|
|
|
8200
9920
|
/**
|
|
8201
9921
|
* Creates and returns a new ProductSet resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
|
|
9922
|
+
* @example
|
|
9923
|
+
* ```js
|
|
9924
|
+
* // Before running the sample:
|
|
9925
|
+
* // - Enable the API at:
|
|
9926
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
9927
|
+
* // - Login into gcloud by running:
|
|
9928
|
+
* // ```sh
|
|
9929
|
+
* // $ gcloud auth application-default login
|
|
9930
|
+
* // ```
|
|
9931
|
+
* // - Install the npm module by running:
|
|
9932
|
+
* // ```sh
|
|
9933
|
+
* // $ npm install googleapis
|
|
9934
|
+
* // ```
|
|
9935
|
+
*
|
|
9936
|
+
* const {google} = require('googleapis');
|
|
9937
|
+
* const vision = google.vision('v1');
|
|
9938
|
+
*
|
|
9939
|
+
* async function main() {
|
|
9940
|
+
* const auth = new google.auth.GoogleAuth({
|
|
9941
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
9942
|
+
* scopes: [
|
|
9943
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
9944
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
9945
|
+
* ],
|
|
9946
|
+
* });
|
|
9947
|
+
*
|
|
9948
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
9949
|
+
* const authClient = await auth.getClient();
|
|
9950
|
+
* google.options({auth: authClient});
|
|
9951
|
+
*
|
|
9952
|
+
* // Do the magic
|
|
9953
|
+
* const res = await vision.projects.locations.productSets.create({
|
|
9954
|
+
* // Required. The project in which the ProductSet should be created. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
9955
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
9956
|
+
* // 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 `/`.
|
|
9957
|
+
* productSetId: 'placeholder-value',
|
|
9958
|
+
*
|
|
9959
|
+
* // Request body metadata
|
|
9960
|
+
* requestBody: {
|
|
9961
|
+
* // request body parameters
|
|
9962
|
+
* // {
|
|
9963
|
+
* // "displayName": "my_displayName",
|
|
9964
|
+
* // "indexError": {},
|
|
9965
|
+
* // "indexTime": "my_indexTime",
|
|
9966
|
+
* // "name": "my_name"
|
|
9967
|
+
* // }
|
|
9968
|
+
* },
|
|
9969
|
+
* });
|
|
9970
|
+
* console.log(res.data);
|
|
9971
|
+
*
|
|
9972
|
+
* // Example response
|
|
9973
|
+
* // {
|
|
9974
|
+
* // "displayName": "my_displayName",
|
|
9975
|
+
* // "indexError": {},
|
|
9976
|
+
* // "indexTime": "my_indexTime",
|
|
9977
|
+
* // "name": "my_name"
|
|
9978
|
+
* // }
|
|
9979
|
+
* }
|
|
9980
|
+
*
|
|
9981
|
+
* main().catch(e => {
|
|
9982
|
+
* console.error(e);
|
|
9983
|
+
* throw e;
|
|
9984
|
+
* });
|
|
9985
|
+
*
|
|
9986
|
+
* ```
|
|
8202
9987
|
*
|
|
8203
9988
|
* @param params - Parameters for request
|
|
8204
9989
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -8208,11 +9993,11 @@ export namespace vision_v1 {
|
|
|
8208
9993
|
create(
|
|
8209
9994
|
params: Params$Resource$Projects$Locations$Productsets$Create,
|
|
8210
9995
|
options: StreamMethodOptions
|
|
8211
|
-
):
|
|
9996
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
8212
9997
|
create(
|
|
8213
9998
|
params?: Params$Resource$Projects$Locations$Productsets$Create,
|
|
8214
9999
|
options?: MethodOptions
|
|
8215
|
-
):
|
|
10000
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$ProductSet>>;
|
|
8216
10001
|
create(
|
|
8217
10002
|
params: Params$Resource$Projects$Locations$Productsets$Create,
|
|
8218
10003
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -8241,7 +10026,10 @@ export namespace vision_v1 {
|
|
|
8241
10026
|
callback?:
|
|
8242
10027
|
| BodyResponseCallback<Schema$ProductSet>
|
|
8243
10028
|
| BodyResponseCallback<Readable>
|
|
8244
|
-
):
|
|
10029
|
+
):
|
|
10030
|
+
| void
|
|
10031
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$ProductSet>>
|
|
10032
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
8245
10033
|
let params = (paramsOrCallback ||
|
|
8246
10034
|
{}) as Params$Resource$Projects$Locations$Productsets$Create;
|
|
8247
10035
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -8287,6 +10075,53 @@ export namespace vision_v1 {
|
|
|
8287
10075
|
|
|
8288
10076
|
/**
|
|
8289
10077
|
* Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted. The actual image files are not deleted from Google Cloud Storage.
|
|
10078
|
+
* @example
|
|
10079
|
+
* ```js
|
|
10080
|
+
* // Before running the sample:
|
|
10081
|
+
* // - Enable the API at:
|
|
10082
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
10083
|
+
* // - Login into gcloud by running:
|
|
10084
|
+
* // ```sh
|
|
10085
|
+
* // $ gcloud auth application-default login
|
|
10086
|
+
* // ```
|
|
10087
|
+
* // - Install the npm module by running:
|
|
10088
|
+
* // ```sh
|
|
10089
|
+
* // $ npm install googleapis
|
|
10090
|
+
* // ```
|
|
10091
|
+
*
|
|
10092
|
+
* const {google} = require('googleapis');
|
|
10093
|
+
* const vision = google.vision('v1');
|
|
10094
|
+
*
|
|
10095
|
+
* async function main() {
|
|
10096
|
+
* const auth = new google.auth.GoogleAuth({
|
|
10097
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
10098
|
+
* scopes: [
|
|
10099
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
10100
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
10101
|
+
* ],
|
|
10102
|
+
* });
|
|
10103
|
+
*
|
|
10104
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
10105
|
+
* const authClient = await auth.getClient();
|
|
10106
|
+
* google.options({auth: authClient});
|
|
10107
|
+
*
|
|
10108
|
+
* // Do the magic
|
|
10109
|
+
* const res = await vision.projects.locations.productSets.delete({
|
|
10110
|
+
* // Required. Resource name of the ProductSet to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
10111
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
10112
|
+
* });
|
|
10113
|
+
* console.log(res.data);
|
|
10114
|
+
*
|
|
10115
|
+
* // Example response
|
|
10116
|
+
* // {}
|
|
10117
|
+
* }
|
|
10118
|
+
*
|
|
10119
|
+
* main().catch(e => {
|
|
10120
|
+
* console.error(e);
|
|
10121
|
+
* throw e;
|
|
10122
|
+
* });
|
|
10123
|
+
*
|
|
10124
|
+
* ```
|
|
8290
10125
|
*
|
|
8291
10126
|
* @param params - Parameters for request
|
|
8292
10127
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -8296,11 +10131,11 @@ export namespace vision_v1 {
|
|
|
8296
10131
|
delete(
|
|
8297
10132
|
params: Params$Resource$Projects$Locations$Productsets$Delete,
|
|
8298
10133
|
options: StreamMethodOptions
|
|
8299
|
-
):
|
|
10134
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
8300
10135
|
delete(
|
|
8301
10136
|
params?: Params$Resource$Projects$Locations$Productsets$Delete,
|
|
8302
10137
|
options?: MethodOptions
|
|
8303
|
-
):
|
|
10138
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
8304
10139
|
delete(
|
|
8305
10140
|
params: Params$Resource$Projects$Locations$Productsets$Delete,
|
|
8306
10141
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -8329,7 +10164,10 @@ export namespace vision_v1 {
|
|
|
8329
10164
|
callback?:
|
|
8330
10165
|
| BodyResponseCallback<Schema$Empty>
|
|
8331
10166
|
| BodyResponseCallback<Readable>
|
|
8332
|
-
):
|
|
10167
|
+
):
|
|
10168
|
+
| void
|
|
10169
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
|
|
10170
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
8333
10171
|
let params = (paramsOrCallback ||
|
|
8334
10172
|
{}) as Params$Resource$Projects$Locations$Productsets$Delete;
|
|
8335
10173
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -8372,6 +10210,58 @@ export namespace vision_v1 {
|
|
|
8372
10210
|
|
|
8373
10211
|
/**
|
|
8374
10212
|
* Gets information associated with a ProductSet. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist.
|
|
10213
|
+
* @example
|
|
10214
|
+
* ```js
|
|
10215
|
+
* // Before running the sample:
|
|
10216
|
+
* // - Enable the API at:
|
|
10217
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
10218
|
+
* // - Login into gcloud by running:
|
|
10219
|
+
* // ```sh
|
|
10220
|
+
* // $ gcloud auth application-default login
|
|
10221
|
+
* // ```
|
|
10222
|
+
* // - Install the npm module by running:
|
|
10223
|
+
* // ```sh
|
|
10224
|
+
* // $ npm install googleapis
|
|
10225
|
+
* // ```
|
|
10226
|
+
*
|
|
10227
|
+
* const {google} = require('googleapis');
|
|
10228
|
+
* const vision = google.vision('v1');
|
|
10229
|
+
*
|
|
10230
|
+
* async function main() {
|
|
10231
|
+
* const auth = new google.auth.GoogleAuth({
|
|
10232
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
10233
|
+
* scopes: [
|
|
10234
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
10235
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
10236
|
+
* ],
|
|
10237
|
+
* });
|
|
10238
|
+
*
|
|
10239
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
10240
|
+
* const authClient = await auth.getClient();
|
|
10241
|
+
* google.options({auth: authClient});
|
|
10242
|
+
*
|
|
10243
|
+
* // Do the magic
|
|
10244
|
+
* const res = await vision.projects.locations.productSets.get({
|
|
10245
|
+
* // Required. Resource name of the ProductSet to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
10246
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
10247
|
+
* });
|
|
10248
|
+
* console.log(res.data);
|
|
10249
|
+
*
|
|
10250
|
+
* // Example response
|
|
10251
|
+
* // {
|
|
10252
|
+
* // "displayName": "my_displayName",
|
|
10253
|
+
* // "indexError": {},
|
|
10254
|
+
* // "indexTime": "my_indexTime",
|
|
10255
|
+
* // "name": "my_name"
|
|
10256
|
+
* // }
|
|
10257
|
+
* }
|
|
10258
|
+
*
|
|
10259
|
+
* main().catch(e => {
|
|
10260
|
+
* console.error(e);
|
|
10261
|
+
* throw e;
|
|
10262
|
+
* });
|
|
10263
|
+
*
|
|
10264
|
+
* ```
|
|
8375
10265
|
*
|
|
8376
10266
|
* @param params - Parameters for request
|
|
8377
10267
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -8381,11 +10271,11 @@ export namespace vision_v1 {
|
|
|
8381
10271
|
get(
|
|
8382
10272
|
params: Params$Resource$Projects$Locations$Productsets$Get,
|
|
8383
10273
|
options: StreamMethodOptions
|
|
8384
|
-
):
|
|
10274
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
8385
10275
|
get(
|
|
8386
10276
|
params?: Params$Resource$Projects$Locations$Productsets$Get,
|
|
8387
10277
|
options?: MethodOptions
|
|
8388
|
-
):
|
|
10278
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$ProductSet>>;
|
|
8389
10279
|
get(
|
|
8390
10280
|
params: Params$Resource$Projects$Locations$Productsets$Get,
|
|
8391
10281
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -8414,7 +10304,10 @@ export namespace vision_v1 {
|
|
|
8414
10304
|
callback?:
|
|
8415
10305
|
| BodyResponseCallback<Schema$ProductSet>
|
|
8416
10306
|
| BodyResponseCallback<Readable>
|
|
8417
|
-
):
|
|
10307
|
+
):
|
|
10308
|
+
| void
|
|
10309
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$ProductSet>>
|
|
10310
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
8418
10311
|
let params = (paramsOrCallback ||
|
|
8419
10312
|
{}) as Params$Resource$Projects$Locations$Productsets$Get;
|
|
8420
10313
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -8457,6 +10350,67 @@ export namespace vision_v1 {
|
|
|
8457
10350
|
|
|
8458
10351
|
/**
|
|
8459
10352
|
* 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.
|
|
10353
|
+
* @example
|
|
10354
|
+
* ```js
|
|
10355
|
+
* // Before running the sample:
|
|
10356
|
+
* // - Enable the API at:
|
|
10357
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
10358
|
+
* // - Login into gcloud by running:
|
|
10359
|
+
* // ```sh
|
|
10360
|
+
* // $ gcloud auth application-default login
|
|
10361
|
+
* // ```
|
|
10362
|
+
* // - Install the npm module by running:
|
|
10363
|
+
* // ```sh
|
|
10364
|
+
* // $ npm install googleapis
|
|
10365
|
+
* // ```
|
|
10366
|
+
*
|
|
10367
|
+
* const {google} = require('googleapis');
|
|
10368
|
+
* const vision = google.vision('v1');
|
|
10369
|
+
*
|
|
10370
|
+
* async function main() {
|
|
10371
|
+
* const auth = new google.auth.GoogleAuth({
|
|
10372
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
10373
|
+
* scopes: [
|
|
10374
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
10375
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
10376
|
+
* ],
|
|
10377
|
+
* });
|
|
10378
|
+
*
|
|
10379
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
10380
|
+
* const authClient = await auth.getClient();
|
|
10381
|
+
* google.options({auth: authClient});
|
|
10382
|
+
*
|
|
10383
|
+
* // Do the magic
|
|
10384
|
+
* const res = await vision.projects.locations.productSets.import({
|
|
10385
|
+
* // Required. The project in which the ProductSets should be imported. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
10386
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
10387
|
+
*
|
|
10388
|
+
* // Request body metadata
|
|
10389
|
+
* requestBody: {
|
|
10390
|
+
* // request body parameters
|
|
10391
|
+
* // {
|
|
10392
|
+
* // "inputConfig": {}
|
|
10393
|
+
* // }
|
|
10394
|
+
* },
|
|
10395
|
+
* });
|
|
10396
|
+
* console.log(res.data);
|
|
10397
|
+
*
|
|
10398
|
+
* // Example response
|
|
10399
|
+
* // {
|
|
10400
|
+
* // "done": false,
|
|
10401
|
+
* // "error": {},
|
|
10402
|
+
* // "metadata": {},
|
|
10403
|
+
* // "name": "my_name",
|
|
10404
|
+
* // "response": {}
|
|
10405
|
+
* // }
|
|
10406
|
+
* }
|
|
10407
|
+
*
|
|
10408
|
+
* main().catch(e => {
|
|
10409
|
+
* console.error(e);
|
|
10410
|
+
* throw e;
|
|
10411
|
+
* });
|
|
10412
|
+
*
|
|
10413
|
+
* ```
|
|
8460
10414
|
*
|
|
8461
10415
|
* @param params - Parameters for request
|
|
8462
10416
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -8466,11 +10420,11 @@ export namespace vision_v1 {
|
|
|
8466
10420
|
import(
|
|
8467
10421
|
params: Params$Resource$Projects$Locations$Productsets$Import,
|
|
8468
10422
|
options: StreamMethodOptions
|
|
8469
|
-
):
|
|
10423
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
8470
10424
|
import(
|
|
8471
10425
|
params?: Params$Resource$Projects$Locations$Productsets$Import,
|
|
8472
10426
|
options?: MethodOptions
|
|
8473
|
-
):
|
|
10427
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
8474
10428
|
import(
|
|
8475
10429
|
params: Params$Resource$Projects$Locations$Productsets$Import,
|
|
8476
10430
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -8499,7 +10453,10 @@ export namespace vision_v1 {
|
|
|
8499
10453
|
callback?:
|
|
8500
10454
|
| BodyResponseCallback<Schema$Operation>
|
|
8501
10455
|
| BodyResponseCallback<Readable>
|
|
8502
|
-
):
|
|
10456
|
+
):
|
|
10457
|
+
| void
|
|
10458
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
|
|
10459
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
8503
10460
|
let params = (paramsOrCallback ||
|
|
8504
10461
|
{}) as Params$Resource$Projects$Locations$Productsets$Import;
|
|
8505
10462
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -8545,6 +10502,60 @@ export namespace vision_v1 {
|
|
|
8545
10502
|
|
|
8546
10503
|
/**
|
|
8547
10504
|
* Lists ProductSets in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
|
|
10505
|
+
* @example
|
|
10506
|
+
* ```js
|
|
10507
|
+
* // Before running the sample:
|
|
10508
|
+
* // - Enable the API at:
|
|
10509
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
10510
|
+
* // - Login into gcloud by running:
|
|
10511
|
+
* // ```sh
|
|
10512
|
+
* // $ gcloud auth application-default login
|
|
10513
|
+
* // ```
|
|
10514
|
+
* // - Install the npm module by running:
|
|
10515
|
+
* // ```sh
|
|
10516
|
+
* // $ npm install googleapis
|
|
10517
|
+
* // ```
|
|
10518
|
+
*
|
|
10519
|
+
* const {google} = require('googleapis');
|
|
10520
|
+
* const vision = google.vision('v1');
|
|
10521
|
+
*
|
|
10522
|
+
* async function main() {
|
|
10523
|
+
* const auth = new google.auth.GoogleAuth({
|
|
10524
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
10525
|
+
* scopes: [
|
|
10526
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
10527
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
10528
|
+
* ],
|
|
10529
|
+
* });
|
|
10530
|
+
*
|
|
10531
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
10532
|
+
* const authClient = await auth.getClient();
|
|
10533
|
+
* google.options({auth: authClient});
|
|
10534
|
+
*
|
|
10535
|
+
* // Do the magic
|
|
10536
|
+
* const res = await vision.projects.locations.productSets.list({
|
|
10537
|
+
* // The maximum number of items to return. Default 10, maximum 100.
|
|
10538
|
+
* pageSize: 'placeholder-value',
|
|
10539
|
+
* // The next_page_token returned from a previous List request, if any.
|
|
10540
|
+
* pageToken: 'placeholder-value',
|
|
10541
|
+
* // Required. The project from which ProductSets should be listed. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
10542
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
10543
|
+
* });
|
|
10544
|
+
* console.log(res.data);
|
|
10545
|
+
*
|
|
10546
|
+
* // Example response
|
|
10547
|
+
* // {
|
|
10548
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
10549
|
+
* // "productSets": []
|
|
10550
|
+
* // }
|
|
10551
|
+
* }
|
|
10552
|
+
*
|
|
10553
|
+
* main().catch(e => {
|
|
10554
|
+
* console.error(e);
|
|
10555
|
+
* throw e;
|
|
10556
|
+
* });
|
|
10557
|
+
*
|
|
10558
|
+
* ```
|
|
8548
10559
|
*
|
|
8549
10560
|
* @param params - Parameters for request
|
|
8550
10561
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -8554,11 +10565,11 @@ export namespace vision_v1 {
|
|
|
8554
10565
|
list(
|
|
8555
10566
|
params: Params$Resource$Projects$Locations$Productsets$List,
|
|
8556
10567
|
options: StreamMethodOptions
|
|
8557
|
-
):
|
|
10568
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
8558
10569
|
list(
|
|
8559
10570
|
params?: Params$Resource$Projects$Locations$Productsets$List,
|
|
8560
10571
|
options?: MethodOptions
|
|
8561
|
-
):
|
|
10572
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$ListProductSetsResponse>>;
|
|
8562
10573
|
list(
|
|
8563
10574
|
params: Params$Resource$Projects$Locations$Productsets$List,
|
|
8564
10575
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -8591,8 +10602,8 @@ export namespace vision_v1 {
|
|
|
8591
10602
|
| BodyResponseCallback<Readable>
|
|
8592
10603
|
):
|
|
8593
10604
|
| void
|
|
8594
|
-
|
|
|
8595
|
-
|
|
|
10605
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$ListProductSetsResponse>>
|
|
10606
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
8596
10607
|
let params = (paramsOrCallback ||
|
|
8597
10608
|
{}) as Params$Resource$Projects$Locations$Productsets$List;
|
|
8598
10609
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -8638,6 +10649,71 @@ export namespace vision_v1 {
|
|
|
8638
10649
|
|
|
8639
10650
|
/**
|
|
8640
10651
|
* 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.
|
|
10652
|
+
* @example
|
|
10653
|
+
* ```js
|
|
10654
|
+
* // Before running the sample:
|
|
10655
|
+
* // - Enable the API at:
|
|
10656
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
10657
|
+
* // - Login into gcloud by running:
|
|
10658
|
+
* // ```sh
|
|
10659
|
+
* // $ gcloud auth application-default login
|
|
10660
|
+
* // ```
|
|
10661
|
+
* // - Install the npm module by running:
|
|
10662
|
+
* // ```sh
|
|
10663
|
+
* // $ npm install googleapis
|
|
10664
|
+
* // ```
|
|
10665
|
+
*
|
|
10666
|
+
* const {google} = require('googleapis');
|
|
10667
|
+
* const vision = google.vision('v1');
|
|
10668
|
+
*
|
|
10669
|
+
* async function main() {
|
|
10670
|
+
* const auth = new google.auth.GoogleAuth({
|
|
10671
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
10672
|
+
* scopes: [
|
|
10673
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
10674
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
10675
|
+
* ],
|
|
10676
|
+
* });
|
|
10677
|
+
*
|
|
10678
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
10679
|
+
* const authClient = await auth.getClient();
|
|
10680
|
+
* google.options({auth: authClient});
|
|
10681
|
+
*
|
|
10682
|
+
* // Do the magic
|
|
10683
|
+
* const res = await vision.projects.locations.productSets.patch({
|
|
10684
|
+
* // 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.
|
|
10685
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
10686
|
+
* // 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`.
|
|
10687
|
+
* updateMask: 'placeholder-value',
|
|
10688
|
+
*
|
|
10689
|
+
* // Request body metadata
|
|
10690
|
+
* requestBody: {
|
|
10691
|
+
* // request body parameters
|
|
10692
|
+
* // {
|
|
10693
|
+
* // "displayName": "my_displayName",
|
|
10694
|
+
* // "indexError": {},
|
|
10695
|
+
* // "indexTime": "my_indexTime",
|
|
10696
|
+
* // "name": "my_name"
|
|
10697
|
+
* // }
|
|
10698
|
+
* },
|
|
10699
|
+
* });
|
|
10700
|
+
* console.log(res.data);
|
|
10701
|
+
*
|
|
10702
|
+
* // Example response
|
|
10703
|
+
* // {
|
|
10704
|
+
* // "displayName": "my_displayName",
|
|
10705
|
+
* // "indexError": {},
|
|
10706
|
+
* // "indexTime": "my_indexTime",
|
|
10707
|
+
* // "name": "my_name"
|
|
10708
|
+
* // }
|
|
10709
|
+
* }
|
|
10710
|
+
*
|
|
10711
|
+
* main().catch(e => {
|
|
10712
|
+
* console.error(e);
|
|
10713
|
+
* throw e;
|
|
10714
|
+
* });
|
|
10715
|
+
*
|
|
10716
|
+
* ```
|
|
8641
10717
|
*
|
|
8642
10718
|
* @param params - Parameters for request
|
|
8643
10719
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -8647,11 +10723,11 @@ export namespace vision_v1 {
|
|
|
8647
10723
|
patch(
|
|
8648
10724
|
params: Params$Resource$Projects$Locations$Productsets$Patch,
|
|
8649
10725
|
options: StreamMethodOptions
|
|
8650
|
-
):
|
|
10726
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
8651
10727
|
patch(
|
|
8652
10728
|
params?: Params$Resource$Projects$Locations$Productsets$Patch,
|
|
8653
10729
|
options?: MethodOptions
|
|
8654
|
-
):
|
|
10730
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$ProductSet>>;
|
|
8655
10731
|
patch(
|
|
8656
10732
|
params: Params$Resource$Projects$Locations$Productsets$Patch,
|
|
8657
10733
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -8680,7 +10756,10 @@ export namespace vision_v1 {
|
|
|
8680
10756
|
callback?:
|
|
8681
10757
|
| BodyResponseCallback<Schema$ProductSet>
|
|
8682
10758
|
| BodyResponseCallback<Readable>
|
|
8683
|
-
):
|
|
10759
|
+
):
|
|
10760
|
+
| void
|
|
10761
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$ProductSet>>
|
|
10762
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
8684
10763
|
let params = (paramsOrCallback ||
|
|
8685
10764
|
{}) as Params$Resource$Projects$Locations$Productsets$Patch;
|
|
8686
10765
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -8723,6 +10802,61 @@ export namespace vision_v1 {
|
|
|
8723
10802
|
|
|
8724
10803
|
/**
|
|
8725
10804
|
* Removes a Product from the specified ProductSet.
|
|
10805
|
+
* @example
|
|
10806
|
+
* ```js
|
|
10807
|
+
* // Before running the sample:
|
|
10808
|
+
* // - Enable the API at:
|
|
10809
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
10810
|
+
* // - Login into gcloud by running:
|
|
10811
|
+
* // ```sh
|
|
10812
|
+
* // $ gcloud auth application-default login
|
|
10813
|
+
* // ```
|
|
10814
|
+
* // - Install the npm module by running:
|
|
10815
|
+
* // ```sh
|
|
10816
|
+
* // $ npm install googleapis
|
|
10817
|
+
* // ```
|
|
10818
|
+
*
|
|
10819
|
+
* const {google} = require('googleapis');
|
|
10820
|
+
* const vision = google.vision('v1');
|
|
10821
|
+
*
|
|
10822
|
+
* async function main() {
|
|
10823
|
+
* const auth = new google.auth.GoogleAuth({
|
|
10824
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
10825
|
+
* scopes: [
|
|
10826
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
10827
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
10828
|
+
* ],
|
|
10829
|
+
* });
|
|
10830
|
+
*
|
|
10831
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
10832
|
+
* const authClient = await auth.getClient();
|
|
10833
|
+
* google.options({auth: authClient});
|
|
10834
|
+
*
|
|
10835
|
+
* // Do the magic
|
|
10836
|
+
* const res = await vision.projects.locations.productSets.removeProduct({
|
|
10837
|
+
* // Required. The resource name for the ProductSet to modify. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
10838
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
10839
|
+
*
|
|
10840
|
+
* // Request body metadata
|
|
10841
|
+
* requestBody: {
|
|
10842
|
+
* // request body parameters
|
|
10843
|
+
* // {
|
|
10844
|
+
* // "product": "my_product"
|
|
10845
|
+
* // }
|
|
10846
|
+
* },
|
|
10847
|
+
* });
|
|
10848
|
+
* console.log(res.data);
|
|
10849
|
+
*
|
|
10850
|
+
* // Example response
|
|
10851
|
+
* // {}
|
|
10852
|
+
* }
|
|
10853
|
+
*
|
|
10854
|
+
* main().catch(e => {
|
|
10855
|
+
* console.error(e);
|
|
10856
|
+
* throw e;
|
|
10857
|
+
* });
|
|
10858
|
+
*
|
|
10859
|
+
* ```
|
|
8726
10860
|
*
|
|
8727
10861
|
* @param params - Parameters for request
|
|
8728
10862
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -8732,11 +10866,11 @@ export namespace vision_v1 {
|
|
|
8732
10866
|
removeProduct(
|
|
8733
10867
|
params: Params$Resource$Projects$Locations$Productsets$Removeproduct,
|
|
8734
10868
|
options: StreamMethodOptions
|
|
8735
|
-
):
|
|
10869
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
8736
10870
|
removeProduct(
|
|
8737
10871
|
params?: Params$Resource$Projects$Locations$Productsets$Removeproduct,
|
|
8738
10872
|
options?: MethodOptions
|
|
8739
|
-
):
|
|
10873
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
8740
10874
|
removeProduct(
|
|
8741
10875
|
params: Params$Resource$Projects$Locations$Productsets$Removeproduct,
|
|
8742
10876
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -8765,7 +10899,10 @@ export namespace vision_v1 {
|
|
|
8765
10899
|
callback?:
|
|
8766
10900
|
| BodyResponseCallback<Schema$Empty>
|
|
8767
10901
|
| BodyResponseCallback<Readable>
|
|
8768
|
-
):
|
|
10902
|
+
):
|
|
10903
|
+
| void
|
|
10904
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
|
|
10905
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
8769
10906
|
let params = (paramsOrCallback ||
|
|
8770
10907
|
{}) as Params$Resource$Projects$Locations$Productsets$Removeproduct;
|
|
8771
10908
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -8917,6 +11054,60 @@ export namespace vision_v1 {
|
|
|
8917
11054
|
|
|
8918
11055
|
/**
|
|
8919
11056
|
* 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.
|
|
11057
|
+
* @example
|
|
11058
|
+
* ```js
|
|
11059
|
+
* // Before running the sample:
|
|
11060
|
+
* // - Enable the API at:
|
|
11061
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
11062
|
+
* // - Login into gcloud by running:
|
|
11063
|
+
* // ```sh
|
|
11064
|
+
* // $ gcloud auth application-default login
|
|
11065
|
+
* // ```
|
|
11066
|
+
* // - Install the npm module by running:
|
|
11067
|
+
* // ```sh
|
|
11068
|
+
* // $ npm install googleapis
|
|
11069
|
+
* // ```
|
|
11070
|
+
*
|
|
11071
|
+
* const {google} = require('googleapis');
|
|
11072
|
+
* const vision = google.vision('v1');
|
|
11073
|
+
*
|
|
11074
|
+
* async function main() {
|
|
11075
|
+
* const auth = new google.auth.GoogleAuth({
|
|
11076
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
11077
|
+
* scopes: [
|
|
11078
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
11079
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
11080
|
+
* ],
|
|
11081
|
+
* });
|
|
11082
|
+
*
|
|
11083
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
11084
|
+
* const authClient = await auth.getClient();
|
|
11085
|
+
* google.options({auth: authClient});
|
|
11086
|
+
*
|
|
11087
|
+
* // Do the magic
|
|
11088
|
+
* const res = await vision.projects.locations.productSets.products.list({
|
|
11089
|
+
* // Required. The ProductSet resource for which to retrieve Products. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
11090
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
11091
|
+
* // The maximum number of items to return. Default 10, maximum 100.
|
|
11092
|
+
* pageSize: 'placeholder-value',
|
|
11093
|
+
* // The next_page_token returned from a previous List request, if any.
|
|
11094
|
+
* pageToken: 'placeholder-value',
|
|
11095
|
+
* });
|
|
11096
|
+
* console.log(res.data);
|
|
11097
|
+
*
|
|
11098
|
+
* // Example response
|
|
11099
|
+
* // {
|
|
11100
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
11101
|
+
* // "products": []
|
|
11102
|
+
* // }
|
|
11103
|
+
* }
|
|
11104
|
+
*
|
|
11105
|
+
* main().catch(e => {
|
|
11106
|
+
* console.error(e);
|
|
11107
|
+
* throw e;
|
|
11108
|
+
* });
|
|
11109
|
+
*
|
|
11110
|
+
* ```
|
|
8920
11111
|
*
|
|
8921
11112
|
* @param params - Parameters for request
|
|
8922
11113
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -8926,11 +11117,13 @@ export namespace vision_v1 {
|
|
|
8926
11117
|
list(
|
|
8927
11118
|
params: Params$Resource$Projects$Locations$Productsets$Products$List,
|
|
8928
11119
|
options: StreamMethodOptions
|
|
8929
|
-
):
|
|
11120
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
8930
11121
|
list(
|
|
8931
11122
|
params?: Params$Resource$Projects$Locations$Productsets$Products$List,
|
|
8932
11123
|
options?: MethodOptions
|
|
8933
|
-
):
|
|
11124
|
+
): Promise<
|
|
11125
|
+
GaxiosResponseWithHTTP2<Schema$ListProductsInProductSetResponse>
|
|
11126
|
+
>;
|
|
8934
11127
|
list(
|
|
8935
11128
|
params: Params$Resource$Projects$Locations$Productsets$Products$List,
|
|
8936
11129
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -8965,8 +11158,10 @@ export namespace vision_v1 {
|
|
|
8965
11158
|
| BodyResponseCallback<Readable>
|
|
8966
11159
|
):
|
|
8967
11160
|
| void
|
|
8968
|
-
|
|
|
8969
|
-
|
|
11161
|
+
| Promise<
|
|
11162
|
+
GaxiosResponseWithHTTP2<Schema$ListProductsInProductSetResponse>
|
|
11163
|
+
>
|
|
11164
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
8970
11165
|
let params = (paramsOrCallback ||
|
|
8971
11166
|
{}) as Params$Resource$Projects$Locations$Productsets$Products$List;
|
|
8972
11167
|
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
@@ -9038,6 +11233,59 @@ export namespace vision_v1 {
|
|
|
9038
11233
|
|
|
9039
11234
|
/**
|
|
9040
11235
|
* 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.
|
|
11236
|
+
* @example
|
|
11237
|
+
* ```js
|
|
11238
|
+
* // Before running the sample:
|
|
11239
|
+
* // - Enable the API at:
|
|
11240
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
11241
|
+
* // - Login into gcloud by running:
|
|
11242
|
+
* // ```sh
|
|
11243
|
+
* // $ gcloud auth application-default login
|
|
11244
|
+
* // ```
|
|
11245
|
+
* // - Install the npm module by running:
|
|
11246
|
+
* // ```sh
|
|
11247
|
+
* // $ npm install googleapis
|
|
11248
|
+
* // ```
|
|
11249
|
+
*
|
|
11250
|
+
* const {google} = require('googleapis');
|
|
11251
|
+
* const vision = google.vision('v1');
|
|
11252
|
+
*
|
|
11253
|
+
* async function main() {
|
|
11254
|
+
* const auth = new google.auth.GoogleAuth({
|
|
11255
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
11256
|
+
* scopes: [
|
|
11257
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
11258
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
11259
|
+
* ],
|
|
11260
|
+
* });
|
|
11261
|
+
*
|
|
11262
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
11263
|
+
* const authClient = await auth.getClient();
|
|
11264
|
+
* google.options({auth: authClient});
|
|
11265
|
+
*
|
|
11266
|
+
* // Do the magic
|
|
11267
|
+
* const res = await vision.projects.operations.get({
|
|
11268
|
+
* // The name of the operation resource.
|
|
11269
|
+
* name: 'projects/my-project/operations/my-operation',
|
|
11270
|
+
* });
|
|
11271
|
+
* console.log(res.data);
|
|
11272
|
+
*
|
|
11273
|
+
* // Example response
|
|
11274
|
+
* // {
|
|
11275
|
+
* // "done": false,
|
|
11276
|
+
* // "error": {},
|
|
11277
|
+
* // "metadata": {},
|
|
11278
|
+
* // "name": "my_name",
|
|
11279
|
+
* // "response": {}
|
|
11280
|
+
* // }
|
|
11281
|
+
* }
|
|
11282
|
+
*
|
|
11283
|
+
* main().catch(e => {
|
|
11284
|
+
* console.error(e);
|
|
11285
|
+
* throw e;
|
|
11286
|
+
* });
|
|
11287
|
+
*
|
|
11288
|
+
* ```
|
|
9041
11289
|
*
|
|
9042
11290
|
* @param params - Parameters for request
|
|
9043
11291
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -9047,11 +11295,11 @@ export namespace vision_v1 {
|
|
|
9047
11295
|
get(
|
|
9048
11296
|
params: Params$Resource$Projects$Operations$Get,
|
|
9049
11297
|
options: StreamMethodOptions
|
|
9050
|
-
):
|
|
11298
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
9051
11299
|
get(
|
|
9052
11300
|
params?: Params$Resource$Projects$Operations$Get,
|
|
9053
11301
|
options?: MethodOptions
|
|
9054
|
-
):
|
|
11302
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
9055
11303
|
get(
|
|
9056
11304
|
params: Params$Resource$Projects$Operations$Get,
|
|
9057
11305
|
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
@@ -9080,7 +11328,10 @@ export namespace vision_v1 {
|
|
|
9080
11328
|
callback?:
|
|
9081
11329
|
| BodyResponseCallback<Schema$Operation>
|
|
9082
11330
|
| BodyResponseCallback<Readable>
|
|
9083
|
-
):
|
|
11331
|
+
):
|
|
11332
|
+
| void
|
|
11333
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
|
|
11334
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
9084
11335
|
let params = (paramsOrCallback ||
|
|
9085
11336
|
{}) as Params$Resource$Projects$Operations$Get;
|
|
9086
11337
|
let options = (optionsOrCallback || {}) as MethodOptions;
|