@googleapis/vision 2.0.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/build/v1.d.ts +2166 -0
- package/build/v1.js.map +1 -1
- package/build/v1p1beta1.d.ts +723 -0
- package/build/v1p1beta1.js.map +1 -1
- package/build/v1p2beta1.d.ts +723 -0
- package/build/v1p2beta1.js.map +1 -1
- package/package.json +1 -1
- package/v1.ts +2166 -0
- package/v1p1beta1.ts +723 -0
- package/v1p2beta1.ts +723 -0
package/build/v1p1beta1.d.ts
CHANGED
|
@@ -4975,6 +4975,62 @@ export declare namespace vision_v1p1beta1 {
|
|
|
4975
4975
|
constructor(context: APIRequestContext);
|
|
4976
4976
|
/**
|
|
4977
4977
|
* 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.
|
|
4978
|
+
* @example
|
|
4979
|
+
* ```js
|
|
4980
|
+
* // Before running the sample:
|
|
4981
|
+
* // - Enable the API at:
|
|
4982
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
4983
|
+
* // - Login into gcloud by running:
|
|
4984
|
+
* // ```sh
|
|
4985
|
+
* // $ gcloud auth application-default login
|
|
4986
|
+
* // ```
|
|
4987
|
+
* // - Install the npm module by running:
|
|
4988
|
+
* // ```sh
|
|
4989
|
+
* // $ npm install googleapis
|
|
4990
|
+
* // ```
|
|
4991
|
+
*
|
|
4992
|
+
* const {google} = require('googleapis');
|
|
4993
|
+
* const vision = google.vision('v1p1beta1');
|
|
4994
|
+
*
|
|
4995
|
+
* async function main() {
|
|
4996
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4997
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4998
|
+
* scopes: [
|
|
4999
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5000
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5001
|
+
* ],
|
|
5002
|
+
* });
|
|
5003
|
+
*
|
|
5004
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5005
|
+
* const authClient = await auth.getClient();
|
|
5006
|
+
* google.options({auth: authClient});
|
|
5007
|
+
*
|
|
5008
|
+
* // Do the magic
|
|
5009
|
+
* const res = await vision.files.annotate({
|
|
5010
|
+
* // Request body metadata
|
|
5011
|
+
* requestBody: {
|
|
5012
|
+
* // request body parameters
|
|
5013
|
+
* // {
|
|
5014
|
+
* // "labels": {},
|
|
5015
|
+
* // "parent": "my_parent",
|
|
5016
|
+
* // "requests": []
|
|
5017
|
+
* // }
|
|
5018
|
+
* },
|
|
5019
|
+
* });
|
|
5020
|
+
* console.log(res.data);
|
|
5021
|
+
*
|
|
5022
|
+
* // Example response
|
|
5023
|
+
* // {
|
|
5024
|
+
* // "responses": []
|
|
5025
|
+
* // }
|
|
5026
|
+
* }
|
|
5027
|
+
*
|
|
5028
|
+
* main().catch(e => {
|
|
5029
|
+
* console.error(e);
|
|
5030
|
+
* throw e;
|
|
5031
|
+
* });
|
|
5032
|
+
*
|
|
5033
|
+
* ```
|
|
4978
5034
|
*
|
|
4979
5035
|
* @param params - Parameters for request
|
|
4980
5036
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -4989,6 +5045,66 @@ export declare namespace vision_v1p1beta1 {
|
|
|
4989
5045
|
annotate(callback: BodyResponseCallback<Schema$GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse>): void;
|
|
4990
5046
|
/**
|
|
4991
5047
|
* 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).
|
|
5048
|
+
* @example
|
|
5049
|
+
* ```js
|
|
5050
|
+
* // Before running the sample:
|
|
5051
|
+
* // - Enable the API at:
|
|
5052
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5053
|
+
* // - Login into gcloud by running:
|
|
5054
|
+
* // ```sh
|
|
5055
|
+
* // $ gcloud auth application-default login
|
|
5056
|
+
* // ```
|
|
5057
|
+
* // - Install the npm module by running:
|
|
5058
|
+
* // ```sh
|
|
5059
|
+
* // $ npm install googleapis
|
|
5060
|
+
* // ```
|
|
5061
|
+
*
|
|
5062
|
+
* const {google} = require('googleapis');
|
|
5063
|
+
* const vision = google.vision('v1p1beta1');
|
|
5064
|
+
*
|
|
5065
|
+
* async function main() {
|
|
5066
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5067
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5068
|
+
* scopes: [
|
|
5069
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5070
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5071
|
+
* ],
|
|
5072
|
+
* });
|
|
5073
|
+
*
|
|
5074
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5075
|
+
* const authClient = await auth.getClient();
|
|
5076
|
+
* google.options({auth: authClient});
|
|
5077
|
+
*
|
|
5078
|
+
* // Do the magic
|
|
5079
|
+
* const res = await vision.files.asyncBatchAnnotate({
|
|
5080
|
+
* // Request body metadata
|
|
5081
|
+
* requestBody: {
|
|
5082
|
+
* // request body parameters
|
|
5083
|
+
* // {
|
|
5084
|
+
* // "labels": {},
|
|
5085
|
+
* // "parent": "my_parent",
|
|
5086
|
+
* // "requests": []
|
|
5087
|
+
* // }
|
|
5088
|
+
* },
|
|
5089
|
+
* });
|
|
5090
|
+
* console.log(res.data);
|
|
5091
|
+
*
|
|
5092
|
+
* // Example response
|
|
5093
|
+
* // {
|
|
5094
|
+
* // "done": false,
|
|
5095
|
+
* // "error": {},
|
|
5096
|
+
* // "metadata": {},
|
|
5097
|
+
* // "name": "my_name",
|
|
5098
|
+
* // "response": {}
|
|
5099
|
+
* // }
|
|
5100
|
+
* }
|
|
5101
|
+
*
|
|
5102
|
+
* main().catch(e => {
|
|
5103
|
+
* console.error(e);
|
|
5104
|
+
* throw e;
|
|
5105
|
+
* });
|
|
5106
|
+
*
|
|
5107
|
+
* ```
|
|
4992
5108
|
*
|
|
4993
5109
|
* @param params - Parameters for request
|
|
4994
5110
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5019,6 +5135,62 @@ export declare namespace vision_v1p1beta1 {
|
|
|
5019
5135
|
constructor(context: APIRequestContext);
|
|
5020
5136
|
/**
|
|
5021
5137
|
* Run image detection and annotation for a batch of images.
|
|
5138
|
+
* @example
|
|
5139
|
+
* ```js
|
|
5140
|
+
* // Before running the sample:
|
|
5141
|
+
* // - Enable the API at:
|
|
5142
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5143
|
+
* // - Login into gcloud by running:
|
|
5144
|
+
* // ```sh
|
|
5145
|
+
* // $ gcloud auth application-default login
|
|
5146
|
+
* // ```
|
|
5147
|
+
* // - Install the npm module by running:
|
|
5148
|
+
* // ```sh
|
|
5149
|
+
* // $ npm install googleapis
|
|
5150
|
+
* // ```
|
|
5151
|
+
*
|
|
5152
|
+
* const {google} = require('googleapis');
|
|
5153
|
+
* const vision = google.vision('v1p1beta1');
|
|
5154
|
+
*
|
|
5155
|
+
* async function main() {
|
|
5156
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5157
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5158
|
+
* scopes: [
|
|
5159
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5160
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5161
|
+
* ],
|
|
5162
|
+
* });
|
|
5163
|
+
*
|
|
5164
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5165
|
+
* const authClient = await auth.getClient();
|
|
5166
|
+
* google.options({auth: authClient});
|
|
5167
|
+
*
|
|
5168
|
+
* // Do the magic
|
|
5169
|
+
* const res = await vision.images.annotate({
|
|
5170
|
+
* // Request body metadata
|
|
5171
|
+
* requestBody: {
|
|
5172
|
+
* // request body parameters
|
|
5173
|
+
* // {
|
|
5174
|
+
* // "labels": {},
|
|
5175
|
+
* // "parent": "my_parent",
|
|
5176
|
+
* // "requests": []
|
|
5177
|
+
* // }
|
|
5178
|
+
* },
|
|
5179
|
+
* });
|
|
5180
|
+
* console.log(res.data);
|
|
5181
|
+
*
|
|
5182
|
+
* // Example response
|
|
5183
|
+
* // {
|
|
5184
|
+
* // "responses": []
|
|
5185
|
+
* // }
|
|
5186
|
+
* }
|
|
5187
|
+
*
|
|
5188
|
+
* main().catch(e => {
|
|
5189
|
+
* console.error(e);
|
|
5190
|
+
* throw e;
|
|
5191
|
+
* });
|
|
5192
|
+
*
|
|
5193
|
+
* ```
|
|
5022
5194
|
*
|
|
5023
5195
|
* @param params - Parameters for request
|
|
5024
5196
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5033,6 +5205,67 @@ export declare namespace vision_v1p1beta1 {
|
|
|
5033
5205
|
annotate(callback: BodyResponseCallback<Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>): void;
|
|
5034
5206
|
/**
|
|
5035
5207
|
* 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.
|
|
5208
|
+
* @example
|
|
5209
|
+
* ```js
|
|
5210
|
+
* // Before running the sample:
|
|
5211
|
+
* // - Enable the API at:
|
|
5212
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5213
|
+
* // - Login into gcloud by running:
|
|
5214
|
+
* // ```sh
|
|
5215
|
+
* // $ gcloud auth application-default login
|
|
5216
|
+
* // ```
|
|
5217
|
+
* // - Install the npm module by running:
|
|
5218
|
+
* // ```sh
|
|
5219
|
+
* // $ npm install googleapis
|
|
5220
|
+
* // ```
|
|
5221
|
+
*
|
|
5222
|
+
* const {google} = require('googleapis');
|
|
5223
|
+
* const vision = google.vision('v1p1beta1');
|
|
5224
|
+
*
|
|
5225
|
+
* async function main() {
|
|
5226
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5227
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5228
|
+
* scopes: [
|
|
5229
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5230
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5231
|
+
* ],
|
|
5232
|
+
* });
|
|
5233
|
+
*
|
|
5234
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5235
|
+
* const authClient = await auth.getClient();
|
|
5236
|
+
* google.options({auth: authClient});
|
|
5237
|
+
*
|
|
5238
|
+
* // Do the magic
|
|
5239
|
+
* const res = await vision.images.asyncBatchAnnotate({
|
|
5240
|
+
* // Request body metadata
|
|
5241
|
+
* requestBody: {
|
|
5242
|
+
* // request body parameters
|
|
5243
|
+
* // {
|
|
5244
|
+
* // "labels": {},
|
|
5245
|
+
* // "outputConfig": {},
|
|
5246
|
+
* // "parent": "my_parent",
|
|
5247
|
+
* // "requests": []
|
|
5248
|
+
* // }
|
|
5249
|
+
* },
|
|
5250
|
+
* });
|
|
5251
|
+
* console.log(res.data);
|
|
5252
|
+
*
|
|
5253
|
+
* // Example response
|
|
5254
|
+
* // {
|
|
5255
|
+
* // "done": false,
|
|
5256
|
+
* // "error": {},
|
|
5257
|
+
* // "metadata": {},
|
|
5258
|
+
* // "name": "my_name",
|
|
5259
|
+
* // "response": {}
|
|
5260
|
+
* // }
|
|
5261
|
+
* }
|
|
5262
|
+
*
|
|
5263
|
+
* main().catch(e => {
|
|
5264
|
+
* console.error(e);
|
|
5265
|
+
* throw e;
|
|
5266
|
+
* });
|
|
5267
|
+
*
|
|
5268
|
+
* ```
|
|
5036
5269
|
*
|
|
5037
5270
|
* @param params - Parameters for request
|
|
5038
5271
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5070,6 +5303,65 @@ export declare namespace vision_v1p1beta1 {
|
|
|
5070
5303
|
constructor(context: APIRequestContext);
|
|
5071
5304
|
/**
|
|
5072
5305
|
* 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.
|
|
5306
|
+
* @example
|
|
5307
|
+
* ```js
|
|
5308
|
+
* // Before running the sample:
|
|
5309
|
+
* // - Enable the API at:
|
|
5310
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5311
|
+
* // - Login into gcloud by running:
|
|
5312
|
+
* // ```sh
|
|
5313
|
+
* // $ gcloud auth application-default login
|
|
5314
|
+
* // ```
|
|
5315
|
+
* // - Install the npm module by running:
|
|
5316
|
+
* // ```sh
|
|
5317
|
+
* // $ npm install googleapis
|
|
5318
|
+
* // ```
|
|
5319
|
+
*
|
|
5320
|
+
* const {google} = require('googleapis');
|
|
5321
|
+
* const vision = google.vision('v1p1beta1');
|
|
5322
|
+
*
|
|
5323
|
+
* async function main() {
|
|
5324
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5325
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5326
|
+
* scopes: [
|
|
5327
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5328
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5329
|
+
* ],
|
|
5330
|
+
* });
|
|
5331
|
+
*
|
|
5332
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5333
|
+
* const authClient = await auth.getClient();
|
|
5334
|
+
* google.options({auth: authClient});
|
|
5335
|
+
*
|
|
5336
|
+
* // Do the magic
|
|
5337
|
+
* const res = await vision.projects.files.annotate({
|
|
5338
|
+
* // 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`.
|
|
5339
|
+
* parent: 'projects/my-project',
|
|
5340
|
+
*
|
|
5341
|
+
* // Request body metadata
|
|
5342
|
+
* requestBody: {
|
|
5343
|
+
* // request body parameters
|
|
5344
|
+
* // {
|
|
5345
|
+
* // "labels": {},
|
|
5346
|
+
* // "parent": "my_parent",
|
|
5347
|
+
* // "requests": []
|
|
5348
|
+
* // }
|
|
5349
|
+
* },
|
|
5350
|
+
* });
|
|
5351
|
+
* console.log(res.data);
|
|
5352
|
+
*
|
|
5353
|
+
* // Example response
|
|
5354
|
+
* // {
|
|
5355
|
+
* // "responses": []
|
|
5356
|
+
* // }
|
|
5357
|
+
* }
|
|
5358
|
+
*
|
|
5359
|
+
* main().catch(e => {
|
|
5360
|
+
* console.error(e);
|
|
5361
|
+
* throw e;
|
|
5362
|
+
* });
|
|
5363
|
+
*
|
|
5364
|
+
* ```
|
|
5073
5365
|
*
|
|
5074
5366
|
* @param params - Parameters for request
|
|
5075
5367
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5084,6 +5376,69 @@ export declare namespace vision_v1p1beta1 {
|
|
|
5084
5376
|
annotate(callback: BodyResponseCallback<Schema$GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse>): void;
|
|
5085
5377
|
/**
|
|
5086
5378
|
* 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).
|
|
5379
|
+
* @example
|
|
5380
|
+
* ```js
|
|
5381
|
+
* // Before running the sample:
|
|
5382
|
+
* // - Enable the API at:
|
|
5383
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5384
|
+
* // - Login into gcloud by running:
|
|
5385
|
+
* // ```sh
|
|
5386
|
+
* // $ gcloud auth application-default login
|
|
5387
|
+
* // ```
|
|
5388
|
+
* // - Install the npm module by running:
|
|
5389
|
+
* // ```sh
|
|
5390
|
+
* // $ npm install googleapis
|
|
5391
|
+
* // ```
|
|
5392
|
+
*
|
|
5393
|
+
* const {google} = require('googleapis');
|
|
5394
|
+
* const vision = google.vision('v1p1beta1');
|
|
5395
|
+
*
|
|
5396
|
+
* async function main() {
|
|
5397
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5398
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5399
|
+
* scopes: [
|
|
5400
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5401
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5402
|
+
* ],
|
|
5403
|
+
* });
|
|
5404
|
+
*
|
|
5405
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5406
|
+
* const authClient = await auth.getClient();
|
|
5407
|
+
* google.options({auth: authClient});
|
|
5408
|
+
*
|
|
5409
|
+
* // Do the magic
|
|
5410
|
+
* const res = await vision.projects.files.asyncBatchAnnotate({
|
|
5411
|
+
* // 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`.
|
|
5412
|
+
* parent: 'projects/my-project',
|
|
5413
|
+
*
|
|
5414
|
+
* // Request body metadata
|
|
5415
|
+
* requestBody: {
|
|
5416
|
+
* // request body parameters
|
|
5417
|
+
* // {
|
|
5418
|
+
* // "labels": {},
|
|
5419
|
+
* // "parent": "my_parent",
|
|
5420
|
+
* // "requests": []
|
|
5421
|
+
* // }
|
|
5422
|
+
* },
|
|
5423
|
+
* });
|
|
5424
|
+
* console.log(res.data);
|
|
5425
|
+
*
|
|
5426
|
+
* // Example response
|
|
5427
|
+
* // {
|
|
5428
|
+
* // "done": false,
|
|
5429
|
+
* // "error": {},
|
|
5430
|
+
* // "metadata": {},
|
|
5431
|
+
* // "name": "my_name",
|
|
5432
|
+
* // "response": {}
|
|
5433
|
+
* // }
|
|
5434
|
+
* }
|
|
5435
|
+
*
|
|
5436
|
+
* main().catch(e => {
|
|
5437
|
+
* console.error(e);
|
|
5438
|
+
* throw e;
|
|
5439
|
+
* });
|
|
5440
|
+
*
|
|
5441
|
+
* ```
|
|
5087
5442
|
*
|
|
5088
5443
|
* @param params - Parameters for request
|
|
5089
5444
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5122,6 +5477,65 @@ export declare namespace vision_v1p1beta1 {
|
|
|
5122
5477
|
constructor(context: APIRequestContext);
|
|
5123
5478
|
/**
|
|
5124
5479
|
* Run image detection and annotation for a batch of images.
|
|
5480
|
+
* @example
|
|
5481
|
+
* ```js
|
|
5482
|
+
* // Before running the sample:
|
|
5483
|
+
* // - Enable the API at:
|
|
5484
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5485
|
+
* // - Login into gcloud by running:
|
|
5486
|
+
* // ```sh
|
|
5487
|
+
* // $ gcloud auth application-default login
|
|
5488
|
+
* // ```
|
|
5489
|
+
* // - Install the npm module by running:
|
|
5490
|
+
* // ```sh
|
|
5491
|
+
* // $ npm install googleapis
|
|
5492
|
+
* // ```
|
|
5493
|
+
*
|
|
5494
|
+
* const {google} = require('googleapis');
|
|
5495
|
+
* const vision = google.vision('v1p1beta1');
|
|
5496
|
+
*
|
|
5497
|
+
* async function main() {
|
|
5498
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5499
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5500
|
+
* scopes: [
|
|
5501
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5502
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5503
|
+
* ],
|
|
5504
|
+
* });
|
|
5505
|
+
*
|
|
5506
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5507
|
+
* const authClient = await auth.getClient();
|
|
5508
|
+
* google.options({auth: authClient});
|
|
5509
|
+
*
|
|
5510
|
+
* // Do the magic
|
|
5511
|
+
* const res = await vision.projects.images.annotate({
|
|
5512
|
+
* // 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`.
|
|
5513
|
+
* parent: 'projects/my-project',
|
|
5514
|
+
*
|
|
5515
|
+
* // Request body metadata
|
|
5516
|
+
* requestBody: {
|
|
5517
|
+
* // request body parameters
|
|
5518
|
+
* // {
|
|
5519
|
+
* // "labels": {},
|
|
5520
|
+
* // "parent": "my_parent",
|
|
5521
|
+
* // "requests": []
|
|
5522
|
+
* // }
|
|
5523
|
+
* },
|
|
5524
|
+
* });
|
|
5525
|
+
* console.log(res.data);
|
|
5526
|
+
*
|
|
5527
|
+
* // Example response
|
|
5528
|
+
* // {
|
|
5529
|
+
* // "responses": []
|
|
5530
|
+
* // }
|
|
5531
|
+
* }
|
|
5532
|
+
*
|
|
5533
|
+
* main().catch(e => {
|
|
5534
|
+
* console.error(e);
|
|
5535
|
+
* throw e;
|
|
5536
|
+
* });
|
|
5537
|
+
*
|
|
5538
|
+
* ```
|
|
5125
5539
|
*
|
|
5126
5540
|
* @param params - Parameters for request
|
|
5127
5541
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5136,6 +5550,70 @@ export declare namespace vision_v1p1beta1 {
|
|
|
5136
5550
|
annotate(callback: BodyResponseCallback<Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>): void;
|
|
5137
5551
|
/**
|
|
5138
5552
|
* 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.
|
|
5553
|
+
* @example
|
|
5554
|
+
* ```js
|
|
5555
|
+
* // Before running the sample:
|
|
5556
|
+
* // - Enable the API at:
|
|
5557
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5558
|
+
* // - Login into gcloud by running:
|
|
5559
|
+
* // ```sh
|
|
5560
|
+
* // $ gcloud auth application-default login
|
|
5561
|
+
* // ```
|
|
5562
|
+
* // - Install the npm module by running:
|
|
5563
|
+
* // ```sh
|
|
5564
|
+
* // $ npm install googleapis
|
|
5565
|
+
* // ```
|
|
5566
|
+
*
|
|
5567
|
+
* const {google} = require('googleapis');
|
|
5568
|
+
* const vision = google.vision('v1p1beta1');
|
|
5569
|
+
*
|
|
5570
|
+
* async function main() {
|
|
5571
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5572
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5573
|
+
* scopes: [
|
|
5574
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5575
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5576
|
+
* ],
|
|
5577
|
+
* });
|
|
5578
|
+
*
|
|
5579
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5580
|
+
* const authClient = await auth.getClient();
|
|
5581
|
+
* google.options({auth: authClient});
|
|
5582
|
+
*
|
|
5583
|
+
* // Do the magic
|
|
5584
|
+
* const res = await vision.projects.images.asyncBatchAnnotate({
|
|
5585
|
+
* // 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`.
|
|
5586
|
+
* parent: 'projects/my-project',
|
|
5587
|
+
*
|
|
5588
|
+
* // Request body metadata
|
|
5589
|
+
* requestBody: {
|
|
5590
|
+
* // request body parameters
|
|
5591
|
+
* // {
|
|
5592
|
+
* // "labels": {},
|
|
5593
|
+
* // "outputConfig": {},
|
|
5594
|
+
* // "parent": "my_parent",
|
|
5595
|
+
* // "requests": []
|
|
5596
|
+
* // }
|
|
5597
|
+
* },
|
|
5598
|
+
* });
|
|
5599
|
+
* console.log(res.data);
|
|
5600
|
+
*
|
|
5601
|
+
* // Example response
|
|
5602
|
+
* // {
|
|
5603
|
+
* // "done": false,
|
|
5604
|
+
* // "error": {},
|
|
5605
|
+
* // "metadata": {},
|
|
5606
|
+
* // "name": "my_name",
|
|
5607
|
+
* // "response": {}
|
|
5608
|
+
* // }
|
|
5609
|
+
* }
|
|
5610
|
+
*
|
|
5611
|
+
* main().catch(e => {
|
|
5612
|
+
* console.error(e);
|
|
5613
|
+
* throw e;
|
|
5614
|
+
* });
|
|
5615
|
+
*
|
|
5616
|
+
* ```
|
|
5139
5617
|
*
|
|
5140
5618
|
* @param params - Parameters for request
|
|
5141
5619
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5180,6 +5658,65 @@ export declare namespace vision_v1p1beta1 {
|
|
|
5180
5658
|
constructor(context: APIRequestContext);
|
|
5181
5659
|
/**
|
|
5182
5660
|
* 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.
|
|
5661
|
+
* @example
|
|
5662
|
+
* ```js
|
|
5663
|
+
* // Before running the sample:
|
|
5664
|
+
* // - Enable the API at:
|
|
5665
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5666
|
+
* // - Login into gcloud by running:
|
|
5667
|
+
* // ```sh
|
|
5668
|
+
* // $ gcloud auth application-default login
|
|
5669
|
+
* // ```
|
|
5670
|
+
* // - Install the npm module by running:
|
|
5671
|
+
* // ```sh
|
|
5672
|
+
* // $ npm install googleapis
|
|
5673
|
+
* // ```
|
|
5674
|
+
*
|
|
5675
|
+
* const {google} = require('googleapis');
|
|
5676
|
+
* const vision = google.vision('v1p1beta1');
|
|
5677
|
+
*
|
|
5678
|
+
* async function main() {
|
|
5679
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5680
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5681
|
+
* scopes: [
|
|
5682
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5683
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5684
|
+
* ],
|
|
5685
|
+
* });
|
|
5686
|
+
*
|
|
5687
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5688
|
+
* const authClient = await auth.getClient();
|
|
5689
|
+
* google.options({auth: authClient});
|
|
5690
|
+
*
|
|
5691
|
+
* // Do the magic
|
|
5692
|
+
* const res = await vision.projects.locations.files.annotate({
|
|
5693
|
+
* // 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`.
|
|
5694
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
5695
|
+
*
|
|
5696
|
+
* // Request body metadata
|
|
5697
|
+
* requestBody: {
|
|
5698
|
+
* // request body parameters
|
|
5699
|
+
* // {
|
|
5700
|
+
* // "labels": {},
|
|
5701
|
+
* // "parent": "my_parent",
|
|
5702
|
+
* // "requests": []
|
|
5703
|
+
* // }
|
|
5704
|
+
* },
|
|
5705
|
+
* });
|
|
5706
|
+
* console.log(res.data);
|
|
5707
|
+
*
|
|
5708
|
+
* // Example response
|
|
5709
|
+
* // {
|
|
5710
|
+
* // "responses": []
|
|
5711
|
+
* // }
|
|
5712
|
+
* }
|
|
5713
|
+
*
|
|
5714
|
+
* main().catch(e => {
|
|
5715
|
+
* console.error(e);
|
|
5716
|
+
* throw e;
|
|
5717
|
+
* });
|
|
5718
|
+
*
|
|
5719
|
+
* ```
|
|
5183
5720
|
*
|
|
5184
5721
|
* @param params - Parameters for request
|
|
5185
5722
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5194,6 +5731,69 @@ export declare namespace vision_v1p1beta1 {
|
|
|
5194
5731
|
annotate(callback: BodyResponseCallback<Schema$GoogleCloudVisionV1p1beta1BatchAnnotateFilesResponse>): void;
|
|
5195
5732
|
/**
|
|
5196
5733
|
* 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).
|
|
5734
|
+
* @example
|
|
5735
|
+
* ```js
|
|
5736
|
+
* // Before running the sample:
|
|
5737
|
+
* // - Enable the API at:
|
|
5738
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5739
|
+
* // - Login into gcloud by running:
|
|
5740
|
+
* // ```sh
|
|
5741
|
+
* // $ gcloud auth application-default login
|
|
5742
|
+
* // ```
|
|
5743
|
+
* // - Install the npm module by running:
|
|
5744
|
+
* // ```sh
|
|
5745
|
+
* // $ npm install googleapis
|
|
5746
|
+
* // ```
|
|
5747
|
+
*
|
|
5748
|
+
* const {google} = require('googleapis');
|
|
5749
|
+
* const vision = google.vision('v1p1beta1');
|
|
5750
|
+
*
|
|
5751
|
+
* async function main() {
|
|
5752
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5753
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5754
|
+
* scopes: [
|
|
5755
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5756
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5757
|
+
* ],
|
|
5758
|
+
* });
|
|
5759
|
+
*
|
|
5760
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5761
|
+
* const authClient = await auth.getClient();
|
|
5762
|
+
* google.options({auth: authClient});
|
|
5763
|
+
*
|
|
5764
|
+
* // Do the magic
|
|
5765
|
+
* const res = await vision.projects.locations.files.asyncBatchAnnotate({
|
|
5766
|
+
* // 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`.
|
|
5767
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
5768
|
+
*
|
|
5769
|
+
* // Request body metadata
|
|
5770
|
+
* requestBody: {
|
|
5771
|
+
* // request body parameters
|
|
5772
|
+
* // {
|
|
5773
|
+
* // "labels": {},
|
|
5774
|
+
* // "parent": "my_parent",
|
|
5775
|
+
* // "requests": []
|
|
5776
|
+
* // }
|
|
5777
|
+
* },
|
|
5778
|
+
* });
|
|
5779
|
+
* console.log(res.data);
|
|
5780
|
+
*
|
|
5781
|
+
* // Example response
|
|
5782
|
+
* // {
|
|
5783
|
+
* // "done": false,
|
|
5784
|
+
* // "error": {},
|
|
5785
|
+
* // "metadata": {},
|
|
5786
|
+
* // "name": "my_name",
|
|
5787
|
+
* // "response": {}
|
|
5788
|
+
* // }
|
|
5789
|
+
* }
|
|
5790
|
+
*
|
|
5791
|
+
* main().catch(e => {
|
|
5792
|
+
* console.error(e);
|
|
5793
|
+
* throw e;
|
|
5794
|
+
* });
|
|
5795
|
+
*
|
|
5796
|
+
* ```
|
|
5197
5797
|
*
|
|
5198
5798
|
* @param params - Parameters for request
|
|
5199
5799
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5232,6 +5832,65 @@ export declare namespace vision_v1p1beta1 {
|
|
|
5232
5832
|
constructor(context: APIRequestContext);
|
|
5233
5833
|
/**
|
|
5234
5834
|
* Run image detection and annotation for a batch of images.
|
|
5835
|
+
* @example
|
|
5836
|
+
* ```js
|
|
5837
|
+
* // Before running the sample:
|
|
5838
|
+
* // - Enable the API at:
|
|
5839
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5840
|
+
* // - Login into gcloud by running:
|
|
5841
|
+
* // ```sh
|
|
5842
|
+
* // $ gcloud auth application-default login
|
|
5843
|
+
* // ```
|
|
5844
|
+
* // - Install the npm module by running:
|
|
5845
|
+
* // ```sh
|
|
5846
|
+
* // $ npm install googleapis
|
|
5847
|
+
* // ```
|
|
5848
|
+
*
|
|
5849
|
+
* const {google} = require('googleapis');
|
|
5850
|
+
* const vision = google.vision('v1p1beta1');
|
|
5851
|
+
*
|
|
5852
|
+
* async function main() {
|
|
5853
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5854
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5855
|
+
* scopes: [
|
|
5856
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5857
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5858
|
+
* ],
|
|
5859
|
+
* });
|
|
5860
|
+
*
|
|
5861
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5862
|
+
* const authClient = await auth.getClient();
|
|
5863
|
+
* google.options({auth: authClient});
|
|
5864
|
+
*
|
|
5865
|
+
* // Do the magic
|
|
5866
|
+
* const res = await vision.projects.locations.images.annotate({
|
|
5867
|
+
* // 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`.
|
|
5868
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
5869
|
+
*
|
|
5870
|
+
* // Request body metadata
|
|
5871
|
+
* requestBody: {
|
|
5872
|
+
* // request body parameters
|
|
5873
|
+
* // {
|
|
5874
|
+
* // "labels": {},
|
|
5875
|
+
* // "parent": "my_parent",
|
|
5876
|
+
* // "requests": []
|
|
5877
|
+
* // }
|
|
5878
|
+
* },
|
|
5879
|
+
* });
|
|
5880
|
+
* console.log(res.data);
|
|
5881
|
+
*
|
|
5882
|
+
* // Example response
|
|
5883
|
+
* // {
|
|
5884
|
+
* // "responses": []
|
|
5885
|
+
* // }
|
|
5886
|
+
* }
|
|
5887
|
+
*
|
|
5888
|
+
* main().catch(e => {
|
|
5889
|
+
* console.error(e);
|
|
5890
|
+
* throw e;
|
|
5891
|
+
* });
|
|
5892
|
+
*
|
|
5893
|
+
* ```
|
|
5235
5894
|
*
|
|
5236
5895
|
* @param params - Parameters for request
|
|
5237
5896
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -5246,6 +5905,70 @@ export declare namespace vision_v1p1beta1 {
|
|
|
5246
5905
|
annotate(callback: BodyResponseCallback<Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>): void;
|
|
5247
5906
|
/**
|
|
5248
5907
|
* 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.
|
|
5908
|
+
* @example
|
|
5909
|
+
* ```js
|
|
5910
|
+
* // Before running the sample:
|
|
5911
|
+
* // - Enable the API at:
|
|
5912
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5913
|
+
* // - Login into gcloud by running:
|
|
5914
|
+
* // ```sh
|
|
5915
|
+
* // $ gcloud auth application-default login
|
|
5916
|
+
* // ```
|
|
5917
|
+
* // - Install the npm module by running:
|
|
5918
|
+
* // ```sh
|
|
5919
|
+
* // $ npm install googleapis
|
|
5920
|
+
* // ```
|
|
5921
|
+
*
|
|
5922
|
+
* const {google} = require('googleapis');
|
|
5923
|
+
* const vision = google.vision('v1p1beta1');
|
|
5924
|
+
*
|
|
5925
|
+
* async function main() {
|
|
5926
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5927
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5928
|
+
* scopes: [
|
|
5929
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5930
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5931
|
+
* ],
|
|
5932
|
+
* });
|
|
5933
|
+
*
|
|
5934
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5935
|
+
* const authClient = await auth.getClient();
|
|
5936
|
+
* google.options({auth: authClient});
|
|
5937
|
+
*
|
|
5938
|
+
* // Do the magic
|
|
5939
|
+
* const res = await vision.projects.locations.images.asyncBatchAnnotate({
|
|
5940
|
+
* // 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`.
|
|
5941
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
5942
|
+
*
|
|
5943
|
+
* // Request body metadata
|
|
5944
|
+
* requestBody: {
|
|
5945
|
+
* // request body parameters
|
|
5946
|
+
* // {
|
|
5947
|
+
* // "labels": {},
|
|
5948
|
+
* // "outputConfig": {},
|
|
5949
|
+
* // "parent": "my_parent",
|
|
5950
|
+
* // "requests": []
|
|
5951
|
+
* // }
|
|
5952
|
+
* },
|
|
5953
|
+
* });
|
|
5954
|
+
* console.log(res.data);
|
|
5955
|
+
*
|
|
5956
|
+
* // Example response
|
|
5957
|
+
* // {
|
|
5958
|
+
* // "done": false,
|
|
5959
|
+
* // "error": {},
|
|
5960
|
+
* // "metadata": {},
|
|
5961
|
+
* // "name": "my_name",
|
|
5962
|
+
* // "response": {}
|
|
5963
|
+
* // }
|
|
5964
|
+
* }
|
|
5965
|
+
*
|
|
5966
|
+
* main().catch(e => {
|
|
5967
|
+
* console.error(e);
|
|
5968
|
+
* throw e;
|
|
5969
|
+
* });
|
|
5970
|
+
*
|
|
5971
|
+
* ```
|
|
5249
5972
|
*
|
|
5250
5973
|
* @param params - Parameters for request
|
|
5251
5974
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|