@googleapis/vision 1.5.4 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/v1p2beta1.ts CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  Compute,
24
24
  UserRefreshClient,
25
25
  BaseExternalAccountClient,
26
- GaxiosPromise,
26
+ GaxiosResponseWithHTTP2,
27
27
  GoogleConfigurable,
28
28
  createAPIRequest,
29
29
  MethodOptions,
@@ -5020,6 +5020,62 @@ export namespace vision_v1p2beta1 {
5020
5020
 
5021
5021
  /**
5022
5022
  * 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.
5023
+ * @example
5024
+ * ```js
5025
+ * // Before running the sample:
5026
+ * // - Enable the API at:
5027
+ * // https://console.developers.google.com/apis/api/vision.googleapis.com
5028
+ * // - Login into gcloud by running:
5029
+ * // ```sh
5030
+ * // $ gcloud auth application-default login
5031
+ * // ```
5032
+ * // - Install the npm module by running:
5033
+ * // ```sh
5034
+ * // $ npm install googleapis
5035
+ * // ```
5036
+ *
5037
+ * const {google} = require('googleapis');
5038
+ * const vision = google.vision('v1p2beta1');
5039
+ *
5040
+ * async function main() {
5041
+ * const auth = new google.auth.GoogleAuth({
5042
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5043
+ * scopes: [
5044
+ * 'https://www.googleapis.com/auth/cloud-platform',
5045
+ * 'https://www.googleapis.com/auth/cloud-vision',
5046
+ * ],
5047
+ * });
5048
+ *
5049
+ * // Acquire an auth client, and bind it to all future calls
5050
+ * const authClient = await auth.getClient();
5051
+ * google.options({auth: authClient});
5052
+ *
5053
+ * // Do the magic
5054
+ * const res = await vision.files.annotate({
5055
+ * // Request body metadata
5056
+ * requestBody: {
5057
+ * // request body parameters
5058
+ * // {
5059
+ * // "labels": {},
5060
+ * // "parent": "my_parent",
5061
+ * // "requests": []
5062
+ * // }
5063
+ * },
5064
+ * });
5065
+ * console.log(res.data);
5066
+ *
5067
+ * // Example response
5068
+ * // {
5069
+ * // "responses": []
5070
+ * // }
5071
+ * }
5072
+ *
5073
+ * main().catch(e => {
5074
+ * console.error(e);
5075
+ * throw e;
5076
+ * });
5077
+ *
5078
+ * ```
5023
5079
  *
5024
5080
  * @param params - Parameters for request
5025
5081
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5029,11 +5085,13 @@ export namespace vision_v1p2beta1 {
5029
5085
  annotate(
5030
5086
  params: Params$Resource$Files$Annotate,
5031
5087
  options: StreamMethodOptions
5032
- ): GaxiosPromise<Readable>;
5088
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5033
5089
  annotate(
5034
5090
  params?: Params$Resource$Files$Annotate,
5035
5091
  options?: MethodOptions
5036
- ): GaxiosPromise<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>;
5092
+ ): Promise<
5093
+ GaxiosResponseWithHTTP2<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>
5094
+ >;
5037
5095
  annotate(
5038
5096
  params: Params$Resource$Files$Annotate,
5039
5097
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5068,8 +5126,10 @@ export namespace vision_v1p2beta1 {
5068
5126
  | BodyResponseCallback<Readable>
5069
5127
  ):
5070
5128
  | void
5071
- | GaxiosPromise<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>
5072
- | GaxiosPromise<Readable> {
5129
+ | Promise<
5130
+ GaxiosResponseWithHTTP2<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>
5131
+ >
5132
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5073
5133
  let params = (paramsOrCallback || {}) as Params$Resource$Files$Annotate;
5074
5134
  let options = (optionsOrCallback || {}) as MethodOptions;
5075
5135
 
@@ -5116,6 +5176,66 @@ export namespace vision_v1p2beta1 {
5116
5176
 
5117
5177
  /**
5118
5178
  * 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).
5179
+ * @example
5180
+ * ```js
5181
+ * // Before running the sample:
5182
+ * // - Enable the API at:
5183
+ * // https://console.developers.google.com/apis/api/vision.googleapis.com
5184
+ * // - Login into gcloud by running:
5185
+ * // ```sh
5186
+ * // $ gcloud auth application-default login
5187
+ * // ```
5188
+ * // - Install the npm module by running:
5189
+ * // ```sh
5190
+ * // $ npm install googleapis
5191
+ * // ```
5192
+ *
5193
+ * const {google} = require('googleapis');
5194
+ * const vision = google.vision('v1p2beta1');
5195
+ *
5196
+ * async function main() {
5197
+ * const auth = new google.auth.GoogleAuth({
5198
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5199
+ * scopes: [
5200
+ * 'https://www.googleapis.com/auth/cloud-platform',
5201
+ * 'https://www.googleapis.com/auth/cloud-vision',
5202
+ * ],
5203
+ * });
5204
+ *
5205
+ * // Acquire an auth client, and bind it to all future calls
5206
+ * const authClient = await auth.getClient();
5207
+ * google.options({auth: authClient});
5208
+ *
5209
+ * // Do the magic
5210
+ * const res = await vision.files.asyncBatchAnnotate({
5211
+ * // Request body metadata
5212
+ * requestBody: {
5213
+ * // request body parameters
5214
+ * // {
5215
+ * // "labels": {},
5216
+ * // "parent": "my_parent",
5217
+ * // "requests": []
5218
+ * // }
5219
+ * },
5220
+ * });
5221
+ * console.log(res.data);
5222
+ *
5223
+ * // Example response
5224
+ * // {
5225
+ * // "done": false,
5226
+ * // "error": {},
5227
+ * // "metadata": {},
5228
+ * // "name": "my_name",
5229
+ * // "response": {}
5230
+ * // }
5231
+ * }
5232
+ *
5233
+ * main().catch(e => {
5234
+ * console.error(e);
5235
+ * throw e;
5236
+ * });
5237
+ *
5238
+ * ```
5119
5239
  *
5120
5240
  * @param params - Parameters for request
5121
5241
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5125,11 +5245,11 @@ export namespace vision_v1p2beta1 {
5125
5245
  asyncBatchAnnotate(
5126
5246
  params: Params$Resource$Files$Asyncbatchannotate,
5127
5247
  options: StreamMethodOptions
5128
- ): GaxiosPromise<Readable>;
5248
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5129
5249
  asyncBatchAnnotate(
5130
5250
  params?: Params$Resource$Files$Asyncbatchannotate,
5131
5251
  options?: MethodOptions
5132
- ): GaxiosPromise<Schema$Operation>;
5252
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
5133
5253
  asyncBatchAnnotate(
5134
5254
  params: Params$Resource$Files$Asyncbatchannotate,
5135
5255
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5158,7 +5278,10 @@ export namespace vision_v1p2beta1 {
5158
5278
  callback?:
5159
5279
  | BodyResponseCallback<Schema$Operation>
5160
5280
  | BodyResponseCallback<Readable>
5161
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
5281
+ ):
5282
+ | void
5283
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
5284
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5162
5285
  let params = (paramsOrCallback ||
5163
5286
  {}) as Params$Resource$Files$Asyncbatchannotate;
5164
5287
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5225,6 +5348,62 @@ export namespace vision_v1p2beta1 {
5225
5348
 
5226
5349
  /**
5227
5350
  * Run image detection and annotation for a batch of images.
5351
+ * @example
5352
+ * ```js
5353
+ * // Before running the sample:
5354
+ * // - Enable the API at:
5355
+ * // https://console.developers.google.com/apis/api/vision.googleapis.com
5356
+ * // - Login into gcloud by running:
5357
+ * // ```sh
5358
+ * // $ gcloud auth application-default login
5359
+ * // ```
5360
+ * // - Install the npm module by running:
5361
+ * // ```sh
5362
+ * // $ npm install googleapis
5363
+ * // ```
5364
+ *
5365
+ * const {google} = require('googleapis');
5366
+ * const vision = google.vision('v1p2beta1');
5367
+ *
5368
+ * async function main() {
5369
+ * const auth = new google.auth.GoogleAuth({
5370
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5371
+ * scopes: [
5372
+ * 'https://www.googleapis.com/auth/cloud-platform',
5373
+ * 'https://www.googleapis.com/auth/cloud-vision',
5374
+ * ],
5375
+ * });
5376
+ *
5377
+ * // Acquire an auth client, and bind it to all future calls
5378
+ * const authClient = await auth.getClient();
5379
+ * google.options({auth: authClient});
5380
+ *
5381
+ * // Do the magic
5382
+ * const res = await vision.images.annotate({
5383
+ * // Request body metadata
5384
+ * requestBody: {
5385
+ * // request body parameters
5386
+ * // {
5387
+ * // "labels": {},
5388
+ * // "parent": "my_parent",
5389
+ * // "requests": []
5390
+ * // }
5391
+ * },
5392
+ * });
5393
+ * console.log(res.data);
5394
+ *
5395
+ * // Example response
5396
+ * // {
5397
+ * // "responses": []
5398
+ * // }
5399
+ * }
5400
+ *
5401
+ * main().catch(e => {
5402
+ * console.error(e);
5403
+ * throw e;
5404
+ * });
5405
+ *
5406
+ * ```
5228
5407
  *
5229
5408
  * @param params - Parameters for request
5230
5409
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5234,11 +5413,13 @@ export namespace vision_v1p2beta1 {
5234
5413
  annotate(
5235
5414
  params: Params$Resource$Images$Annotate,
5236
5415
  options: StreamMethodOptions
5237
- ): GaxiosPromise<Readable>;
5416
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5238
5417
  annotate(
5239
5418
  params?: Params$Resource$Images$Annotate,
5240
5419
  options?: MethodOptions
5241
- ): GaxiosPromise<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>;
5420
+ ): Promise<
5421
+ GaxiosResponseWithHTTP2<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>
5422
+ >;
5242
5423
  annotate(
5243
5424
  params: Params$Resource$Images$Annotate,
5244
5425
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5273,8 +5454,10 @@ export namespace vision_v1p2beta1 {
5273
5454
  | BodyResponseCallback<Readable>
5274
5455
  ):
5275
5456
  | void
5276
- | GaxiosPromise<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>
5277
- | GaxiosPromise<Readable> {
5457
+ | Promise<
5458
+ GaxiosResponseWithHTTP2<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>
5459
+ >
5460
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5278
5461
  let params = (paramsOrCallback || {}) as Params$Resource$Images$Annotate;
5279
5462
  let options = (optionsOrCallback || {}) as MethodOptions;
5280
5463
 
@@ -5321,6 +5504,67 @@ export namespace vision_v1p2beta1 {
5321
5504
 
5322
5505
  /**
5323
5506
  * 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.
5507
+ * @example
5508
+ * ```js
5509
+ * // Before running the sample:
5510
+ * // - Enable the API at:
5511
+ * // https://console.developers.google.com/apis/api/vision.googleapis.com
5512
+ * // - Login into gcloud by running:
5513
+ * // ```sh
5514
+ * // $ gcloud auth application-default login
5515
+ * // ```
5516
+ * // - Install the npm module by running:
5517
+ * // ```sh
5518
+ * // $ npm install googleapis
5519
+ * // ```
5520
+ *
5521
+ * const {google} = require('googleapis');
5522
+ * const vision = google.vision('v1p2beta1');
5523
+ *
5524
+ * async function main() {
5525
+ * const auth = new google.auth.GoogleAuth({
5526
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5527
+ * scopes: [
5528
+ * 'https://www.googleapis.com/auth/cloud-platform',
5529
+ * 'https://www.googleapis.com/auth/cloud-vision',
5530
+ * ],
5531
+ * });
5532
+ *
5533
+ * // Acquire an auth client, and bind it to all future calls
5534
+ * const authClient = await auth.getClient();
5535
+ * google.options({auth: authClient});
5536
+ *
5537
+ * // Do the magic
5538
+ * const res = await vision.images.asyncBatchAnnotate({
5539
+ * // Request body metadata
5540
+ * requestBody: {
5541
+ * // request body parameters
5542
+ * // {
5543
+ * // "labels": {},
5544
+ * // "outputConfig": {},
5545
+ * // "parent": "my_parent",
5546
+ * // "requests": []
5547
+ * // }
5548
+ * },
5549
+ * });
5550
+ * console.log(res.data);
5551
+ *
5552
+ * // Example response
5553
+ * // {
5554
+ * // "done": false,
5555
+ * // "error": {},
5556
+ * // "metadata": {},
5557
+ * // "name": "my_name",
5558
+ * // "response": {}
5559
+ * // }
5560
+ * }
5561
+ *
5562
+ * main().catch(e => {
5563
+ * console.error(e);
5564
+ * throw e;
5565
+ * });
5566
+ *
5567
+ * ```
5324
5568
  *
5325
5569
  * @param params - Parameters for request
5326
5570
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5330,11 +5574,11 @@ export namespace vision_v1p2beta1 {
5330
5574
  asyncBatchAnnotate(
5331
5575
  params: Params$Resource$Images$Asyncbatchannotate,
5332
5576
  options: StreamMethodOptions
5333
- ): GaxiosPromise<Readable>;
5577
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5334
5578
  asyncBatchAnnotate(
5335
5579
  params?: Params$Resource$Images$Asyncbatchannotate,
5336
5580
  options?: MethodOptions
5337
- ): GaxiosPromise<Schema$Operation>;
5581
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
5338
5582
  asyncBatchAnnotate(
5339
5583
  params: Params$Resource$Images$Asyncbatchannotate,
5340
5584
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5363,7 +5607,10 @@ export namespace vision_v1p2beta1 {
5363
5607
  callback?:
5364
5608
  | BodyResponseCallback<Schema$Operation>
5365
5609
  | BodyResponseCallback<Readable>
5366
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
5610
+ ):
5611
+ | void
5612
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
5613
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5367
5614
  let params = (paramsOrCallback ||
5368
5615
  {}) as Params$Resource$Images$Asyncbatchannotate;
5369
5616
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5443,6 +5690,65 @@ export namespace vision_v1p2beta1 {
5443
5690
 
5444
5691
  /**
5445
5692
  * 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.
5693
+ * @example
5694
+ * ```js
5695
+ * // Before running the sample:
5696
+ * // - Enable the API at:
5697
+ * // https://console.developers.google.com/apis/api/vision.googleapis.com
5698
+ * // - Login into gcloud by running:
5699
+ * // ```sh
5700
+ * // $ gcloud auth application-default login
5701
+ * // ```
5702
+ * // - Install the npm module by running:
5703
+ * // ```sh
5704
+ * // $ npm install googleapis
5705
+ * // ```
5706
+ *
5707
+ * const {google} = require('googleapis');
5708
+ * const vision = google.vision('v1p2beta1');
5709
+ *
5710
+ * async function main() {
5711
+ * const auth = new google.auth.GoogleAuth({
5712
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5713
+ * scopes: [
5714
+ * 'https://www.googleapis.com/auth/cloud-platform',
5715
+ * 'https://www.googleapis.com/auth/cloud-vision',
5716
+ * ],
5717
+ * });
5718
+ *
5719
+ * // Acquire an auth client, and bind it to all future calls
5720
+ * const authClient = await auth.getClient();
5721
+ * google.options({auth: authClient});
5722
+ *
5723
+ * // Do the magic
5724
+ * const res = await vision.projects.files.annotate({
5725
+ * // 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`.
5726
+ * parent: 'projects/my-project',
5727
+ *
5728
+ * // Request body metadata
5729
+ * requestBody: {
5730
+ * // request body parameters
5731
+ * // {
5732
+ * // "labels": {},
5733
+ * // "parent": "my_parent",
5734
+ * // "requests": []
5735
+ * // }
5736
+ * },
5737
+ * });
5738
+ * console.log(res.data);
5739
+ *
5740
+ * // Example response
5741
+ * // {
5742
+ * // "responses": []
5743
+ * // }
5744
+ * }
5745
+ *
5746
+ * main().catch(e => {
5747
+ * console.error(e);
5748
+ * throw e;
5749
+ * });
5750
+ *
5751
+ * ```
5446
5752
  *
5447
5753
  * @param params - Parameters for request
5448
5754
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5452,11 +5758,13 @@ export namespace vision_v1p2beta1 {
5452
5758
  annotate(
5453
5759
  params: Params$Resource$Projects$Files$Annotate,
5454
5760
  options: StreamMethodOptions
5455
- ): GaxiosPromise<Readable>;
5761
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5456
5762
  annotate(
5457
5763
  params?: Params$Resource$Projects$Files$Annotate,
5458
5764
  options?: MethodOptions
5459
- ): GaxiosPromise<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>;
5765
+ ): Promise<
5766
+ GaxiosResponseWithHTTP2<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>
5767
+ >;
5460
5768
  annotate(
5461
5769
  params: Params$Resource$Projects$Files$Annotate,
5462
5770
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5491,8 +5799,10 @@ export namespace vision_v1p2beta1 {
5491
5799
  | BodyResponseCallback<Readable>
5492
5800
  ):
5493
5801
  | void
5494
- | GaxiosPromise<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>
5495
- | GaxiosPromise<Readable> {
5802
+ | Promise<
5803
+ GaxiosResponseWithHTTP2<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>
5804
+ >
5805
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5496
5806
  let params = (paramsOrCallback ||
5497
5807
  {}) as Params$Resource$Projects$Files$Annotate;
5498
5808
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5540,6 +5850,69 @@ export namespace vision_v1p2beta1 {
5540
5850
 
5541
5851
  /**
5542
5852
  * 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).
5853
+ * @example
5854
+ * ```js
5855
+ * // Before running the sample:
5856
+ * // - Enable the API at:
5857
+ * // https://console.developers.google.com/apis/api/vision.googleapis.com
5858
+ * // - Login into gcloud by running:
5859
+ * // ```sh
5860
+ * // $ gcloud auth application-default login
5861
+ * // ```
5862
+ * // - Install the npm module by running:
5863
+ * // ```sh
5864
+ * // $ npm install googleapis
5865
+ * // ```
5866
+ *
5867
+ * const {google} = require('googleapis');
5868
+ * const vision = google.vision('v1p2beta1');
5869
+ *
5870
+ * async function main() {
5871
+ * const auth = new google.auth.GoogleAuth({
5872
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5873
+ * scopes: [
5874
+ * 'https://www.googleapis.com/auth/cloud-platform',
5875
+ * 'https://www.googleapis.com/auth/cloud-vision',
5876
+ * ],
5877
+ * });
5878
+ *
5879
+ * // Acquire an auth client, and bind it to all future calls
5880
+ * const authClient = await auth.getClient();
5881
+ * google.options({auth: authClient});
5882
+ *
5883
+ * // Do the magic
5884
+ * const res = await vision.projects.files.asyncBatchAnnotate({
5885
+ * // 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`.
5886
+ * parent: 'projects/my-project',
5887
+ *
5888
+ * // Request body metadata
5889
+ * requestBody: {
5890
+ * // request body parameters
5891
+ * // {
5892
+ * // "labels": {},
5893
+ * // "parent": "my_parent",
5894
+ * // "requests": []
5895
+ * // }
5896
+ * },
5897
+ * });
5898
+ * console.log(res.data);
5899
+ *
5900
+ * // Example response
5901
+ * // {
5902
+ * // "done": false,
5903
+ * // "error": {},
5904
+ * // "metadata": {},
5905
+ * // "name": "my_name",
5906
+ * // "response": {}
5907
+ * // }
5908
+ * }
5909
+ *
5910
+ * main().catch(e => {
5911
+ * console.error(e);
5912
+ * throw e;
5913
+ * });
5914
+ *
5915
+ * ```
5543
5916
  *
5544
5917
  * @param params - Parameters for request
5545
5918
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5549,11 +5922,11 @@ export namespace vision_v1p2beta1 {
5549
5922
  asyncBatchAnnotate(
5550
5923
  params: Params$Resource$Projects$Files$Asyncbatchannotate,
5551
5924
  options: StreamMethodOptions
5552
- ): GaxiosPromise<Readable>;
5925
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5553
5926
  asyncBatchAnnotate(
5554
5927
  params?: Params$Resource$Projects$Files$Asyncbatchannotate,
5555
5928
  options?: MethodOptions
5556
- ): GaxiosPromise<Schema$Operation>;
5929
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
5557
5930
  asyncBatchAnnotate(
5558
5931
  params: Params$Resource$Projects$Files$Asyncbatchannotate,
5559
5932
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5582,7 +5955,10 @@ export namespace vision_v1p2beta1 {
5582
5955
  callback?:
5583
5956
  | BodyResponseCallback<Schema$Operation>
5584
5957
  | BodyResponseCallback<Readable>
5585
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
5958
+ ):
5959
+ | void
5960
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
5961
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5586
5962
  let params = (paramsOrCallback ||
5587
5963
  {}) as Params$Resource$Projects$Files$Asyncbatchannotate;
5588
5964
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5659,6 +6035,65 @@ export namespace vision_v1p2beta1 {
5659
6035
 
5660
6036
  /**
5661
6037
  * Run image detection and annotation for a batch of images.
6038
+ * @example
6039
+ * ```js
6040
+ * // Before running the sample:
6041
+ * // - Enable the API at:
6042
+ * // https://console.developers.google.com/apis/api/vision.googleapis.com
6043
+ * // - Login into gcloud by running:
6044
+ * // ```sh
6045
+ * // $ gcloud auth application-default login
6046
+ * // ```
6047
+ * // - Install the npm module by running:
6048
+ * // ```sh
6049
+ * // $ npm install googleapis
6050
+ * // ```
6051
+ *
6052
+ * const {google} = require('googleapis');
6053
+ * const vision = google.vision('v1p2beta1');
6054
+ *
6055
+ * async function main() {
6056
+ * const auth = new google.auth.GoogleAuth({
6057
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6058
+ * scopes: [
6059
+ * 'https://www.googleapis.com/auth/cloud-platform',
6060
+ * 'https://www.googleapis.com/auth/cloud-vision',
6061
+ * ],
6062
+ * });
6063
+ *
6064
+ * // Acquire an auth client, and bind it to all future calls
6065
+ * const authClient = await auth.getClient();
6066
+ * google.options({auth: authClient});
6067
+ *
6068
+ * // Do the magic
6069
+ * const res = await vision.projects.images.annotate({
6070
+ * // 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`.
6071
+ * parent: 'projects/my-project',
6072
+ *
6073
+ * // Request body metadata
6074
+ * requestBody: {
6075
+ * // request body parameters
6076
+ * // {
6077
+ * // "labels": {},
6078
+ * // "parent": "my_parent",
6079
+ * // "requests": []
6080
+ * // }
6081
+ * },
6082
+ * });
6083
+ * console.log(res.data);
6084
+ *
6085
+ * // Example response
6086
+ * // {
6087
+ * // "responses": []
6088
+ * // }
6089
+ * }
6090
+ *
6091
+ * main().catch(e => {
6092
+ * console.error(e);
6093
+ * throw e;
6094
+ * });
6095
+ *
6096
+ * ```
5662
6097
  *
5663
6098
  * @param params - Parameters for request
5664
6099
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5668,11 +6103,13 @@ export namespace vision_v1p2beta1 {
5668
6103
  annotate(
5669
6104
  params: Params$Resource$Projects$Images$Annotate,
5670
6105
  options: StreamMethodOptions
5671
- ): GaxiosPromise<Readable>;
6106
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5672
6107
  annotate(
5673
6108
  params?: Params$Resource$Projects$Images$Annotate,
5674
6109
  options?: MethodOptions
5675
- ): GaxiosPromise<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>;
6110
+ ): Promise<
6111
+ GaxiosResponseWithHTTP2<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>
6112
+ >;
5676
6113
  annotate(
5677
6114
  params: Params$Resource$Projects$Images$Annotate,
5678
6115
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5707,8 +6144,10 @@ export namespace vision_v1p2beta1 {
5707
6144
  | BodyResponseCallback<Readable>
5708
6145
  ):
5709
6146
  | void
5710
- | GaxiosPromise<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>
5711
- | GaxiosPromise<Readable> {
6147
+ | Promise<
6148
+ GaxiosResponseWithHTTP2<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>
6149
+ >
6150
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5712
6151
  let params = (paramsOrCallback ||
5713
6152
  {}) as Params$Resource$Projects$Images$Annotate;
5714
6153
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5756,6 +6195,70 @@ export namespace vision_v1p2beta1 {
5756
6195
 
5757
6196
  /**
5758
6197
  * 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.
6198
+ * @example
6199
+ * ```js
6200
+ * // Before running the sample:
6201
+ * // - Enable the API at:
6202
+ * // https://console.developers.google.com/apis/api/vision.googleapis.com
6203
+ * // - Login into gcloud by running:
6204
+ * // ```sh
6205
+ * // $ gcloud auth application-default login
6206
+ * // ```
6207
+ * // - Install the npm module by running:
6208
+ * // ```sh
6209
+ * // $ npm install googleapis
6210
+ * // ```
6211
+ *
6212
+ * const {google} = require('googleapis');
6213
+ * const vision = google.vision('v1p2beta1');
6214
+ *
6215
+ * async function main() {
6216
+ * const auth = new google.auth.GoogleAuth({
6217
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6218
+ * scopes: [
6219
+ * 'https://www.googleapis.com/auth/cloud-platform',
6220
+ * 'https://www.googleapis.com/auth/cloud-vision',
6221
+ * ],
6222
+ * });
6223
+ *
6224
+ * // Acquire an auth client, and bind it to all future calls
6225
+ * const authClient = await auth.getClient();
6226
+ * google.options({auth: authClient});
6227
+ *
6228
+ * // Do the magic
6229
+ * const res = await vision.projects.images.asyncBatchAnnotate({
6230
+ * // 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`.
6231
+ * parent: 'projects/my-project',
6232
+ *
6233
+ * // Request body metadata
6234
+ * requestBody: {
6235
+ * // request body parameters
6236
+ * // {
6237
+ * // "labels": {},
6238
+ * // "outputConfig": {},
6239
+ * // "parent": "my_parent",
6240
+ * // "requests": []
6241
+ * // }
6242
+ * },
6243
+ * });
6244
+ * console.log(res.data);
6245
+ *
6246
+ * // Example response
6247
+ * // {
6248
+ * // "done": false,
6249
+ * // "error": {},
6250
+ * // "metadata": {},
6251
+ * // "name": "my_name",
6252
+ * // "response": {}
6253
+ * // }
6254
+ * }
6255
+ *
6256
+ * main().catch(e => {
6257
+ * console.error(e);
6258
+ * throw e;
6259
+ * });
6260
+ *
6261
+ * ```
5759
6262
  *
5760
6263
  * @param params - Parameters for request
5761
6264
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5765,11 +6268,11 @@ export namespace vision_v1p2beta1 {
5765
6268
  asyncBatchAnnotate(
5766
6269
  params: Params$Resource$Projects$Images$Asyncbatchannotate,
5767
6270
  options: StreamMethodOptions
5768
- ): GaxiosPromise<Readable>;
6271
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5769
6272
  asyncBatchAnnotate(
5770
6273
  params?: Params$Resource$Projects$Images$Asyncbatchannotate,
5771
6274
  options?: MethodOptions
5772
- ): GaxiosPromise<Schema$Operation>;
6275
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
5773
6276
  asyncBatchAnnotate(
5774
6277
  params: Params$Resource$Projects$Images$Asyncbatchannotate,
5775
6278
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5798,7 +6301,10 @@ export namespace vision_v1p2beta1 {
5798
6301
  callback?:
5799
6302
  | BodyResponseCallback<Schema$Operation>
5800
6303
  | BodyResponseCallback<Readable>
5801
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
6304
+ ):
6305
+ | void
6306
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
6307
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5802
6308
  let params = (paramsOrCallback ||
5803
6309
  {}) as Params$Resource$Projects$Images$Asyncbatchannotate;
5804
6310
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5886,6 +6392,65 @@ export namespace vision_v1p2beta1 {
5886
6392
 
5887
6393
  /**
5888
6394
  * 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.
6395
+ * @example
6396
+ * ```js
6397
+ * // Before running the sample:
6398
+ * // - Enable the API at:
6399
+ * // https://console.developers.google.com/apis/api/vision.googleapis.com
6400
+ * // - Login into gcloud by running:
6401
+ * // ```sh
6402
+ * // $ gcloud auth application-default login
6403
+ * // ```
6404
+ * // - Install the npm module by running:
6405
+ * // ```sh
6406
+ * // $ npm install googleapis
6407
+ * // ```
6408
+ *
6409
+ * const {google} = require('googleapis');
6410
+ * const vision = google.vision('v1p2beta1');
6411
+ *
6412
+ * async function main() {
6413
+ * const auth = new google.auth.GoogleAuth({
6414
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6415
+ * scopes: [
6416
+ * 'https://www.googleapis.com/auth/cloud-platform',
6417
+ * 'https://www.googleapis.com/auth/cloud-vision',
6418
+ * ],
6419
+ * });
6420
+ *
6421
+ * // Acquire an auth client, and bind it to all future calls
6422
+ * const authClient = await auth.getClient();
6423
+ * google.options({auth: authClient});
6424
+ *
6425
+ * // Do the magic
6426
+ * const res = await vision.projects.locations.files.annotate({
6427
+ * // 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`.
6428
+ * parent: 'projects/my-project/locations/my-location',
6429
+ *
6430
+ * // Request body metadata
6431
+ * requestBody: {
6432
+ * // request body parameters
6433
+ * // {
6434
+ * // "labels": {},
6435
+ * // "parent": "my_parent",
6436
+ * // "requests": []
6437
+ * // }
6438
+ * },
6439
+ * });
6440
+ * console.log(res.data);
6441
+ *
6442
+ * // Example response
6443
+ * // {
6444
+ * // "responses": []
6445
+ * // }
6446
+ * }
6447
+ *
6448
+ * main().catch(e => {
6449
+ * console.error(e);
6450
+ * throw e;
6451
+ * });
6452
+ *
6453
+ * ```
5889
6454
  *
5890
6455
  * @param params - Parameters for request
5891
6456
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5895,11 +6460,13 @@ export namespace vision_v1p2beta1 {
5895
6460
  annotate(
5896
6461
  params: Params$Resource$Projects$Locations$Files$Annotate,
5897
6462
  options: StreamMethodOptions
5898
- ): GaxiosPromise<Readable>;
6463
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5899
6464
  annotate(
5900
6465
  params?: Params$Resource$Projects$Locations$Files$Annotate,
5901
6466
  options?: MethodOptions
5902
- ): GaxiosPromise<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>;
6467
+ ): Promise<
6468
+ GaxiosResponseWithHTTP2<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>
6469
+ >;
5903
6470
  annotate(
5904
6471
  params: Params$Resource$Projects$Locations$Files$Annotate,
5905
6472
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5934,8 +6501,10 @@ export namespace vision_v1p2beta1 {
5934
6501
  | BodyResponseCallback<Readable>
5935
6502
  ):
5936
6503
  | void
5937
- | GaxiosPromise<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>
5938
- | GaxiosPromise<Readable> {
6504
+ | Promise<
6505
+ GaxiosResponseWithHTTP2<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse>
6506
+ >
6507
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5939
6508
  let params = (paramsOrCallback ||
5940
6509
  {}) as Params$Resource$Projects$Locations$Files$Annotate;
5941
6510
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5983,6 +6552,69 @@ export namespace vision_v1p2beta1 {
5983
6552
 
5984
6553
  /**
5985
6554
  * 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).
6555
+ * @example
6556
+ * ```js
6557
+ * // Before running the sample:
6558
+ * // - Enable the API at:
6559
+ * // https://console.developers.google.com/apis/api/vision.googleapis.com
6560
+ * // - Login into gcloud by running:
6561
+ * // ```sh
6562
+ * // $ gcloud auth application-default login
6563
+ * // ```
6564
+ * // - Install the npm module by running:
6565
+ * // ```sh
6566
+ * // $ npm install googleapis
6567
+ * // ```
6568
+ *
6569
+ * const {google} = require('googleapis');
6570
+ * const vision = google.vision('v1p2beta1');
6571
+ *
6572
+ * async function main() {
6573
+ * const auth = new google.auth.GoogleAuth({
6574
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6575
+ * scopes: [
6576
+ * 'https://www.googleapis.com/auth/cloud-platform',
6577
+ * 'https://www.googleapis.com/auth/cloud-vision',
6578
+ * ],
6579
+ * });
6580
+ *
6581
+ * // Acquire an auth client, and bind it to all future calls
6582
+ * const authClient = await auth.getClient();
6583
+ * google.options({auth: authClient});
6584
+ *
6585
+ * // Do the magic
6586
+ * const res = await vision.projects.locations.files.asyncBatchAnnotate({
6587
+ * // 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`.
6588
+ * parent: 'projects/my-project/locations/my-location',
6589
+ *
6590
+ * // Request body metadata
6591
+ * requestBody: {
6592
+ * // request body parameters
6593
+ * // {
6594
+ * // "labels": {},
6595
+ * // "parent": "my_parent",
6596
+ * // "requests": []
6597
+ * // }
6598
+ * },
6599
+ * });
6600
+ * console.log(res.data);
6601
+ *
6602
+ * // Example response
6603
+ * // {
6604
+ * // "done": false,
6605
+ * // "error": {},
6606
+ * // "metadata": {},
6607
+ * // "name": "my_name",
6608
+ * // "response": {}
6609
+ * // }
6610
+ * }
6611
+ *
6612
+ * main().catch(e => {
6613
+ * console.error(e);
6614
+ * throw e;
6615
+ * });
6616
+ *
6617
+ * ```
5986
6618
  *
5987
6619
  * @param params - Parameters for request
5988
6620
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5992,11 +6624,11 @@ export namespace vision_v1p2beta1 {
5992
6624
  asyncBatchAnnotate(
5993
6625
  params: Params$Resource$Projects$Locations$Files$Asyncbatchannotate,
5994
6626
  options: StreamMethodOptions
5995
- ): GaxiosPromise<Readable>;
6627
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5996
6628
  asyncBatchAnnotate(
5997
6629
  params?: Params$Resource$Projects$Locations$Files$Asyncbatchannotate,
5998
6630
  options?: MethodOptions
5999
- ): GaxiosPromise<Schema$Operation>;
6631
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
6000
6632
  asyncBatchAnnotate(
6001
6633
  params: Params$Resource$Projects$Locations$Files$Asyncbatchannotate,
6002
6634
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -6025,7 +6657,10 @@ export namespace vision_v1p2beta1 {
6025
6657
  callback?:
6026
6658
  | BodyResponseCallback<Schema$Operation>
6027
6659
  | BodyResponseCallback<Readable>
6028
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
6660
+ ):
6661
+ | void
6662
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
6663
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
6029
6664
  let params = (paramsOrCallback ||
6030
6665
  {}) as Params$Resource$Projects$Locations$Files$Asyncbatchannotate;
6031
6666
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -6103,6 +6738,65 @@ export namespace vision_v1p2beta1 {
6103
6738
 
6104
6739
  /**
6105
6740
  * Run image detection and annotation for a batch of images.
6741
+ * @example
6742
+ * ```js
6743
+ * // Before running the sample:
6744
+ * // - Enable the API at:
6745
+ * // https://console.developers.google.com/apis/api/vision.googleapis.com
6746
+ * // - Login into gcloud by running:
6747
+ * // ```sh
6748
+ * // $ gcloud auth application-default login
6749
+ * // ```
6750
+ * // - Install the npm module by running:
6751
+ * // ```sh
6752
+ * // $ npm install googleapis
6753
+ * // ```
6754
+ *
6755
+ * const {google} = require('googleapis');
6756
+ * const vision = google.vision('v1p2beta1');
6757
+ *
6758
+ * async function main() {
6759
+ * const auth = new google.auth.GoogleAuth({
6760
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6761
+ * scopes: [
6762
+ * 'https://www.googleapis.com/auth/cloud-platform',
6763
+ * 'https://www.googleapis.com/auth/cloud-vision',
6764
+ * ],
6765
+ * });
6766
+ *
6767
+ * // Acquire an auth client, and bind it to all future calls
6768
+ * const authClient = await auth.getClient();
6769
+ * google.options({auth: authClient});
6770
+ *
6771
+ * // Do the magic
6772
+ * const res = await vision.projects.locations.images.annotate({
6773
+ * // 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`.
6774
+ * parent: 'projects/my-project/locations/my-location',
6775
+ *
6776
+ * // Request body metadata
6777
+ * requestBody: {
6778
+ * // request body parameters
6779
+ * // {
6780
+ * // "labels": {},
6781
+ * // "parent": "my_parent",
6782
+ * // "requests": []
6783
+ * // }
6784
+ * },
6785
+ * });
6786
+ * console.log(res.data);
6787
+ *
6788
+ * // Example response
6789
+ * // {
6790
+ * // "responses": []
6791
+ * // }
6792
+ * }
6793
+ *
6794
+ * main().catch(e => {
6795
+ * console.error(e);
6796
+ * throw e;
6797
+ * });
6798
+ *
6799
+ * ```
6106
6800
  *
6107
6801
  * @param params - Parameters for request
6108
6802
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6112,11 +6806,13 @@ export namespace vision_v1p2beta1 {
6112
6806
  annotate(
6113
6807
  params: Params$Resource$Projects$Locations$Images$Annotate,
6114
6808
  options: StreamMethodOptions
6115
- ): GaxiosPromise<Readable>;
6809
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
6116
6810
  annotate(
6117
6811
  params?: Params$Resource$Projects$Locations$Images$Annotate,
6118
6812
  options?: MethodOptions
6119
- ): GaxiosPromise<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>;
6813
+ ): Promise<
6814
+ GaxiosResponseWithHTTP2<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>
6815
+ >;
6120
6816
  annotate(
6121
6817
  params: Params$Resource$Projects$Locations$Images$Annotate,
6122
6818
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -6151,8 +6847,10 @@ export namespace vision_v1p2beta1 {
6151
6847
  | BodyResponseCallback<Readable>
6152
6848
  ):
6153
6849
  | void
6154
- | GaxiosPromise<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>
6155
- | GaxiosPromise<Readable> {
6850
+ | Promise<
6851
+ GaxiosResponseWithHTTP2<Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>
6852
+ >
6853
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
6156
6854
  let params = (paramsOrCallback ||
6157
6855
  {}) as Params$Resource$Projects$Locations$Images$Annotate;
6158
6856
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -6200,6 +6898,70 @@ export namespace vision_v1p2beta1 {
6200
6898
 
6201
6899
  /**
6202
6900
  * 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.
6901
+ * @example
6902
+ * ```js
6903
+ * // Before running the sample:
6904
+ * // - Enable the API at:
6905
+ * // https://console.developers.google.com/apis/api/vision.googleapis.com
6906
+ * // - Login into gcloud by running:
6907
+ * // ```sh
6908
+ * // $ gcloud auth application-default login
6909
+ * // ```
6910
+ * // - Install the npm module by running:
6911
+ * // ```sh
6912
+ * // $ npm install googleapis
6913
+ * // ```
6914
+ *
6915
+ * const {google} = require('googleapis');
6916
+ * const vision = google.vision('v1p2beta1');
6917
+ *
6918
+ * async function main() {
6919
+ * const auth = new google.auth.GoogleAuth({
6920
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6921
+ * scopes: [
6922
+ * 'https://www.googleapis.com/auth/cloud-platform',
6923
+ * 'https://www.googleapis.com/auth/cloud-vision',
6924
+ * ],
6925
+ * });
6926
+ *
6927
+ * // Acquire an auth client, and bind it to all future calls
6928
+ * const authClient = await auth.getClient();
6929
+ * google.options({auth: authClient});
6930
+ *
6931
+ * // Do the magic
6932
+ * const res = await vision.projects.locations.images.asyncBatchAnnotate({
6933
+ * // 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`.
6934
+ * parent: 'projects/my-project/locations/my-location',
6935
+ *
6936
+ * // Request body metadata
6937
+ * requestBody: {
6938
+ * // request body parameters
6939
+ * // {
6940
+ * // "labels": {},
6941
+ * // "outputConfig": {},
6942
+ * // "parent": "my_parent",
6943
+ * // "requests": []
6944
+ * // }
6945
+ * },
6946
+ * });
6947
+ * console.log(res.data);
6948
+ *
6949
+ * // Example response
6950
+ * // {
6951
+ * // "done": false,
6952
+ * // "error": {},
6953
+ * // "metadata": {},
6954
+ * // "name": "my_name",
6955
+ * // "response": {}
6956
+ * // }
6957
+ * }
6958
+ *
6959
+ * main().catch(e => {
6960
+ * console.error(e);
6961
+ * throw e;
6962
+ * });
6963
+ *
6964
+ * ```
6203
6965
  *
6204
6966
  * @param params - Parameters for request
6205
6967
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6209,11 +6971,11 @@ export namespace vision_v1p2beta1 {
6209
6971
  asyncBatchAnnotate(
6210
6972
  params: Params$Resource$Projects$Locations$Images$Asyncbatchannotate,
6211
6973
  options: StreamMethodOptions
6212
- ): GaxiosPromise<Readable>;
6974
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
6213
6975
  asyncBatchAnnotate(
6214
6976
  params?: Params$Resource$Projects$Locations$Images$Asyncbatchannotate,
6215
6977
  options?: MethodOptions
6216
- ): GaxiosPromise<Schema$Operation>;
6978
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
6217
6979
  asyncBatchAnnotate(
6218
6980
  params: Params$Resource$Projects$Locations$Images$Asyncbatchannotate,
6219
6981
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -6242,7 +7004,10 @@ export namespace vision_v1p2beta1 {
6242
7004
  callback?:
6243
7005
  | BodyResponseCallback<Schema$Operation>
6244
7006
  | BodyResponseCallback<Readable>
6245
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
7007
+ ):
7008
+ | void
7009
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
7010
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
6246
7011
  let params = (paramsOrCallback ||
6247
7012
  {}) as Params$Resource$Projects$Locations$Images$Asyncbatchannotate;
6248
7013
  let options = (optionsOrCallback || {}) as MethodOptions;