@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/v1p2beta1.ts CHANGED
@@ -1862,7 +1862,7 @@ export namespace vision_v1p2beta1 {
1862
1862
  */
1863
1863
  maxResults?: number | null;
1864
1864
  /**
1865
- * 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.
1865
+ * 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.
1866
1866
  */
1867
1867
  model?: string | null;
1868
1868
  /**
@@ -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`.
@@ -5120,6 +5176,66 @@ export namespace vision_v1p2beta1 {
5120
5176
 
5121
5177
  /**
5122
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
+ * ```
5123
5239
  *
5124
5240
  * @param params - Parameters for request
5125
5241
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5232,6 +5348,62 @@ export namespace vision_v1p2beta1 {
5232
5348
 
5233
5349
  /**
5234
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
+ * ```
5235
5407
  *
5236
5408
  * @param params - Parameters for request
5237
5409
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5332,6 +5504,67 @@ export namespace vision_v1p2beta1 {
5332
5504
 
5333
5505
  /**
5334
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
+ * ```
5335
5568
  *
5336
5569
  * @param params - Parameters for request
5337
5570
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5457,6 +5690,65 @@ export namespace vision_v1p2beta1 {
5457
5690
 
5458
5691
  /**
5459
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
+ * ```
5460
5752
  *
5461
5753
  * @param params - Parameters for request
5462
5754
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5558,6 +5850,69 @@ export namespace vision_v1p2beta1 {
5558
5850
 
5559
5851
  /**
5560
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
+ * ```
5561
5916
  *
5562
5917
  * @param params - Parameters for request
5563
5918
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5680,6 +6035,65 @@ export namespace vision_v1p2beta1 {
5680
6035
 
5681
6036
  /**
5682
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
+ * ```
5683
6097
  *
5684
6098
  * @param params - Parameters for request
5685
6099
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5781,6 +6195,70 @@ export namespace vision_v1p2beta1 {
5781
6195
 
5782
6196
  /**
5783
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
+ * ```
5784
6262
  *
5785
6263
  * @param params - Parameters for request
5786
6264
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5914,6 +6392,65 @@ export namespace vision_v1p2beta1 {
5914
6392
 
5915
6393
  /**
5916
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
+ * ```
5917
6454
  *
5918
6455
  * @param params - Parameters for request
5919
6456
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6015,6 +6552,69 @@ export namespace vision_v1p2beta1 {
6015
6552
 
6016
6553
  /**
6017
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
+ * ```
6018
6618
  *
6019
6619
  * @param params - Parameters for request
6020
6620
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6138,6 +6738,65 @@ export namespace vision_v1p2beta1 {
6138
6738
 
6139
6739
  /**
6140
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
+ * ```
6141
6800
  *
6142
6801
  * @param params - Parameters for request
6143
6802
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6239,6 +6898,70 @@ export namespace vision_v1p2beta1 {
6239
6898
 
6240
6899
  /**
6241
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
+ * ```
6242
6965
  *
6243
6966
  * @param params - Parameters for request
6244
6967
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.