@googleapis/vision 2.0.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/v1.ts CHANGED
@@ -685,7 +685,7 @@ export namespace vision_v1 {
685
685
  */
686
686
  maxResults?: number | null;
687
687
  /**
688
- * Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also support "builtin/weekly" for the bleeding edge release updated weekly.
688
+ * Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also support "builtin/rc" for the latest release candidate.
689
689
  */
690
690
  model?: string | null;
691
691
  /**
@@ -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`.
@@ -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`.
@@ -5387,6 +5503,62 @@ export namespace vision_v1 {
5387
5503
 
5388
5504
  /**
5389
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
+ * ```
5390
5562
  *
5391
5563
  * @param params - Parameters for request
5392
5564
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5481,6 +5653,67 @@ export namespace vision_v1 {
5481
5653
 
5482
5654
  /**
5483
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
+ * ```
5484
5717
  *
5485
5718
  * @param params - Parameters for request
5486
5719
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5602,6 +5835,59 @@ export namespace vision_v1 {
5602
5835
 
5603
5836
  /**
5604
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
+ * ```
5605
5891
  *
5606
5892
  * @param params - Parameters for request
5607
5893
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5705,6 +5991,59 @@ export namespace vision_v1 {
5705
5991
 
5706
5992
  /**
5707
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
+ * ```
5708
6047
  *
5709
6048
  * @param params - Parameters for request
5710
6049
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5793,6 +6132,53 @@ export namespace vision_v1 {
5793
6132
 
5794
6133
  /**
5795
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
+ * ```
5796
6182
  *
5797
6183
  * @param params - Parameters for request
5798
6184
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5881,6 +6267,59 @@ export namespace vision_v1 {
5881
6267
 
5882
6268
  /**
5883
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
+ * ```
5884
6323
  *
5885
6324
  * @param params - Parameters for request
5886
6325
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5968,6 +6407,62 @@ export namespace vision_v1 {
5968
6407
 
5969
6408
  /**
5970
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
+ * ```
5971
6466
  *
5972
6467
  * @param params - Parameters for request
5973
6468
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6123,6 +6618,65 @@ export namespace vision_v1 {
6123
6618
 
6124
6619
  /**
6125
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
+ * ```
6126
6680
  *
6127
6681
  * @param params - Parameters for request
6128
6682
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6218,6 +6772,69 @@ export namespace vision_v1 {
6218
6772
 
6219
6773
  /**
6220
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
+ * ```
6221
6838
  *
6222
6839
  * @param params - Parameters for request
6223
6840
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6341,6 +6958,65 @@ export namespace vision_v1 {
6341
6958
 
6342
6959
  /**
6343
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
+ * ```
6344
7020
  *
6345
7021
  * @param params - Parameters for request
6346
7022
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6436,6 +7112,70 @@ export namespace vision_v1 {
6436
7112
 
6437
7113
  /**
6438
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
+ * ```
6439
7179
  *
6440
7180
  * @param params - Parameters for request
6441
7181
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6580,6 +7320,65 @@ export namespace vision_v1 {
6580
7320
 
6581
7321
  /**
6582
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
+ * ```
6583
7382
  *
6584
7383
  * @param params - Parameters for request
6585
7384
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6675,6 +7474,69 @@ export namespace vision_v1 {
6675
7474
 
6676
7475
  /**
6677
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
+ * ```
6678
7540
  *
6679
7541
  * @param params - Parameters for request
6680
7542
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6799,6 +7661,65 @@ export namespace vision_v1 {
6799
7661
 
6800
7662
  /**
6801
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
+ * ```
6802
7723
  *
6803
7724
  * @param params - Parameters for request
6804
7725
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6894,6 +7815,70 @@ export namespace vision_v1 {
6894
7815
 
6895
7816
  /**
6896
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
+ * ```
6897
7882
  *
6898
7883
  * @param params - Parameters for request
6899
7884
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -7018,6 +8003,59 @@ export namespace vision_v1 {
7018
8003
 
7019
8004
  /**
7020
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
+ * ```
7021
8059
  *
7022
8060
  * @param params - Parameters for request
7023
8061
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -7124,6 +8162,73 @@ export namespace vision_v1 {
7124
8162
 
7125
8163
  /**
7126
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
+ * ```
7127
8232
  *
7128
8233
  * @param params - Parameters for request
7129
8234
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -7215,6 +8320,53 @@ export namespace vision_v1 {
7215
8320
 
7216
8321
  /**
7217
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
+ * ```
7218
8370
  *
7219
8371
  * @param params - Parameters for request
7220
8372
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -7303,6 +8455,59 @@ export namespace vision_v1 {
7303
8455
 
7304
8456
  /**
7305
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
+ * ```
7306
8511
  *
7307
8512
  * @param params - Parameters for request
7308
8513
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -7391,6 +8596,60 @@ export namespace vision_v1 {
7391
8596
 
7392
8597
  /**
7393
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
+ * ```
7394
8653
  *
7395
8654
  * @param params - Parameters for request
7396
8655
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -7484,6 +8743,73 @@ export namespace vision_v1 {
7484
8743
 
7485
8744
  /**
7486
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
+ * ```
7487
8813
  *
7488
8814
  * @param params - Parameters for request
7489
8815
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -7572,6 +8898,69 @@ export namespace vision_v1 {
7572
8898
 
7573
8899
  /**
7574
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
+ * ```
7575
8964
  *
7576
8965
  * @param params - Parameters for request
7577
8966
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -7744,6 +9133,69 @@ export namespace vision_v1 {
7744
9133
 
7745
9134
  /**
7746
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
+ * ```
7747
9199
  *
7748
9200
  * @param params - Parameters for request
7749
9201
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -7836,6 +9288,53 @@ export namespace vision_v1 {
7836
9288
 
7837
9289
  /**
7838
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
+ * ```
7839
9338
  *
7840
9339
  * @param params - Parameters for request
7841
9340
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -7925,6 +9424,57 @@ export namespace vision_v1 {
7925
9424
 
7926
9425
  /**
7927
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
+ * ```
7928
9478
  *
7929
9479
  * @param params - Parameters for request
7930
9480
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -8014,6 +9564,61 @@ export namespace vision_v1 {
8014
9564
 
8015
9565
  /**
8016
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
+ * ```
8017
9622
  *
8018
9623
  * @param params - Parameters for request
8019
9624
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -8167,6 +9772,61 @@ export namespace vision_v1 {
8167
9772
 
8168
9773
  /**
8169
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
+ * ```
8170
9830
  *
8171
9831
  * @param params - Parameters for request
8172
9832
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -8259,6 +9919,71 @@ export namespace vision_v1 {
8259
9919
 
8260
9920
  /**
8261
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
+ * ```
8262
9987
  *
8263
9988
  * @param params - Parameters for request
8264
9989
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -8350,6 +10075,53 @@ export namespace vision_v1 {
8350
10075
 
8351
10076
  /**
8352
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
+ * ```
8353
10125
  *
8354
10126
  * @param params - Parameters for request
8355
10127
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -8438,6 +10210,58 @@ export namespace vision_v1 {
8438
10210
 
8439
10211
  /**
8440
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
+ * ```
8441
10265
  *
8442
10266
  * @param params - Parameters for request
8443
10267
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -8526,6 +10350,67 @@ export namespace vision_v1 {
8526
10350
 
8527
10351
  /**
8528
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
+ * ```
8529
10414
  *
8530
10415
  * @param params - Parameters for request
8531
10416
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -8617,6 +10502,60 @@ export namespace vision_v1 {
8617
10502
 
8618
10503
  /**
8619
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
+ * ```
8620
10559
  *
8621
10560
  * @param params - Parameters for request
8622
10561
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -8710,6 +10649,71 @@ export namespace vision_v1 {
8710
10649
 
8711
10650
  /**
8712
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
+ * ```
8713
10717
  *
8714
10718
  * @param params - Parameters for request
8715
10719
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -8798,6 +10802,61 @@ export namespace vision_v1 {
8798
10802
 
8799
10803
  /**
8800
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
+ * ```
8801
10860
  *
8802
10861
  * @param params - Parameters for request
8803
10862
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -8995,6 +11054,60 @@ export namespace vision_v1 {
8995
11054
 
8996
11055
  /**
8997
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
+ * ```
8998
11111
  *
8999
11112
  * @param params - Parameters for request
9000
11113
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -9120,6 +11233,59 @@ export namespace vision_v1 {
9120
11233
 
9121
11234
  /**
9122
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
+ * ```
9123
11289
  *
9124
11290
  * @param params - Parameters for request
9125
11291
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.