@googleapis/vision 1.5.4 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/build/index.d.ts +1 -1
- package/build/index.js.map +1 -1
- package/build/v1.d.ts +2243 -77
- package/build/v1.js.map +1 -1
- package/build/v1p1beta1.d.ts +748 -25
- package/build/v1p1beta1.js.map +1 -1
- package/build/v1p2beta1.d.ts +748 -25
- package/build/v1p2beta1.js.map +1 -1
- package/index.ts +0 -1
- package/package.json +2 -2
- package/v1.ts +2377 -126
- package/v1p1beta1.ts +808 -43
- package/v1p2beta1.ts +808 -43
package/build/v1.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient,
|
|
2
|
+
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
|
|
3
3
|
import { Readable } from 'stream';
|
|
4
4
|
export declare namespace vision_v1 {
|
|
5
5
|
export interface Options extends GlobalOptions {
|
|
@@ -5139,28 +5139,144 @@ export declare namespace vision_v1 {
|
|
|
5139
5139
|
constructor(context: APIRequestContext);
|
|
5140
5140
|
/**
|
|
5141
5141
|
* 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.
|
|
5142
|
+
* @example
|
|
5143
|
+
* ```js
|
|
5144
|
+
* // Before running the sample:
|
|
5145
|
+
* // - Enable the API at:
|
|
5146
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5147
|
+
* // - Login into gcloud by running:
|
|
5148
|
+
* // ```sh
|
|
5149
|
+
* // $ gcloud auth application-default login
|
|
5150
|
+
* // ```
|
|
5151
|
+
* // - Install the npm module by running:
|
|
5152
|
+
* // ```sh
|
|
5153
|
+
* // $ npm install googleapis
|
|
5154
|
+
* // ```
|
|
5155
|
+
*
|
|
5156
|
+
* const {google} = require('googleapis');
|
|
5157
|
+
* const vision = google.vision('v1');
|
|
5158
|
+
*
|
|
5159
|
+
* async function main() {
|
|
5160
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5161
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5162
|
+
* scopes: [
|
|
5163
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5164
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5165
|
+
* ],
|
|
5166
|
+
* });
|
|
5167
|
+
*
|
|
5168
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5169
|
+
* const authClient = await auth.getClient();
|
|
5170
|
+
* google.options({auth: authClient});
|
|
5171
|
+
*
|
|
5172
|
+
* // Do the magic
|
|
5173
|
+
* const res = await vision.files.annotate({
|
|
5174
|
+
* // Request body metadata
|
|
5175
|
+
* requestBody: {
|
|
5176
|
+
* // request body parameters
|
|
5177
|
+
* // {
|
|
5178
|
+
* // "labels": {},
|
|
5179
|
+
* // "parent": "my_parent",
|
|
5180
|
+
* // "requests": []
|
|
5181
|
+
* // }
|
|
5182
|
+
* },
|
|
5183
|
+
* });
|
|
5184
|
+
* console.log(res.data);
|
|
5185
|
+
*
|
|
5186
|
+
* // Example response
|
|
5187
|
+
* // {
|
|
5188
|
+
* // "responses": []
|
|
5189
|
+
* // }
|
|
5190
|
+
* }
|
|
5191
|
+
*
|
|
5192
|
+
* main().catch(e => {
|
|
5193
|
+
* console.error(e);
|
|
5194
|
+
* throw e;
|
|
5195
|
+
* });
|
|
5196
|
+
*
|
|
5197
|
+
* ```
|
|
5142
5198
|
*
|
|
5143
5199
|
* @param params - Parameters for request
|
|
5144
5200
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5145
5201
|
* @param callback - Optional callback that handles the response.
|
|
5146
5202
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5147
5203
|
*/
|
|
5148
|
-
annotate(params: Params$Resource$Files$Annotate, options: StreamMethodOptions):
|
|
5149
|
-
annotate(params?: Params$Resource$Files$Annotate, options?: MethodOptions):
|
|
5204
|
+
annotate(params: Params$Resource$Files$Annotate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5205
|
+
annotate(params?: Params$Resource$Files$Annotate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateFilesResponse>>;
|
|
5150
5206
|
annotate(params: Params$Resource$Files$Annotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5151
5207
|
annotate(params: Params$Resource$Files$Annotate, options: MethodOptions | BodyResponseCallback<Schema$BatchAnnotateFilesResponse>, callback: BodyResponseCallback<Schema$BatchAnnotateFilesResponse>): void;
|
|
5152
5208
|
annotate(params: Params$Resource$Files$Annotate, callback: BodyResponseCallback<Schema$BatchAnnotateFilesResponse>): void;
|
|
5153
5209
|
annotate(callback: BodyResponseCallback<Schema$BatchAnnotateFilesResponse>): void;
|
|
5154
5210
|
/**
|
|
5155
5211
|
* 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).
|
|
5212
|
+
* @example
|
|
5213
|
+
* ```js
|
|
5214
|
+
* // Before running the sample:
|
|
5215
|
+
* // - Enable the API at:
|
|
5216
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5217
|
+
* // - Login into gcloud by running:
|
|
5218
|
+
* // ```sh
|
|
5219
|
+
* // $ gcloud auth application-default login
|
|
5220
|
+
* // ```
|
|
5221
|
+
* // - Install the npm module by running:
|
|
5222
|
+
* // ```sh
|
|
5223
|
+
* // $ npm install googleapis
|
|
5224
|
+
* // ```
|
|
5225
|
+
*
|
|
5226
|
+
* const {google} = require('googleapis');
|
|
5227
|
+
* const vision = google.vision('v1');
|
|
5228
|
+
*
|
|
5229
|
+
* async function main() {
|
|
5230
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5231
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5232
|
+
* scopes: [
|
|
5233
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5234
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5235
|
+
* ],
|
|
5236
|
+
* });
|
|
5237
|
+
*
|
|
5238
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5239
|
+
* const authClient = await auth.getClient();
|
|
5240
|
+
* google.options({auth: authClient});
|
|
5241
|
+
*
|
|
5242
|
+
* // Do the magic
|
|
5243
|
+
* const res = await vision.files.asyncBatchAnnotate({
|
|
5244
|
+
* // Request body metadata
|
|
5245
|
+
* requestBody: {
|
|
5246
|
+
* // request body parameters
|
|
5247
|
+
* // {
|
|
5248
|
+
* // "labels": {},
|
|
5249
|
+
* // "parent": "my_parent",
|
|
5250
|
+
* // "requests": []
|
|
5251
|
+
* // }
|
|
5252
|
+
* },
|
|
5253
|
+
* });
|
|
5254
|
+
* console.log(res.data);
|
|
5255
|
+
*
|
|
5256
|
+
* // Example response
|
|
5257
|
+
* // {
|
|
5258
|
+
* // "done": false,
|
|
5259
|
+
* // "error": {},
|
|
5260
|
+
* // "metadata": {},
|
|
5261
|
+
* // "name": "my_name",
|
|
5262
|
+
* // "response": {}
|
|
5263
|
+
* // }
|
|
5264
|
+
* }
|
|
5265
|
+
*
|
|
5266
|
+
* main().catch(e => {
|
|
5267
|
+
* console.error(e);
|
|
5268
|
+
* throw e;
|
|
5269
|
+
* });
|
|
5270
|
+
*
|
|
5271
|
+
* ```
|
|
5156
5272
|
*
|
|
5157
5273
|
* @param params - Parameters for request
|
|
5158
5274
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5159
5275
|
* @param callback - Optional callback that handles the response.
|
|
5160
5276
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5161
5277
|
*/
|
|
5162
|
-
asyncBatchAnnotate(params: Params$Resource$Files$Asyncbatchannotate, options: StreamMethodOptions):
|
|
5163
|
-
asyncBatchAnnotate(params?: Params$Resource$Files$Asyncbatchannotate, options?: MethodOptions):
|
|
5278
|
+
asyncBatchAnnotate(params: Params$Resource$Files$Asyncbatchannotate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5279
|
+
asyncBatchAnnotate(params?: Params$Resource$Files$Asyncbatchannotate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5164
5280
|
asyncBatchAnnotate(params: Params$Resource$Files$Asyncbatchannotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5165
5281
|
asyncBatchAnnotate(params: Params$Resource$Files$Asyncbatchannotate, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5166
5282
|
asyncBatchAnnotate(params: Params$Resource$Files$Asyncbatchannotate, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
@@ -5183,28 +5299,145 @@ export declare namespace vision_v1 {
|
|
|
5183
5299
|
constructor(context: APIRequestContext);
|
|
5184
5300
|
/**
|
|
5185
5301
|
* Run image detection and annotation for a batch of images.
|
|
5302
|
+
* @example
|
|
5303
|
+
* ```js
|
|
5304
|
+
* // Before running the sample:
|
|
5305
|
+
* // - Enable the API at:
|
|
5306
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5307
|
+
* // - Login into gcloud by running:
|
|
5308
|
+
* // ```sh
|
|
5309
|
+
* // $ gcloud auth application-default login
|
|
5310
|
+
* // ```
|
|
5311
|
+
* // - Install the npm module by running:
|
|
5312
|
+
* // ```sh
|
|
5313
|
+
* // $ npm install googleapis
|
|
5314
|
+
* // ```
|
|
5315
|
+
*
|
|
5316
|
+
* const {google} = require('googleapis');
|
|
5317
|
+
* const vision = google.vision('v1');
|
|
5318
|
+
*
|
|
5319
|
+
* async function main() {
|
|
5320
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5321
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5322
|
+
* scopes: [
|
|
5323
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5324
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5325
|
+
* ],
|
|
5326
|
+
* });
|
|
5327
|
+
*
|
|
5328
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5329
|
+
* const authClient = await auth.getClient();
|
|
5330
|
+
* google.options({auth: authClient});
|
|
5331
|
+
*
|
|
5332
|
+
* // Do the magic
|
|
5333
|
+
* const res = await vision.images.annotate({
|
|
5334
|
+
* // Request body metadata
|
|
5335
|
+
* requestBody: {
|
|
5336
|
+
* // request body parameters
|
|
5337
|
+
* // {
|
|
5338
|
+
* // "labels": {},
|
|
5339
|
+
* // "parent": "my_parent",
|
|
5340
|
+
* // "requests": []
|
|
5341
|
+
* // }
|
|
5342
|
+
* },
|
|
5343
|
+
* });
|
|
5344
|
+
* console.log(res.data);
|
|
5345
|
+
*
|
|
5346
|
+
* // Example response
|
|
5347
|
+
* // {
|
|
5348
|
+
* // "responses": []
|
|
5349
|
+
* // }
|
|
5350
|
+
* }
|
|
5351
|
+
*
|
|
5352
|
+
* main().catch(e => {
|
|
5353
|
+
* console.error(e);
|
|
5354
|
+
* throw e;
|
|
5355
|
+
* });
|
|
5356
|
+
*
|
|
5357
|
+
* ```
|
|
5186
5358
|
*
|
|
5187
5359
|
* @param params - Parameters for request
|
|
5188
5360
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5189
5361
|
* @param callback - Optional callback that handles the response.
|
|
5190
5362
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5191
5363
|
*/
|
|
5192
|
-
annotate(params: Params$Resource$Images$Annotate, options: StreamMethodOptions):
|
|
5193
|
-
annotate(params?: Params$Resource$Images$Annotate, options?: MethodOptions):
|
|
5364
|
+
annotate(params: Params$Resource$Images$Annotate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5365
|
+
annotate(params?: Params$Resource$Images$Annotate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateImagesResponse>>;
|
|
5194
5366
|
annotate(params: Params$Resource$Images$Annotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5195
5367
|
annotate(params: Params$Resource$Images$Annotate, options: MethodOptions | BodyResponseCallback<Schema$BatchAnnotateImagesResponse>, callback: BodyResponseCallback<Schema$BatchAnnotateImagesResponse>): void;
|
|
5196
5368
|
annotate(params: Params$Resource$Images$Annotate, callback: BodyResponseCallback<Schema$BatchAnnotateImagesResponse>): void;
|
|
5197
5369
|
annotate(callback: BodyResponseCallback<Schema$BatchAnnotateImagesResponse>): void;
|
|
5198
5370
|
/**
|
|
5199
5371
|
* 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.
|
|
5372
|
+
* @example
|
|
5373
|
+
* ```js
|
|
5374
|
+
* // Before running the sample:
|
|
5375
|
+
* // - Enable the API at:
|
|
5376
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5377
|
+
* // - Login into gcloud by running:
|
|
5378
|
+
* // ```sh
|
|
5379
|
+
* // $ gcloud auth application-default login
|
|
5380
|
+
* // ```
|
|
5381
|
+
* // - Install the npm module by running:
|
|
5382
|
+
* // ```sh
|
|
5383
|
+
* // $ npm install googleapis
|
|
5384
|
+
* // ```
|
|
5385
|
+
*
|
|
5386
|
+
* const {google} = require('googleapis');
|
|
5387
|
+
* const vision = google.vision('v1');
|
|
5388
|
+
*
|
|
5389
|
+
* async function main() {
|
|
5390
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5391
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5392
|
+
* scopes: [
|
|
5393
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5394
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5395
|
+
* ],
|
|
5396
|
+
* });
|
|
5397
|
+
*
|
|
5398
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5399
|
+
* const authClient = await auth.getClient();
|
|
5400
|
+
* google.options({auth: authClient});
|
|
5401
|
+
*
|
|
5402
|
+
* // Do the magic
|
|
5403
|
+
* const res = await vision.images.asyncBatchAnnotate({
|
|
5404
|
+
* // Request body metadata
|
|
5405
|
+
* requestBody: {
|
|
5406
|
+
* // request body parameters
|
|
5407
|
+
* // {
|
|
5408
|
+
* // "labels": {},
|
|
5409
|
+
* // "outputConfig": {},
|
|
5410
|
+
* // "parent": "my_parent",
|
|
5411
|
+
* // "requests": []
|
|
5412
|
+
* // }
|
|
5413
|
+
* },
|
|
5414
|
+
* });
|
|
5415
|
+
* console.log(res.data);
|
|
5416
|
+
*
|
|
5417
|
+
* // Example response
|
|
5418
|
+
* // {
|
|
5419
|
+
* // "done": false,
|
|
5420
|
+
* // "error": {},
|
|
5421
|
+
* // "metadata": {},
|
|
5422
|
+
* // "name": "my_name",
|
|
5423
|
+
* // "response": {}
|
|
5424
|
+
* // }
|
|
5425
|
+
* }
|
|
5426
|
+
*
|
|
5427
|
+
* main().catch(e => {
|
|
5428
|
+
* console.error(e);
|
|
5429
|
+
* throw e;
|
|
5430
|
+
* });
|
|
5431
|
+
*
|
|
5432
|
+
* ```
|
|
5200
5433
|
*
|
|
5201
5434
|
* @param params - Parameters for request
|
|
5202
5435
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5203
5436
|
* @param callback - Optional callback that handles the response.
|
|
5204
5437
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5205
5438
|
*/
|
|
5206
|
-
asyncBatchAnnotate(params: Params$Resource$Images$Asyncbatchannotate, options: StreamMethodOptions):
|
|
5207
|
-
asyncBatchAnnotate(params?: Params$Resource$Images$Asyncbatchannotate, options?: MethodOptions):
|
|
5439
|
+
asyncBatchAnnotate(params: Params$Resource$Images$Asyncbatchannotate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5440
|
+
asyncBatchAnnotate(params?: Params$Resource$Images$Asyncbatchannotate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5208
5441
|
asyncBatchAnnotate(params: Params$Resource$Images$Asyncbatchannotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5209
5442
|
asyncBatchAnnotate(params: Params$Resource$Images$Asyncbatchannotate, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5210
5443
|
asyncBatchAnnotate(params: Params$Resource$Images$Asyncbatchannotate, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
@@ -5232,14 +5465,67 @@ export declare namespace vision_v1 {
|
|
|
5232
5465
|
constructor(context: APIRequestContext);
|
|
5233
5466
|
/**
|
|
5234
5467
|
* Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
|
5468
|
+
* @example
|
|
5469
|
+
* ```js
|
|
5470
|
+
* // Before running the sample:
|
|
5471
|
+
* // - Enable the API at:
|
|
5472
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5473
|
+
* // - Login into gcloud by running:
|
|
5474
|
+
* // ```sh
|
|
5475
|
+
* // $ gcloud auth application-default login
|
|
5476
|
+
* // ```
|
|
5477
|
+
* // - Install the npm module by running:
|
|
5478
|
+
* // ```sh
|
|
5479
|
+
* // $ npm install googleapis
|
|
5480
|
+
* // ```
|
|
5481
|
+
*
|
|
5482
|
+
* const {google} = require('googleapis');
|
|
5483
|
+
* const vision = google.vision('v1');
|
|
5484
|
+
*
|
|
5485
|
+
* async function main() {
|
|
5486
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5487
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5488
|
+
* scopes: [
|
|
5489
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5490
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5491
|
+
* ],
|
|
5492
|
+
* });
|
|
5493
|
+
*
|
|
5494
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5495
|
+
* const authClient = await auth.getClient();
|
|
5496
|
+
* google.options({auth: authClient});
|
|
5497
|
+
*
|
|
5498
|
+
* // Do the magic
|
|
5499
|
+
* const res = await vision.locations.operations.get({
|
|
5500
|
+
* // The name of the operation resource.
|
|
5501
|
+
* name: 'locations/my-location/operations/my-operation',
|
|
5502
|
+
* });
|
|
5503
|
+
* console.log(res.data);
|
|
5504
|
+
*
|
|
5505
|
+
* // Example response
|
|
5506
|
+
* // {
|
|
5507
|
+
* // "done": false,
|
|
5508
|
+
* // "error": {},
|
|
5509
|
+
* // "metadata": {},
|
|
5510
|
+
* // "name": "my_name",
|
|
5511
|
+
* // "response": {}
|
|
5512
|
+
* // }
|
|
5513
|
+
* }
|
|
5514
|
+
*
|
|
5515
|
+
* main().catch(e => {
|
|
5516
|
+
* console.error(e);
|
|
5517
|
+
* throw e;
|
|
5518
|
+
* });
|
|
5519
|
+
*
|
|
5520
|
+
* ```
|
|
5235
5521
|
*
|
|
5236
5522
|
* @param params - Parameters for request
|
|
5237
5523
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5238
5524
|
* @param callback - Optional callback that handles the response.
|
|
5239
5525
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5240
5526
|
*/
|
|
5241
|
-
get(params: Params$Resource$Locations$Operations$Get, options: StreamMethodOptions):
|
|
5242
|
-
get(params?: Params$Resource$Locations$Operations$Get, options?: MethodOptions):
|
|
5527
|
+
get(params: Params$Resource$Locations$Operations$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5528
|
+
get(params?: Params$Resource$Locations$Operations$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5243
5529
|
get(params: Params$Resource$Locations$Operations$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5244
5530
|
get(params: Params$Resource$Locations$Operations$Get, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5245
5531
|
get(params: Params$Resource$Locations$Operations$Get, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
@@ -5256,56 +5542,265 @@ export declare namespace vision_v1 {
|
|
|
5256
5542
|
constructor(context: APIRequestContext);
|
|
5257
5543
|
/**
|
|
5258
5544
|
* Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
|
|
5545
|
+
* @example
|
|
5546
|
+
* ```js
|
|
5547
|
+
* // Before running the sample:
|
|
5548
|
+
* // - Enable the API at:
|
|
5549
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5550
|
+
* // - Login into gcloud by running:
|
|
5551
|
+
* // ```sh
|
|
5552
|
+
* // $ gcloud auth application-default login
|
|
5553
|
+
* // ```
|
|
5554
|
+
* // - Install the npm module by running:
|
|
5555
|
+
* // ```sh
|
|
5556
|
+
* // $ npm install googleapis
|
|
5557
|
+
* // ```
|
|
5558
|
+
*
|
|
5559
|
+
* const {google} = require('googleapis');
|
|
5560
|
+
* const vision = google.vision('v1');
|
|
5561
|
+
*
|
|
5562
|
+
* async function main() {
|
|
5563
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5564
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5565
|
+
* scopes: [
|
|
5566
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5567
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5568
|
+
* ],
|
|
5569
|
+
* });
|
|
5570
|
+
*
|
|
5571
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5572
|
+
* const authClient = await auth.getClient();
|
|
5573
|
+
* google.options({auth: authClient});
|
|
5574
|
+
*
|
|
5575
|
+
* // Do the magic
|
|
5576
|
+
* const res = await vision.operations.cancel({
|
|
5577
|
+
* // The name of the operation resource to be cancelled.
|
|
5578
|
+
* name: 'operations/.*',
|
|
5579
|
+
*
|
|
5580
|
+
* // Request body metadata
|
|
5581
|
+
* requestBody: {
|
|
5582
|
+
* // request body parameters
|
|
5583
|
+
* // {}
|
|
5584
|
+
* },
|
|
5585
|
+
* });
|
|
5586
|
+
* console.log(res.data);
|
|
5587
|
+
*
|
|
5588
|
+
* // Example response
|
|
5589
|
+
* // {}
|
|
5590
|
+
* }
|
|
5591
|
+
*
|
|
5592
|
+
* main().catch(e => {
|
|
5593
|
+
* console.error(e);
|
|
5594
|
+
* throw e;
|
|
5595
|
+
* });
|
|
5596
|
+
*
|
|
5597
|
+
* ```
|
|
5259
5598
|
*
|
|
5260
5599
|
* @param params - Parameters for request
|
|
5261
5600
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5262
5601
|
* @param callback - Optional callback that handles the response.
|
|
5263
5602
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5264
5603
|
*/
|
|
5265
|
-
cancel(params: Params$Resource$Operations$Cancel, options: StreamMethodOptions):
|
|
5266
|
-
cancel(params?: Params$Resource$Operations$Cancel, options?: MethodOptions):
|
|
5604
|
+
cancel(params: Params$Resource$Operations$Cancel, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5605
|
+
cancel(params?: Params$Resource$Operations$Cancel, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
5267
5606
|
cancel(params: Params$Resource$Operations$Cancel, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5268
5607
|
cancel(params: Params$Resource$Operations$Cancel, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5269
5608
|
cancel(params: Params$Resource$Operations$Cancel, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5270
5609
|
cancel(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5271
5610
|
/**
|
|
5272
5611
|
* Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
|
|
5612
|
+
* @example
|
|
5613
|
+
* ```js
|
|
5614
|
+
* // Before running the sample:
|
|
5615
|
+
* // - Enable the API at:
|
|
5616
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5617
|
+
* // - Login into gcloud by running:
|
|
5618
|
+
* // ```sh
|
|
5619
|
+
* // $ gcloud auth application-default login
|
|
5620
|
+
* // ```
|
|
5621
|
+
* // - Install the npm module by running:
|
|
5622
|
+
* // ```sh
|
|
5623
|
+
* // $ npm install googleapis
|
|
5624
|
+
* // ```
|
|
5625
|
+
*
|
|
5626
|
+
* const {google} = require('googleapis');
|
|
5627
|
+
* const vision = google.vision('v1');
|
|
5628
|
+
*
|
|
5629
|
+
* async function main() {
|
|
5630
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5631
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5632
|
+
* scopes: [
|
|
5633
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5634
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5635
|
+
* ],
|
|
5636
|
+
* });
|
|
5637
|
+
*
|
|
5638
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5639
|
+
* const authClient = await auth.getClient();
|
|
5640
|
+
* google.options({auth: authClient});
|
|
5641
|
+
*
|
|
5642
|
+
* // Do the magic
|
|
5643
|
+
* const res = await vision.operations.delete({
|
|
5644
|
+
* // The name of the operation resource to be deleted.
|
|
5645
|
+
* name: 'operations/.*',
|
|
5646
|
+
* });
|
|
5647
|
+
* console.log(res.data);
|
|
5648
|
+
*
|
|
5649
|
+
* // Example response
|
|
5650
|
+
* // {}
|
|
5651
|
+
* }
|
|
5652
|
+
*
|
|
5653
|
+
* main().catch(e => {
|
|
5654
|
+
* console.error(e);
|
|
5655
|
+
* throw e;
|
|
5656
|
+
* });
|
|
5657
|
+
*
|
|
5658
|
+
* ```
|
|
5273
5659
|
*
|
|
5274
5660
|
* @param params - Parameters for request
|
|
5275
5661
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5276
5662
|
* @param callback - Optional callback that handles the response.
|
|
5277
5663
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5278
5664
|
*/
|
|
5279
|
-
delete(params: Params$Resource$Operations$Delete, options: StreamMethodOptions):
|
|
5280
|
-
delete(params?: Params$Resource$Operations$Delete, options?: MethodOptions):
|
|
5665
|
+
delete(params: Params$Resource$Operations$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5666
|
+
delete(params?: Params$Resource$Operations$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
5281
5667
|
delete(params: Params$Resource$Operations$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5282
5668
|
delete(params: Params$Resource$Operations$Delete, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5283
5669
|
delete(params: Params$Resource$Operations$Delete, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5284
5670
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5285
5671
|
/**
|
|
5286
5672
|
* Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
|
5673
|
+
* @example
|
|
5674
|
+
* ```js
|
|
5675
|
+
* // Before running the sample:
|
|
5676
|
+
* // - Enable the API at:
|
|
5677
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5678
|
+
* // - Login into gcloud by running:
|
|
5679
|
+
* // ```sh
|
|
5680
|
+
* // $ gcloud auth application-default login
|
|
5681
|
+
* // ```
|
|
5682
|
+
* // - Install the npm module by running:
|
|
5683
|
+
* // ```sh
|
|
5684
|
+
* // $ npm install googleapis
|
|
5685
|
+
* // ```
|
|
5686
|
+
*
|
|
5687
|
+
* const {google} = require('googleapis');
|
|
5688
|
+
* const vision = google.vision('v1');
|
|
5689
|
+
*
|
|
5690
|
+
* async function main() {
|
|
5691
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5692
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5693
|
+
* scopes: [
|
|
5694
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5695
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5696
|
+
* ],
|
|
5697
|
+
* });
|
|
5698
|
+
*
|
|
5699
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5700
|
+
* const authClient = await auth.getClient();
|
|
5701
|
+
* google.options({auth: authClient});
|
|
5702
|
+
*
|
|
5703
|
+
* // Do the magic
|
|
5704
|
+
* const res = await vision.operations.get({
|
|
5705
|
+
* // The name of the operation resource.
|
|
5706
|
+
* name: 'operations/my-operation',
|
|
5707
|
+
* });
|
|
5708
|
+
* console.log(res.data);
|
|
5709
|
+
*
|
|
5710
|
+
* // Example response
|
|
5711
|
+
* // {
|
|
5712
|
+
* // "done": false,
|
|
5713
|
+
* // "error": {},
|
|
5714
|
+
* // "metadata": {},
|
|
5715
|
+
* // "name": "my_name",
|
|
5716
|
+
* // "response": {}
|
|
5717
|
+
* // }
|
|
5718
|
+
* }
|
|
5719
|
+
*
|
|
5720
|
+
* main().catch(e => {
|
|
5721
|
+
* console.error(e);
|
|
5722
|
+
* throw e;
|
|
5723
|
+
* });
|
|
5724
|
+
*
|
|
5725
|
+
* ```
|
|
5287
5726
|
*
|
|
5288
5727
|
* @param params - Parameters for request
|
|
5289
5728
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5290
5729
|
* @param callback - Optional callback that handles the response.
|
|
5291
5730
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5292
5731
|
*/
|
|
5293
|
-
get(params: Params$Resource$Operations$Get, options: StreamMethodOptions):
|
|
5294
|
-
get(params?: Params$Resource$Operations$Get, options?: MethodOptions):
|
|
5732
|
+
get(params: Params$Resource$Operations$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5733
|
+
get(params?: Params$Resource$Operations$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5295
5734
|
get(params: Params$Resource$Operations$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5296
5735
|
get(params: Params$Resource$Operations$Get, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5297
5736
|
get(params: Params$Resource$Operations$Get, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5298
5737
|
get(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5299
5738
|
/**
|
|
5300
5739
|
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
|
|
5740
|
+
* @example
|
|
5741
|
+
* ```js
|
|
5742
|
+
* // Before running the sample:
|
|
5743
|
+
* // - Enable the API at:
|
|
5744
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5745
|
+
* // - Login into gcloud by running:
|
|
5746
|
+
* // ```sh
|
|
5747
|
+
* // $ gcloud auth application-default login
|
|
5748
|
+
* // ```
|
|
5749
|
+
* // - Install the npm module by running:
|
|
5750
|
+
* // ```sh
|
|
5751
|
+
* // $ npm install googleapis
|
|
5752
|
+
* // ```
|
|
5753
|
+
*
|
|
5754
|
+
* const {google} = require('googleapis');
|
|
5755
|
+
* const vision = google.vision('v1');
|
|
5756
|
+
*
|
|
5757
|
+
* async function main() {
|
|
5758
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5759
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5760
|
+
* scopes: [
|
|
5761
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5762
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5763
|
+
* ],
|
|
5764
|
+
* });
|
|
5765
|
+
*
|
|
5766
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5767
|
+
* const authClient = await auth.getClient();
|
|
5768
|
+
* google.options({auth: authClient});
|
|
5769
|
+
*
|
|
5770
|
+
* // Do the magic
|
|
5771
|
+
* const res = await vision.operations.list({
|
|
5772
|
+
* // The standard list filter.
|
|
5773
|
+
* filter: 'placeholder-value',
|
|
5774
|
+
* // The name of the operation's parent resource.
|
|
5775
|
+
* name: 'operations',
|
|
5776
|
+
* // The standard list page size.
|
|
5777
|
+
* pageSize: 'placeholder-value',
|
|
5778
|
+
* // The standard list page token.
|
|
5779
|
+
* pageToken: 'placeholder-value',
|
|
5780
|
+
* });
|
|
5781
|
+
* console.log(res.data);
|
|
5782
|
+
*
|
|
5783
|
+
* // Example response
|
|
5784
|
+
* // {
|
|
5785
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
5786
|
+
* // "operations": []
|
|
5787
|
+
* // }
|
|
5788
|
+
* }
|
|
5789
|
+
*
|
|
5790
|
+
* main().catch(e => {
|
|
5791
|
+
* console.error(e);
|
|
5792
|
+
* throw e;
|
|
5793
|
+
* });
|
|
5794
|
+
*
|
|
5795
|
+
* ```
|
|
5301
5796
|
*
|
|
5302
5797
|
* @param params - Parameters for request
|
|
5303
5798
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5304
5799
|
* @param callback - Optional callback that handles the response.
|
|
5305
5800
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5306
5801
|
*/
|
|
5307
|
-
list(params: Params$Resource$Operations$List, options: StreamMethodOptions):
|
|
5308
|
-
list(params?: Params$Resource$Operations$List, options?: MethodOptions):
|
|
5802
|
+
list(params: Params$Resource$Operations$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5803
|
+
list(params?: Params$Resource$Operations$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListOperationsResponse>>;
|
|
5309
5804
|
list(params: Params$Resource$Operations$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5310
5805
|
list(params: Params$Resource$Operations$List, options: MethodOptions | BodyResponseCallback<Schema$ListOperationsResponse>, callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
|
|
5311
5806
|
list(params: Params$Resource$Operations$List, callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
|
|
@@ -5364,28 +5859,150 @@ export declare namespace vision_v1 {
|
|
|
5364
5859
|
constructor(context: APIRequestContext);
|
|
5365
5860
|
/**
|
|
5366
5861
|
* 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.
|
|
5862
|
+
* @example
|
|
5863
|
+
* ```js
|
|
5864
|
+
* // Before running the sample:
|
|
5865
|
+
* // - Enable the API at:
|
|
5866
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5867
|
+
* // - Login into gcloud by running:
|
|
5868
|
+
* // ```sh
|
|
5869
|
+
* // $ gcloud auth application-default login
|
|
5870
|
+
* // ```
|
|
5871
|
+
* // - Install the npm module by running:
|
|
5872
|
+
* // ```sh
|
|
5873
|
+
* // $ npm install googleapis
|
|
5874
|
+
* // ```
|
|
5875
|
+
*
|
|
5876
|
+
* const {google} = require('googleapis');
|
|
5877
|
+
* const vision = google.vision('v1');
|
|
5878
|
+
*
|
|
5879
|
+
* async function main() {
|
|
5880
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5881
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5882
|
+
* scopes: [
|
|
5883
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5884
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5885
|
+
* ],
|
|
5886
|
+
* });
|
|
5887
|
+
*
|
|
5888
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5889
|
+
* const authClient = await auth.getClient();
|
|
5890
|
+
* google.options({auth: authClient});
|
|
5891
|
+
*
|
|
5892
|
+
* // Do the magic
|
|
5893
|
+
* const res = await vision.projects.files.annotate({
|
|
5894
|
+
* // 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`.
|
|
5895
|
+
* parent: 'projects/my-project',
|
|
5896
|
+
*
|
|
5897
|
+
* // Request body metadata
|
|
5898
|
+
* requestBody: {
|
|
5899
|
+
* // request body parameters
|
|
5900
|
+
* // {
|
|
5901
|
+
* // "labels": {},
|
|
5902
|
+
* // "parent": "my_parent",
|
|
5903
|
+
* // "requests": []
|
|
5904
|
+
* // }
|
|
5905
|
+
* },
|
|
5906
|
+
* });
|
|
5907
|
+
* console.log(res.data);
|
|
5908
|
+
*
|
|
5909
|
+
* // Example response
|
|
5910
|
+
* // {
|
|
5911
|
+
* // "responses": []
|
|
5912
|
+
* // }
|
|
5913
|
+
* }
|
|
5914
|
+
*
|
|
5915
|
+
* main().catch(e => {
|
|
5916
|
+
* console.error(e);
|
|
5917
|
+
* throw e;
|
|
5918
|
+
* });
|
|
5919
|
+
*
|
|
5920
|
+
* ```
|
|
5367
5921
|
*
|
|
5368
5922
|
* @param params - Parameters for request
|
|
5369
5923
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5370
5924
|
* @param callback - Optional callback that handles the response.
|
|
5371
5925
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5372
5926
|
*/
|
|
5373
|
-
annotate(params: Params$Resource$Projects$Files$Annotate, options: StreamMethodOptions):
|
|
5374
|
-
annotate(params?: Params$Resource$Projects$Files$Annotate, options?: MethodOptions):
|
|
5927
|
+
annotate(params: Params$Resource$Projects$Files$Annotate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5928
|
+
annotate(params?: Params$Resource$Projects$Files$Annotate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateFilesResponse>>;
|
|
5375
5929
|
annotate(params: Params$Resource$Projects$Files$Annotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5376
5930
|
annotate(params: Params$Resource$Projects$Files$Annotate, options: MethodOptions | BodyResponseCallback<Schema$BatchAnnotateFilesResponse>, callback: BodyResponseCallback<Schema$BatchAnnotateFilesResponse>): void;
|
|
5377
5931
|
annotate(params: Params$Resource$Projects$Files$Annotate, callback: BodyResponseCallback<Schema$BatchAnnotateFilesResponse>): void;
|
|
5378
5932
|
annotate(callback: BodyResponseCallback<Schema$BatchAnnotateFilesResponse>): void;
|
|
5379
5933
|
/**
|
|
5380
5934
|
* 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).
|
|
5935
|
+
* @example
|
|
5936
|
+
* ```js
|
|
5937
|
+
* // Before running the sample:
|
|
5938
|
+
* // - Enable the API at:
|
|
5939
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
5940
|
+
* // - Login into gcloud by running:
|
|
5941
|
+
* // ```sh
|
|
5942
|
+
* // $ gcloud auth application-default login
|
|
5943
|
+
* // ```
|
|
5944
|
+
* // - Install the npm module by running:
|
|
5945
|
+
* // ```sh
|
|
5946
|
+
* // $ npm install googleapis
|
|
5947
|
+
* // ```
|
|
5948
|
+
*
|
|
5949
|
+
* const {google} = require('googleapis');
|
|
5950
|
+
* const vision = google.vision('v1');
|
|
5951
|
+
*
|
|
5952
|
+
* async function main() {
|
|
5953
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5954
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5955
|
+
* scopes: [
|
|
5956
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5957
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
5958
|
+
* ],
|
|
5959
|
+
* });
|
|
5960
|
+
*
|
|
5961
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5962
|
+
* const authClient = await auth.getClient();
|
|
5963
|
+
* google.options({auth: authClient});
|
|
5964
|
+
*
|
|
5965
|
+
* // Do the magic
|
|
5966
|
+
* const res = await vision.projects.files.asyncBatchAnnotate({
|
|
5967
|
+
* // 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`.
|
|
5968
|
+
* parent: 'projects/my-project',
|
|
5969
|
+
*
|
|
5970
|
+
* // Request body metadata
|
|
5971
|
+
* requestBody: {
|
|
5972
|
+
* // request body parameters
|
|
5973
|
+
* // {
|
|
5974
|
+
* // "labels": {},
|
|
5975
|
+
* // "parent": "my_parent",
|
|
5976
|
+
* // "requests": []
|
|
5977
|
+
* // }
|
|
5978
|
+
* },
|
|
5979
|
+
* });
|
|
5980
|
+
* console.log(res.data);
|
|
5981
|
+
*
|
|
5982
|
+
* // Example response
|
|
5983
|
+
* // {
|
|
5984
|
+
* // "done": false,
|
|
5985
|
+
* // "error": {},
|
|
5986
|
+
* // "metadata": {},
|
|
5987
|
+
* // "name": "my_name",
|
|
5988
|
+
* // "response": {}
|
|
5989
|
+
* // }
|
|
5990
|
+
* }
|
|
5991
|
+
*
|
|
5992
|
+
* main().catch(e => {
|
|
5993
|
+
* console.error(e);
|
|
5994
|
+
* throw e;
|
|
5995
|
+
* });
|
|
5996
|
+
*
|
|
5997
|
+
* ```
|
|
5381
5998
|
*
|
|
5382
5999
|
* @param params - Parameters for request
|
|
5383
6000
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5384
6001
|
* @param callback - Optional callback that handles the response.
|
|
5385
6002
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5386
6003
|
*/
|
|
5387
|
-
asyncBatchAnnotate(params: Params$Resource$Projects$Files$Asyncbatchannotate, options: StreamMethodOptions):
|
|
5388
|
-
asyncBatchAnnotate(params?: Params$Resource$Projects$Files$Asyncbatchannotate, options?: MethodOptions):
|
|
6004
|
+
asyncBatchAnnotate(params: Params$Resource$Projects$Files$Asyncbatchannotate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6005
|
+
asyncBatchAnnotate(params?: Params$Resource$Projects$Files$Asyncbatchannotate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5389
6006
|
asyncBatchAnnotate(params: Params$Resource$Projects$Files$Asyncbatchannotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5390
6007
|
asyncBatchAnnotate(params: Params$Resource$Projects$Files$Asyncbatchannotate, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5391
6008
|
asyncBatchAnnotate(params: Params$Resource$Projects$Files$Asyncbatchannotate, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
@@ -5416,28 +6033,151 @@ export declare namespace vision_v1 {
|
|
|
5416
6033
|
constructor(context: APIRequestContext);
|
|
5417
6034
|
/**
|
|
5418
6035
|
* Run image detection and annotation for a batch of images.
|
|
6036
|
+
* @example
|
|
6037
|
+
* ```js
|
|
6038
|
+
* // Before running the sample:
|
|
6039
|
+
* // - Enable the API at:
|
|
6040
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6041
|
+
* // - Login into gcloud by running:
|
|
6042
|
+
* // ```sh
|
|
6043
|
+
* // $ gcloud auth application-default login
|
|
6044
|
+
* // ```
|
|
6045
|
+
* // - Install the npm module by running:
|
|
6046
|
+
* // ```sh
|
|
6047
|
+
* // $ npm install googleapis
|
|
6048
|
+
* // ```
|
|
6049
|
+
*
|
|
6050
|
+
* const {google} = require('googleapis');
|
|
6051
|
+
* const vision = google.vision('v1');
|
|
6052
|
+
*
|
|
6053
|
+
* async function main() {
|
|
6054
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6055
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6056
|
+
* scopes: [
|
|
6057
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6058
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6059
|
+
* ],
|
|
6060
|
+
* });
|
|
6061
|
+
*
|
|
6062
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6063
|
+
* const authClient = await auth.getClient();
|
|
6064
|
+
* google.options({auth: authClient});
|
|
6065
|
+
*
|
|
6066
|
+
* // Do the magic
|
|
6067
|
+
* const res = await vision.projects.images.annotate({
|
|
6068
|
+
* // 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`.
|
|
6069
|
+
* parent: 'projects/my-project',
|
|
6070
|
+
*
|
|
6071
|
+
* // Request body metadata
|
|
6072
|
+
* requestBody: {
|
|
6073
|
+
* // request body parameters
|
|
6074
|
+
* // {
|
|
6075
|
+
* // "labels": {},
|
|
6076
|
+
* // "parent": "my_parent",
|
|
6077
|
+
* // "requests": []
|
|
6078
|
+
* // }
|
|
6079
|
+
* },
|
|
6080
|
+
* });
|
|
6081
|
+
* console.log(res.data);
|
|
6082
|
+
*
|
|
6083
|
+
* // Example response
|
|
6084
|
+
* // {
|
|
6085
|
+
* // "responses": []
|
|
6086
|
+
* // }
|
|
6087
|
+
* }
|
|
6088
|
+
*
|
|
6089
|
+
* main().catch(e => {
|
|
6090
|
+
* console.error(e);
|
|
6091
|
+
* throw e;
|
|
6092
|
+
* });
|
|
6093
|
+
*
|
|
6094
|
+
* ```
|
|
5419
6095
|
*
|
|
5420
6096
|
* @param params - Parameters for request
|
|
5421
6097
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5422
6098
|
* @param callback - Optional callback that handles the response.
|
|
5423
6099
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5424
6100
|
*/
|
|
5425
|
-
annotate(params: Params$Resource$Projects$Images$Annotate, options: StreamMethodOptions):
|
|
5426
|
-
annotate(params?: Params$Resource$Projects$Images$Annotate, options?: MethodOptions):
|
|
6101
|
+
annotate(params: Params$Resource$Projects$Images$Annotate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6102
|
+
annotate(params?: Params$Resource$Projects$Images$Annotate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateImagesResponse>>;
|
|
5427
6103
|
annotate(params: Params$Resource$Projects$Images$Annotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5428
6104
|
annotate(params: Params$Resource$Projects$Images$Annotate, options: MethodOptions | BodyResponseCallback<Schema$BatchAnnotateImagesResponse>, callback: BodyResponseCallback<Schema$BatchAnnotateImagesResponse>): void;
|
|
5429
6105
|
annotate(params: Params$Resource$Projects$Images$Annotate, callback: BodyResponseCallback<Schema$BatchAnnotateImagesResponse>): void;
|
|
5430
6106
|
annotate(callback: BodyResponseCallback<Schema$BatchAnnotateImagesResponse>): void;
|
|
5431
6107
|
/**
|
|
5432
6108
|
* 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.
|
|
6109
|
+
* @example
|
|
6110
|
+
* ```js
|
|
6111
|
+
* // Before running the sample:
|
|
6112
|
+
* // - Enable the API at:
|
|
6113
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6114
|
+
* // - Login into gcloud by running:
|
|
6115
|
+
* // ```sh
|
|
6116
|
+
* // $ gcloud auth application-default login
|
|
6117
|
+
* // ```
|
|
6118
|
+
* // - Install the npm module by running:
|
|
6119
|
+
* // ```sh
|
|
6120
|
+
* // $ npm install googleapis
|
|
6121
|
+
* // ```
|
|
6122
|
+
*
|
|
6123
|
+
* const {google} = require('googleapis');
|
|
6124
|
+
* const vision = google.vision('v1');
|
|
6125
|
+
*
|
|
6126
|
+
* async function main() {
|
|
6127
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6128
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6129
|
+
* scopes: [
|
|
6130
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6131
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6132
|
+
* ],
|
|
6133
|
+
* });
|
|
6134
|
+
*
|
|
6135
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6136
|
+
* const authClient = await auth.getClient();
|
|
6137
|
+
* google.options({auth: authClient});
|
|
6138
|
+
*
|
|
6139
|
+
* // Do the magic
|
|
6140
|
+
* const res = await vision.projects.images.asyncBatchAnnotate({
|
|
6141
|
+
* // 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`.
|
|
6142
|
+
* parent: 'projects/my-project',
|
|
6143
|
+
*
|
|
6144
|
+
* // Request body metadata
|
|
6145
|
+
* requestBody: {
|
|
6146
|
+
* // request body parameters
|
|
6147
|
+
* // {
|
|
6148
|
+
* // "labels": {},
|
|
6149
|
+
* // "outputConfig": {},
|
|
6150
|
+
* // "parent": "my_parent",
|
|
6151
|
+
* // "requests": []
|
|
6152
|
+
* // }
|
|
6153
|
+
* },
|
|
6154
|
+
* });
|
|
6155
|
+
* console.log(res.data);
|
|
6156
|
+
*
|
|
6157
|
+
* // Example response
|
|
6158
|
+
* // {
|
|
6159
|
+
* // "done": false,
|
|
6160
|
+
* // "error": {},
|
|
6161
|
+
* // "metadata": {},
|
|
6162
|
+
* // "name": "my_name",
|
|
6163
|
+
* // "response": {}
|
|
6164
|
+
* // }
|
|
6165
|
+
* }
|
|
6166
|
+
*
|
|
6167
|
+
* main().catch(e => {
|
|
6168
|
+
* console.error(e);
|
|
6169
|
+
* throw e;
|
|
6170
|
+
* });
|
|
6171
|
+
*
|
|
6172
|
+
* ```
|
|
5433
6173
|
*
|
|
5434
6174
|
* @param params - Parameters for request
|
|
5435
6175
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5436
6176
|
* @param callback - Optional callback that handles the response.
|
|
5437
6177
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5438
6178
|
*/
|
|
5439
|
-
asyncBatchAnnotate(params: Params$Resource$Projects$Images$Asyncbatchannotate, options: StreamMethodOptions):
|
|
5440
|
-
asyncBatchAnnotate(params?: Params$Resource$Projects$Images$Asyncbatchannotate, options?: MethodOptions):
|
|
6179
|
+
asyncBatchAnnotate(params: Params$Resource$Projects$Images$Asyncbatchannotate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6180
|
+
asyncBatchAnnotate(params?: Params$Resource$Projects$Images$Asyncbatchannotate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5441
6181
|
asyncBatchAnnotate(params: Params$Resource$Projects$Images$Asyncbatchannotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5442
6182
|
asyncBatchAnnotate(params: Params$Resource$Projects$Images$Asyncbatchannotate, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5443
6183
|
asyncBatchAnnotate(params: Params$Resource$Projects$Images$Asyncbatchannotate, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
@@ -5477,28 +6217,150 @@ export declare namespace vision_v1 {
|
|
|
5477
6217
|
constructor(context: APIRequestContext);
|
|
5478
6218
|
/**
|
|
5479
6219
|
* 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.
|
|
6220
|
+
* @example
|
|
6221
|
+
* ```js
|
|
6222
|
+
* // Before running the sample:
|
|
6223
|
+
* // - Enable the API at:
|
|
6224
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6225
|
+
* // - Login into gcloud by running:
|
|
6226
|
+
* // ```sh
|
|
6227
|
+
* // $ gcloud auth application-default login
|
|
6228
|
+
* // ```
|
|
6229
|
+
* // - Install the npm module by running:
|
|
6230
|
+
* // ```sh
|
|
6231
|
+
* // $ npm install googleapis
|
|
6232
|
+
* // ```
|
|
6233
|
+
*
|
|
6234
|
+
* const {google} = require('googleapis');
|
|
6235
|
+
* const vision = google.vision('v1');
|
|
6236
|
+
*
|
|
6237
|
+
* async function main() {
|
|
6238
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6239
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6240
|
+
* scopes: [
|
|
6241
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6242
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6243
|
+
* ],
|
|
6244
|
+
* });
|
|
6245
|
+
*
|
|
6246
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6247
|
+
* const authClient = await auth.getClient();
|
|
6248
|
+
* google.options({auth: authClient});
|
|
6249
|
+
*
|
|
6250
|
+
* // Do the magic
|
|
6251
|
+
* const res = await vision.projects.locations.files.annotate({
|
|
6252
|
+
* // 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`.
|
|
6253
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
6254
|
+
*
|
|
6255
|
+
* // Request body metadata
|
|
6256
|
+
* requestBody: {
|
|
6257
|
+
* // request body parameters
|
|
6258
|
+
* // {
|
|
6259
|
+
* // "labels": {},
|
|
6260
|
+
* // "parent": "my_parent",
|
|
6261
|
+
* // "requests": []
|
|
6262
|
+
* // }
|
|
6263
|
+
* },
|
|
6264
|
+
* });
|
|
6265
|
+
* console.log(res.data);
|
|
6266
|
+
*
|
|
6267
|
+
* // Example response
|
|
6268
|
+
* // {
|
|
6269
|
+
* // "responses": []
|
|
6270
|
+
* // }
|
|
6271
|
+
* }
|
|
6272
|
+
*
|
|
6273
|
+
* main().catch(e => {
|
|
6274
|
+
* console.error(e);
|
|
6275
|
+
* throw e;
|
|
6276
|
+
* });
|
|
6277
|
+
*
|
|
6278
|
+
* ```
|
|
5480
6279
|
*
|
|
5481
6280
|
* @param params - Parameters for request
|
|
5482
6281
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5483
6282
|
* @param callback - Optional callback that handles the response.
|
|
5484
6283
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5485
6284
|
*/
|
|
5486
|
-
annotate(params: Params$Resource$Projects$Locations$Files$Annotate, options: StreamMethodOptions):
|
|
5487
|
-
annotate(params?: Params$Resource$Projects$Locations$Files$Annotate, options?: MethodOptions):
|
|
6285
|
+
annotate(params: Params$Resource$Projects$Locations$Files$Annotate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6286
|
+
annotate(params?: Params$Resource$Projects$Locations$Files$Annotate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateFilesResponse>>;
|
|
5488
6287
|
annotate(params: Params$Resource$Projects$Locations$Files$Annotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5489
6288
|
annotate(params: Params$Resource$Projects$Locations$Files$Annotate, options: MethodOptions | BodyResponseCallback<Schema$BatchAnnotateFilesResponse>, callback: BodyResponseCallback<Schema$BatchAnnotateFilesResponse>): void;
|
|
5490
6289
|
annotate(params: Params$Resource$Projects$Locations$Files$Annotate, callback: BodyResponseCallback<Schema$BatchAnnotateFilesResponse>): void;
|
|
5491
6290
|
annotate(callback: BodyResponseCallback<Schema$BatchAnnotateFilesResponse>): void;
|
|
5492
6291
|
/**
|
|
5493
6292
|
* 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).
|
|
6293
|
+
* @example
|
|
6294
|
+
* ```js
|
|
6295
|
+
* // Before running the sample:
|
|
6296
|
+
* // - Enable the API at:
|
|
6297
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6298
|
+
* // - Login into gcloud by running:
|
|
6299
|
+
* // ```sh
|
|
6300
|
+
* // $ gcloud auth application-default login
|
|
6301
|
+
* // ```
|
|
6302
|
+
* // - Install the npm module by running:
|
|
6303
|
+
* // ```sh
|
|
6304
|
+
* // $ npm install googleapis
|
|
6305
|
+
* // ```
|
|
6306
|
+
*
|
|
6307
|
+
* const {google} = require('googleapis');
|
|
6308
|
+
* const vision = google.vision('v1');
|
|
6309
|
+
*
|
|
6310
|
+
* async function main() {
|
|
6311
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6312
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6313
|
+
* scopes: [
|
|
6314
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6315
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6316
|
+
* ],
|
|
6317
|
+
* });
|
|
6318
|
+
*
|
|
6319
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6320
|
+
* const authClient = await auth.getClient();
|
|
6321
|
+
* google.options({auth: authClient});
|
|
6322
|
+
*
|
|
6323
|
+
* // Do the magic
|
|
6324
|
+
* const res = await vision.projects.locations.files.asyncBatchAnnotate({
|
|
6325
|
+
* // 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`.
|
|
6326
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
6327
|
+
*
|
|
6328
|
+
* // Request body metadata
|
|
6329
|
+
* requestBody: {
|
|
6330
|
+
* // request body parameters
|
|
6331
|
+
* // {
|
|
6332
|
+
* // "labels": {},
|
|
6333
|
+
* // "parent": "my_parent",
|
|
6334
|
+
* // "requests": []
|
|
6335
|
+
* // }
|
|
6336
|
+
* },
|
|
6337
|
+
* });
|
|
6338
|
+
* console.log(res.data);
|
|
6339
|
+
*
|
|
6340
|
+
* // Example response
|
|
6341
|
+
* // {
|
|
6342
|
+
* // "done": false,
|
|
6343
|
+
* // "error": {},
|
|
6344
|
+
* // "metadata": {},
|
|
6345
|
+
* // "name": "my_name",
|
|
6346
|
+
* // "response": {}
|
|
6347
|
+
* // }
|
|
6348
|
+
* }
|
|
6349
|
+
*
|
|
6350
|
+
* main().catch(e => {
|
|
6351
|
+
* console.error(e);
|
|
6352
|
+
* throw e;
|
|
6353
|
+
* });
|
|
6354
|
+
*
|
|
6355
|
+
* ```
|
|
5494
6356
|
*
|
|
5495
6357
|
* @param params - Parameters for request
|
|
5496
6358
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5497
6359
|
* @param callback - Optional callback that handles the response.
|
|
5498
6360
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5499
6361
|
*/
|
|
5500
|
-
asyncBatchAnnotate(params: Params$Resource$Projects$Locations$Files$Asyncbatchannotate, options: StreamMethodOptions):
|
|
5501
|
-
asyncBatchAnnotate(params?: Params$Resource$Projects$Locations$Files$Asyncbatchannotate, options?: MethodOptions):
|
|
6362
|
+
asyncBatchAnnotate(params: Params$Resource$Projects$Locations$Files$Asyncbatchannotate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6363
|
+
asyncBatchAnnotate(params?: Params$Resource$Projects$Locations$Files$Asyncbatchannotate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5502
6364
|
asyncBatchAnnotate(params: Params$Resource$Projects$Locations$Files$Asyncbatchannotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5503
6365
|
asyncBatchAnnotate(params: Params$Resource$Projects$Locations$Files$Asyncbatchannotate, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5504
6366
|
asyncBatchAnnotate(params: Params$Resource$Projects$Locations$Files$Asyncbatchannotate, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
@@ -5529,28 +6391,151 @@ export declare namespace vision_v1 {
|
|
|
5529
6391
|
constructor(context: APIRequestContext);
|
|
5530
6392
|
/**
|
|
5531
6393
|
* Run image detection and annotation for a batch of images.
|
|
6394
|
+
* @example
|
|
6395
|
+
* ```js
|
|
6396
|
+
* // Before running the sample:
|
|
6397
|
+
* // - Enable the API at:
|
|
6398
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6399
|
+
* // - Login into gcloud by running:
|
|
6400
|
+
* // ```sh
|
|
6401
|
+
* // $ gcloud auth application-default login
|
|
6402
|
+
* // ```
|
|
6403
|
+
* // - Install the npm module by running:
|
|
6404
|
+
* // ```sh
|
|
6405
|
+
* // $ npm install googleapis
|
|
6406
|
+
* // ```
|
|
6407
|
+
*
|
|
6408
|
+
* const {google} = require('googleapis');
|
|
6409
|
+
* const vision = google.vision('v1');
|
|
6410
|
+
*
|
|
6411
|
+
* async function main() {
|
|
6412
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6413
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6414
|
+
* scopes: [
|
|
6415
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6416
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6417
|
+
* ],
|
|
6418
|
+
* });
|
|
6419
|
+
*
|
|
6420
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6421
|
+
* const authClient = await auth.getClient();
|
|
6422
|
+
* google.options({auth: authClient});
|
|
6423
|
+
*
|
|
6424
|
+
* // Do the magic
|
|
6425
|
+
* const res = await vision.projects.locations.images.annotate({
|
|
6426
|
+
* // 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`.
|
|
6427
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
6428
|
+
*
|
|
6429
|
+
* // Request body metadata
|
|
6430
|
+
* requestBody: {
|
|
6431
|
+
* // request body parameters
|
|
6432
|
+
* // {
|
|
6433
|
+
* // "labels": {},
|
|
6434
|
+
* // "parent": "my_parent",
|
|
6435
|
+
* // "requests": []
|
|
6436
|
+
* // }
|
|
6437
|
+
* },
|
|
6438
|
+
* });
|
|
6439
|
+
* console.log(res.data);
|
|
6440
|
+
*
|
|
6441
|
+
* // Example response
|
|
6442
|
+
* // {
|
|
6443
|
+
* // "responses": []
|
|
6444
|
+
* // }
|
|
6445
|
+
* }
|
|
6446
|
+
*
|
|
6447
|
+
* main().catch(e => {
|
|
6448
|
+
* console.error(e);
|
|
6449
|
+
* throw e;
|
|
6450
|
+
* });
|
|
6451
|
+
*
|
|
6452
|
+
* ```
|
|
5532
6453
|
*
|
|
5533
6454
|
* @param params - Parameters for request
|
|
5534
6455
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5535
6456
|
* @param callback - Optional callback that handles the response.
|
|
5536
6457
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5537
6458
|
*/
|
|
5538
|
-
annotate(params: Params$Resource$Projects$Locations$Images$Annotate, options: StreamMethodOptions):
|
|
5539
|
-
annotate(params?: Params$Resource$Projects$Locations$Images$Annotate, options?: MethodOptions):
|
|
6459
|
+
annotate(params: Params$Resource$Projects$Locations$Images$Annotate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6460
|
+
annotate(params?: Params$Resource$Projects$Locations$Images$Annotate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$BatchAnnotateImagesResponse>>;
|
|
5540
6461
|
annotate(params: Params$Resource$Projects$Locations$Images$Annotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5541
6462
|
annotate(params: Params$Resource$Projects$Locations$Images$Annotate, options: MethodOptions | BodyResponseCallback<Schema$BatchAnnotateImagesResponse>, callback: BodyResponseCallback<Schema$BatchAnnotateImagesResponse>): void;
|
|
5542
6463
|
annotate(params: Params$Resource$Projects$Locations$Images$Annotate, callback: BodyResponseCallback<Schema$BatchAnnotateImagesResponse>): void;
|
|
5543
6464
|
annotate(callback: BodyResponseCallback<Schema$BatchAnnotateImagesResponse>): void;
|
|
5544
6465
|
/**
|
|
5545
6466
|
* 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.
|
|
6467
|
+
* @example
|
|
6468
|
+
* ```js
|
|
6469
|
+
* // Before running the sample:
|
|
6470
|
+
* // - Enable the API at:
|
|
6471
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6472
|
+
* // - Login into gcloud by running:
|
|
6473
|
+
* // ```sh
|
|
6474
|
+
* // $ gcloud auth application-default login
|
|
6475
|
+
* // ```
|
|
6476
|
+
* // - Install the npm module by running:
|
|
6477
|
+
* // ```sh
|
|
6478
|
+
* // $ npm install googleapis
|
|
6479
|
+
* // ```
|
|
6480
|
+
*
|
|
6481
|
+
* const {google} = require('googleapis');
|
|
6482
|
+
* const vision = google.vision('v1');
|
|
6483
|
+
*
|
|
6484
|
+
* async function main() {
|
|
6485
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6486
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6487
|
+
* scopes: [
|
|
6488
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6489
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6490
|
+
* ],
|
|
6491
|
+
* });
|
|
6492
|
+
*
|
|
6493
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6494
|
+
* const authClient = await auth.getClient();
|
|
6495
|
+
* google.options({auth: authClient});
|
|
6496
|
+
*
|
|
6497
|
+
* // Do the magic
|
|
6498
|
+
* const res = await vision.projects.locations.images.asyncBatchAnnotate({
|
|
6499
|
+
* // 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`.
|
|
6500
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
6501
|
+
*
|
|
6502
|
+
* // Request body metadata
|
|
6503
|
+
* requestBody: {
|
|
6504
|
+
* // request body parameters
|
|
6505
|
+
* // {
|
|
6506
|
+
* // "labels": {},
|
|
6507
|
+
* // "outputConfig": {},
|
|
6508
|
+
* // "parent": "my_parent",
|
|
6509
|
+
* // "requests": []
|
|
6510
|
+
* // }
|
|
6511
|
+
* },
|
|
6512
|
+
* });
|
|
6513
|
+
* console.log(res.data);
|
|
6514
|
+
*
|
|
6515
|
+
* // Example response
|
|
6516
|
+
* // {
|
|
6517
|
+
* // "done": false,
|
|
6518
|
+
* // "error": {},
|
|
6519
|
+
* // "metadata": {},
|
|
6520
|
+
* // "name": "my_name",
|
|
6521
|
+
* // "response": {}
|
|
6522
|
+
* // }
|
|
6523
|
+
* }
|
|
6524
|
+
*
|
|
6525
|
+
* main().catch(e => {
|
|
6526
|
+
* console.error(e);
|
|
6527
|
+
* throw e;
|
|
6528
|
+
* });
|
|
6529
|
+
*
|
|
6530
|
+
* ```
|
|
5546
6531
|
*
|
|
5547
6532
|
* @param params - Parameters for request
|
|
5548
6533
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5549
6534
|
* @param callback - Optional callback that handles the response.
|
|
5550
6535
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5551
6536
|
*/
|
|
5552
|
-
asyncBatchAnnotate(params: Params$Resource$Projects$Locations$Images$Asyncbatchannotate, options: StreamMethodOptions):
|
|
5553
|
-
asyncBatchAnnotate(params?: Params$Resource$Projects$Locations$Images$Asyncbatchannotate, options?: MethodOptions):
|
|
6537
|
+
asyncBatchAnnotate(params: Params$Resource$Projects$Locations$Images$Asyncbatchannotate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6538
|
+
asyncBatchAnnotate(params?: Params$Resource$Projects$Locations$Images$Asyncbatchannotate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5554
6539
|
asyncBatchAnnotate(params: Params$Resource$Projects$Locations$Images$Asyncbatchannotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5555
6540
|
asyncBatchAnnotate(params: Params$Resource$Projects$Locations$Images$Asyncbatchannotate, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5556
6541
|
asyncBatchAnnotate(params: Params$Resource$Projects$Locations$Images$Asyncbatchannotate, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
@@ -5581,14 +6566,67 @@ export declare namespace vision_v1 {
|
|
|
5581
6566
|
constructor(context: APIRequestContext);
|
|
5582
6567
|
/**
|
|
5583
6568
|
* Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
|
6569
|
+
* @example
|
|
6570
|
+
* ```js
|
|
6571
|
+
* // Before running the sample:
|
|
6572
|
+
* // - Enable the API at:
|
|
6573
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6574
|
+
* // - Login into gcloud by running:
|
|
6575
|
+
* // ```sh
|
|
6576
|
+
* // $ gcloud auth application-default login
|
|
6577
|
+
* // ```
|
|
6578
|
+
* // - Install the npm module by running:
|
|
6579
|
+
* // ```sh
|
|
6580
|
+
* // $ npm install googleapis
|
|
6581
|
+
* // ```
|
|
6582
|
+
*
|
|
6583
|
+
* const {google} = require('googleapis');
|
|
6584
|
+
* const vision = google.vision('v1');
|
|
6585
|
+
*
|
|
6586
|
+
* async function main() {
|
|
6587
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6588
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6589
|
+
* scopes: [
|
|
6590
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6591
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6592
|
+
* ],
|
|
6593
|
+
* });
|
|
6594
|
+
*
|
|
6595
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6596
|
+
* const authClient = await auth.getClient();
|
|
6597
|
+
* google.options({auth: authClient});
|
|
6598
|
+
*
|
|
6599
|
+
* // Do the magic
|
|
6600
|
+
* const res = await vision.projects.locations.operations.get({
|
|
6601
|
+
* // The name of the operation resource.
|
|
6602
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
6603
|
+
* });
|
|
6604
|
+
* console.log(res.data);
|
|
6605
|
+
*
|
|
6606
|
+
* // Example response
|
|
6607
|
+
* // {
|
|
6608
|
+
* // "done": false,
|
|
6609
|
+
* // "error": {},
|
|
6610
|
+
* // "metadata": {},
|
|
6611
|
+
* // "name": "my_name",
|
|
6612
|
+
* // "response": {}
|
|
6613
|
+
* // }
|
|
6614
|
+
* }
|
|
6615
|
+
*
|
|
6616
|
+
* main().catch(e => {
|
|
6617
|
+
* console.error(e);
|
|
6618
|
+
* throw e;
|
|
6619
|
+
* });
|
|
6620
|
+
*
|
|
6621
|
+
* ```
|
|
5584
6622
|
*
|
|
5585
6623
|
* @param params - Parameters for request
|
|
5586
6624
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5587
6625
|
* @param callback - Optional callback that handles the response.
|
|
5588
6626
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5589
6627
|
*/
|
|
5590
|
-
get(params: Params$Resource$Projects$Locations$Operations$Get, options: StreamMethodOptions):
|
|
5591
|
-
get(params?: Params$Resource$Projects$Locations$Operations$Get, options?: MethodOptions):
|
|
6628
|
+
get(params: Params$Resource$Projects$Locations$Operations$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6629
|
+
get(params?: Params$Resource$Projects$Locations$Operations$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5592
6630
|
get(params: Params$Resource$Projects$Locations$Operations$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5593
6631
|
get(params: Params$Resource$Projects$Locations$Operations$Get, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5594
6632
|
get(params: Params$Resource$Projects$Locations$Operations$Get, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
@@ -5606,84 +6644,435 @@ export declare namespace vision_v1 {
|
|
|
5606
6644
|
constructor(context: APIRequestContext);
|
|
5607
6645
|
/**
|
|
5608
6646
|
* Creates and returns a new product resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid.
|
|
6647
|
+
* @example
|
|
6648
|
+
* ```js
|
|
6649
|
+
* // Before running the sample:
|
|
6650
|
+
* // - Enable the API at:
|
|
6651
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6652
|
+
* // - Login into gcloud by running:
|
|
6653
|
+
* // ```sh
|
|
6654
|
+
* // $ gcloud auth application-default login
|
|
6655
|
+
* // ```
|
|
6656
|
+
* // - Install the npm module by running:
|
|
6657
|
+
* // ```sh
|
|
6658
|
+
* // $ npm install googleapis
|
|
6659
|
+
* // ```
|
|
6660
|
+
*
|
|
6661
|
+
* const {google} = require('googleapis');
|
|
6662
|
+
* const vision = google.vision('v1');
|
|
6663
|
+
*
|
|
6664
|
+
* async function main() {
|
|
6665
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6666
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6667
|
+
* scopes: [
|
|
6668
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6669
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6670
|
+
* ],
|
|
6671
|
+
* });
|
|
6672
|
+
*
|
|
6673
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6674
|
+
* const authClient = await auth.getClient();
|
|
6675
|
+
* google.options({auth: authClient});
|
|
6676
|
+
*
|
|
6677
|
+
* // Do the magic
|
|
6678
|
+
* const res = await vision.projects.locations.products.create({
|
|
6679
|
+
* // Required. The project in which the Product should be created. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
6680
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
6681
|
+
* // A user-supplied resource id for this Product. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character `/`.
|
|
6682
|
+
* productId: 'placeholder-value',
|
|
6683
|
+
*
|
|
6684
|
+
* // Request body metadata
|
|
6685
|
+
* requestBody: {
|
|
6686
|
+
* // request body parameters
|
|
6687
|
+
* // {
|
|
6688
|
+
* // "description": "my_description",
|
|
6689
|
+
* // "displayName": "my_displayName",
|
|
6690
|
+
* // "name": "my_name",
|
|
6691
|
+
* // "productCategory": "my_productCategory",
|
|
6692
|
+
* // "productLabels": []
|
|
6693
|
+
* // }
|
|
6694
|
+
* },
|
|
6695
|
+
* });
|
|
6696
|
+
* console.log(res.data);
|
|
6697
|
+
*
|
|
6698
|
+
* // Example response
|
|
6699
|
+
* // {
|
|
6700
|
+
* // "description": "my_description",
|
|
6701
|
+
* // "displayName": "my_displayName",
|
|
6702
|
+
* // "name": "my_name",
|
|
6703
|
+
* // "productCategory": "my_productCategory",
|
|
6704
|
+
* // "productLabels": []
|
|
6705
|
+
* // }
|
|
6706
|
+
* }
|
|
6707
|
+
*
|
|
6708
|
+
* main().catch(e => {
|
|
6709
|
+
* console.error(e);
|
|
6710
|
+
* throw e;
|
|
6711
|
+
* });
|
|
6712
|
+
*
|
|
6713
|
+
* ```
|
|
5609
6714
|
*
|
|
5610
6715
|
* @param params - Parameters for request
|
|
5611
6716
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5612
6717
|
* @param callback - Optional callback that handles the response.
|
|
5613
6718
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5614
6719
|
*/
|
|
5615
|
-
create(params: Params$Resource$Projects$Locations$Products$Create, options: StreamMethodOptions):
|
|
5616
|
-
create(params?: Params$Resource$Projects$Locations$Products$Create, options?: MethodOptions):
|
|
6720
|
+
create(params: Params$Resource$Projects$Locations$Products$Create, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6721
|
+
create(params?: Params$Resource$Projects$Locations$Products$Create, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Product>>;
|
|
5617
6722
|
create(params: Params$Resource$Projects$Locations$Products$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5618
6723
|
create(params: Params$Resource$Projects$Locations$Products$Create, options: MethodOptions | BodyResponseCallback<Schema$Product>, callback: BodyResponseCallback<Schema$Product>): void;
|
|
5619
6724
|
create(params: Params$Resource$Projects$Locations$Products$Create, callback: BodyResponseCallback<Schema$Product>): void;
|
|
5620
6725
|
create(callback: BodyResponseCallback<Schema$Product>): void;
|
|
5621
6726
|
/**
|
|
5622
6727
|
* Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.
|
|
6728
|
+
* @example
|
|
6729
|
+
* ```js
|
|
6730
|
+
* // Before running the sample:
|
|
6731
|
+
* // - Enable the API at:
|
|
6732
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6733
|
+
* // - Login into gcloud by running:
|
|
6734
|
+
* // ```sh
|
|
6735
|
+
* // $ gcloud auth application-default login
|
|
6736
|
+
* // ```
|
|
6737
|
+
* // - Install the npm module by running:
|
|
6738
|
+
* // ```sh
|
|
6739
|
+
* // $ npm install googleapis
|
|
6740
|
+
* // ```
|
|
6741
|
+
*
|
|
6742
|
+
* const {google} = require('googleapis');
|
|
6743
|
+
* const vision = google.vision('v1');
|
|
6744
|
+
*
|
|
6745
|
+
* async function main() {
|
|
6746
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6747
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6748
|
+
* scopes: [
|
|
6749
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6750
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6751
|
+
* ],
|
|
6752
|
+
* });
|
|
6753
|
+
*
|
|
6754
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6755
|
+
* const authClient = await auth.getClient();
|
|
6756
|
+
* google.options({auth: authClient});
|
|
6757
|
+
*
|
|
6758
|
+
* // Do the magic
|
|
6759
|
+
* const res = await vision.projects.locations.products.delete({
|
|
6760
|
+
* // Required. Resource name of product to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
|
|
6761
|
+
* name: 'projects/my-project/locations/my-location/products/my-product',
|
|
6762
|
+
* });
|
|
6763
|
+
* console.log(res.data);
|
|
6764
|
+
*
|
|
6765
|
+
* // Example response
|
|
6766
|
+
* // {}
|
|
6767
|
+
* }
|
|
6768
|
+
*
|
|
6769
|
+
* main().catch(e => {
|
|
6770
|
+
* console.error(e);
|
|
6771
|
+
* throw e;
|
|
6772
|
+
* });
|
|
6773
|
+
*
|
|
6774
|
+
* ```
|
|
5623
6775
|
*
|
|
5624
6776
|
* @param params - Parameters for request
|
|
5625
6777
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5626
6778
|
* @param callback - Optional callback that handles the response.
|
|
5627
6779
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5628
6780
|
*/
|
|
5629
|
-
delete(params: Params$Resource$Projects$Locations$Products$Delete, options: StreamMethodOptions):
|
|
5630
|
-
delete(params?: Params$Resource$Projects$Locations$Products$Delete, options?: MethodOptions):
|
|
6781
|
+
delete(params: Params$Resource$Projects$Locations$Products$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6782
|
+
delete(params?: Params$Resource$Projects$Locations$Products$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
5631
6783
|
delete(params: Params$Resource$Projects$Locations$Products$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5632
6784
|
delete(params: Params$Resource$Projects$Locations$Products$Delete, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5633
6785
|
delete(params: Params$Resource$Projects$Locations$Products$Delete, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5634
6786
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5635
6787
|
/**
|
|
5636
6788
|
* Gets information associated with a Product. Possible errors: * Returns NOT_FOUND if the Product does not exist.
|
|
6789
|
+
* @example
|
|
6790
|
+
* ```js
|
|
6791
|
+
* // Before running the sample:
|
|
6792
|
+
* // - Enable the API at:
|
|
6793
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6794
|
+
* // - Login into gcloud by running:
|
|
6795
|
+
* // ```sh
|
|
6796
|
+
* // $ gcloud auth application-default login
|
|
6797
|
+
* // ```
|
|
6798
|
+
* // - Install the npm module by running:
|
|
6799
|
+
* // ```sh
|
|
6800
|
+
* // $ npm install googleapis
|
|
6801
|
+
* // ```
|
|
6802
|
+
*
|
|
6803
|
+
* const {google} = require('googleapis');
|
|
6804
|
+
* const vision = google.vision('v1');
|
|
6805
|
+
*
|
|
6806
|
+
* async function main() {
|
|
6807
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6808
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6809
|
+
* scopes: [
|
|
6810
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6811
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6812
|
+
* ],
|
|
6813
|
+
* });
|
|
6814
|
+
*
|
|
6815
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6816
|
+
* const authClient = await auth.getClient();
|
|
6817
|
+
* google.options({auth: authClient});
|
|
6818
|
+
*
|
|
6819
|
+
* // Do the magic
|
|
6820
|
+
* const res = await vision.projects.locations.products.get({
|
|
6821
|
+
* // Required. Resource name of the Product to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
|
|
6822
|
+
* name: 'projects/my-project/locations/my-location/products/my-product',
|
|
6823
|
+
* });
|
|
6824
|
+
* console.log(res.data);
|
|
6825
|
+
*
|
|
6826
|
+
* // Example response
|
|
6827
|
+
* // {
|
|
6828
|
+
* // "description": "my_description",
|
|
6829
|
+
* // "displayName": "my_displayName",
|
|
6830
|
+
* // "name": "my_name",
|
|
6831
|
+
* // "productCategory": "my_productCategory",
|
|
6832
|
+
* // "productLabels": []
|
|
6833
|
+
* // }
|
|
6834
|
+
* }
|
|
6835
|
+
*
|
|
6836
|
+
* main().catch(e => {
|
|
6837
|
+
* console.error(e);
|
|
6838
|
+
* throw e;
|
|
6839
|
+
* });
|
|
6840
|
+
*
|
|
6841
|
+
* ```
|
|
5637
6842
|
*
|
|
5638
6843
|
* @param params - Parameters for request
|
|
5639
6844
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5640
6845
|
* @param callback - Optional callback that handles the response.
|
|
5641
6846
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5642
6847
|
*/
|
|
5643
|
-
get(params: Params$Resource$Projects$Locations$Products$Get, options: StreamMethodOptions):
|
|
5644
|
-
get(params?: Params$Resource$Projects$Locations$Products$Get, options?: MethodOptions):
|
|
6848
|
+
get(params: Params$Resource$Projects$Locations$Products$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6849
|
+
get(params?: Params$Resource$Projects$Locations$Products$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Product>>;
|
|
5645
6850
|
get(params: Params$Resource$Projects$Locations$Products$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5646
6851
|
get(params: Params$Resource$Projects$Locations$Products$Get, options: MethodOptions | BodyResponseCallback<Schema$Product>, callback: BodyResponseCallback<Schema$Product>): void;
|
|
5647
6852
|
get(params: Params$Resource$Projects$Locations$Products$Get, callback: BodyResponseCallback<Schema$Product>): void;
|
|
5648
6853
|
get(callback: BodyResponseCallback<Schema$Product>): void;
|
|
5649
6854
|
/**
|
|
5650
6855
|
* Lists products in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
|
|
6856
|
+
* @example
|
|
6857
|
+
* ```js
|
|
6858
|
+
* // Before running the sample:
|
|
6859
|
+
* // - Enable the API at:
|
|
6860
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6861
|
+
* // - Login into gcloud by running:
|
|
6862
|
+
* // ```sh
|
|
6863
|
+
* // $ gcloud auth application-default login
|
|
6864
|
+
* // ```
|
|
6865
|
+
* // - Install the npm module by running:
|
|
6866
|
+
* // ```sh
|
|
6867
|
+
* // $ npm install googleapis
|
|
6868
|
+
* // ```
|
|
6869
|
+
*
|
|
6870
|
+
* const {google} = require('googleapis');
|
|
6871
|
+
* const vision = google.vision('v1');
|
|
6872
|
+
*
|
|
6873
|
+
* async function main() {
|
|
6874
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6875
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6876
|
+
* scopes: [
|
|
6877
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6878
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6879
|
+
* ],
|
|
6880
|
+
* });
|
|
6881
|
+
*
|
|
6882
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6883
|
+
* const authClient = await auth.getClient();
|
|
6884
|
+
* google.options({auth: authClient});
|
|
6885
|
+
*
|
|
6886
|
+
* // Do the magic
|
|
6887
|
+
* const res = await vision.projects.locations.products.list({
|
|
6888
|
+
* // The maximum number of items to return. Default 10, maximum 100.
|
|
6889
|
+
* pageSize: 'placeholder-value',
|
|
6890
|
+
* // The next_page_token returned from a previous List request, if any.
|
|
6891
|
+
* pageToken: 'placeholder-value',
|
|
6892
|
+
* // Required. The project OR ProductSet from which Products should be listed. Format: `projects/PROJECT_ID/locations/LOC_ID`
|
|
6893
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
6894
|
+
* });
|
|
6895
|
+
* console.log(res.data);
|
|
6896
|
+
*
|
|
6897
|
+
* // Example response
|
|
6898
|
+
* // {
|
|
6899
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
6900
|
+
* // "products": []
|
|
6901
|
+
* // }
|
|
6902
|
+
* }
|
|
6903
|
+
*
|
|
6904
|
+
* main().catch(e => {
|
|
6905
|
+
* console.error(e);
|
|
6906
|
+
* throw e;
|
|
6907
|
+
* });
|
|
6908
|
+
*
|
|
6909
|
+
* ```
|
|
5651
6910
|
*
|
|
5652
6911
|
* @param params - Parameters for request
|
|
5653
6912
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5654
6913
|
* @param callback - Optional callback that handles the response.
|
|
5655
6914
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5656
6915
|
*/
|
|
5657
|
-
list(params: Params$Resource$Projects$Locations$Products$List, options: StreamMethodOptions):
|
|
5658
|
-
list(params?: Params$Resource$Projects$Locations$Products$List, options?: MethodOptions):
|
|
6916
|
+
list(params: Params$Resource$Projects$Locations$Products$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6917
|
+
list(params?: Params$Resource$Projects$Locations$Products$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListProductsResponse>>;
|
|
5659
6918
|
list(params: Params$Resource$Projects$Locations$Products$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5660
6919
|
list(params: Params$Resource$Projects$Locations$Products$List, options: MethodOptions | BodyResponseCallback<Schema$ListProductsResponse>, callback: BodyResponseCallback<Schema$ListProductsResponse>): void;
|
|
5661
6920
|
list(params: Params$Resource$Projects$Locations$Products$List, callback: BodyResponseCallback<Schema$ListProductsResponse>): void;
|
|
5662
6921
|
list(callback: BodyResponseCallback<Schema$ListProductsResponse>): void;
|
|
5663
6922
|
/**
|
|
5664
6923
|
* Makes changes to a Product resource. Only the `display_name`, `description`, and `labels` fields can be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. Possible errors: * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask.
|
|
6924
|
+
* @example
|
|
6925
|
+
* ```js
|
|
6926
|
+
* // Before running the sample:
|
|
6927
|
+
* // - Enable the API at:
|
|
6928
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
6929
|
+
* // - Login into gcloud by running:
|
|
6930
|
+
* // ```sh
|
|
6931
|
+
* // $ gcloud auth application-default login
|
|
6932
|
+
* // ```
|
|
6933
|
+
* // - Install the npm module by running:
|
|
6934
|
+
* // ```sh
|
|
6935
|
+
* // $ npm install googleapis
|
|
6936
|
+
* // ```
|
|
6937
|
+
*
|
|
6938
|
+
* const {google} = require('googleapis');
|
|
6939
|
+
* const vision = google.vision('v1');
|
|
6940
|
+
*
|
|
6941
|
+
* async function main() {
|
|
6942
|
+
* const auth = new google.auth.GoogleAuth({
|
|
6943
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
6944
|
+
* scopes: [
|
|
6945
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
6946
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
6947
|
+
* ],
|
|
6948
|
+
* });
|
|
6949
|
+
*
|
|
6950
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
6951
|
+
* const authClient = await auth.getClient();
|
|
6952
|
+
* google.options({auth: authClient});
|
|
6953
|
+
*
|
|
6954
|
+
* // Do the magic
|
|
6955
|
+
* const res = await vision.projects.locations.products.patch({
|
|
6956
|
+
* // The resource name of the product. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. This field is ignored when creating a product.
|
|
6957
|
+
* name: 'projects/my-project/locations/my-location/products/my-product',
|
|
6958
|
+
* // The FieldMask that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include `product_labels`, `display_name`, and `description`.
|
|
6959
|
+
* updateMask: 'placeholder-value',
|
|
6960
|
+
*
|
|
6961
|
+
* // Request body metadata
|
|
6962
|
+
* requestBody: {
|
|
6963
|
+
* // request body parameters
|
|
6964
|
+
* // {
|
|
6965
|
+
* // "description": "my_description",
|
|
6966
|
+
* // "displayName": "my_displayName",
|
|
6967
|
+
* // "name": "my_name",
|
|
6968
|
+
* // "productCategory": "my_productCategory",
|
|
6969
|
+
* // "productLabels": []
|
|
6970
|
+
* // }
|
|
6971
|
+
* },
|
|
6972
|
+
* });
|
|
6973
|
+
* console.log(res.data);
|
|
6974
|
+
*
|
|
6975
|
+
* // Example response
|
|
6976
|
+
* // {
|
|
6977
|
+
* // "description": "my_description",
|
|
6978
|
+
* // "displayName": "my_displayName",
|
|
6979
|
+
* // "name": "my_name",
|
|
6980
|
+
* // "productCategory": "my_productCategory",
|
|
6981
|
+
* // "productLabels": []
|
|
6982
|
+
* // }
|
|
6983
|
+
* }
|
|
6984
|
+
*
|
|
6985
|
+
* main().catch(e => {
|
|
6986
|
+
* console.error(e);
|
|
6987
|
+
* throw e;
|
|
6988
|
+
* });
|
|
6989
|
+
*
|
|
6990
|
+
* ```
|
|
5665
6991
|
*
|
|
5666
6992
|
* @param params - Parameters for request
|
|
5667
6993
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5668
6994
|
* @param callback - Optional callback that handles the response.
|
|
5669
6995
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5670
6996
|
*/
|
|
5671
|
-
patch(params: Params$Resource$Projects$Locations$Products$Patch, options: StreamMethodOptions):
|
|
5672
|
-
patch(params?: Params$Resource$Projects$Locations$Products$Patch, options?: MethodOptions):
|
|
6997
|
+
patch(params: Params$Resource$Projects$Locations$Products$Patch, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
6998
|
+
patch(params?: Params$Resource$Projects$Locations$Products$Patch, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Product>>;
|
|
5673
6999
|
patch(params: Params$Resource$Projects$Locations$Products$Patch, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5674
7000
|
patch(params: Params$Resource$Projects$Locations$Products$Patch, options: MethodOptions | BodyResponseCallback<Schema$Product>, callback: BodyResponseCallback<Schema$Product>): void;
|
|
5675
7001
|
patch(params: Params$Resource$Projects$Locations$Products$Patch, callback: BodyResponseCallback<Schema$Product>): void;
|
|
5676
7002
|
patch(callback: BodyResponseCallback<Schema$Product>): void;
|
|
5677
7003
|
/**
|
|
5678
7004
|
* Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. `Operation.metadata` contains `BatchOperationMetadata`. (progress)
|
|
7005
|
+
* @example
|
|
7006
|
+
* ```js
|
|
7007
|
+
* // Before running the sample:
|
|
7008
|
+
* // - Enable the API at:
|
|
7009
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7010
|
+
* // - Login into gcloud by running:
|
|
7011
|
+
* // ```sh
|
|
7012
|
+
* // $ gcloud auth application-default login
|
|
7013
|
+
* // ```
|
|
7014
|
+
* // - Install the npm module by running:
|
|
7015
|
+
* // ```sh
|
|
7016
|
+
* // $ npm install googleapis
|
|
7017
|
+
* // ```
|
|
7018
|
+
*
|
|
7019
|
+
* const {google} = require('googleapis');
|
|
7020
|
+
* const vision = google.vision('v1');
|
|
7021
|
+
*
|
|
7022
|
+
* async function main() {
|
|
7023
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7024
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7025
|
+
* scopes: [
|
|
7026
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7027
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7028
|
+
* ],
|
|
7029
|
+
* });
|
|
7030
|
+
*
|
|
7031
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7032
|
+
* const authClient = await auth.getClient();
|
|
7033
|
+
* google.options({auth: authClient});
|
|
7034
|
+
*
|
|
7035
|
+
* // Do the magic
|
|
7036
|
+
* const res = await vision.projects.locations.products.purge({
|
|
7037
|
+
* // Required. The project and location in which the Products should be deleted. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
7038
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
7039
|
+
*
|
|
7040
|
+
* // Request body metadata
|
|
7041
|
+
* requestBody: {
|
|
7042
|
+
* // request body parameters
|
|
7043
|
+
* // {
|
|
7044
|
+
* // "deleteOrphanProducts": false,
|
|
7045
|
+
* // "force": false,
|
|
7046
|
+
* // "productSetPurgeConfig": {}
|
|
7047
|
+
* // }
|
|
7048
|
+
* },
|
|
7049
|
+
* });
|
|
7050
|
+
* console.log(res.data);
|
|
7051
|
+
*
|
|
7052
|
+
* // Example response
|
|
7053
|
+
* // {
|
|
7054
|
+
* // "done": false,
|
|
7055
|
+
* // "error": {},
|
|
7056
|
+
* // "metadata": {},
|
|
7057
|
+
* // "name": "my_name",
|
|
7058
|
+
* // "response": {}
|
|
7059
|
+
* // }
|
|
7060
|
+
* }
|
|
7061
|
+
*
|
|
7062
|
+
* main().catch(e => {
|
|
7063
|
+
* console.error(e);
|
|
7064
|
+
* throw e;
|
|
7065
|
+
* });
|
|
7066
|
+
*
|
|
7067
|
+
* ```
|
|
5679
7068
|
*
|
|
5680
7069
|
* @param params - Parameters for request
|
|
5681
7070
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5682
7071
|
* @param callback - Optional callback that handles the response.
|
|
5683
7072
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5684
7073
|
*/
|
|
5685
|
-
purge(params: Params$Resource$Projects$Locations$Products$Purge, options: StreamMethodOptions):
|
|
5686
|
-
purge(params?: Params$Resource$Projects$Locations$Products$Purge, options?: MethodOptions):
|
|
7074
|
+
purge(params: Params$Resource$Projects$Locations$Products$Purge, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7075
|
+
purge(params?: Params$Resource$Projects$Locations$Products$Purge, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5687
7076
|
purge(params: Params$Resource$Projects$Locations$Products$Purge, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5688
7077
|
purge(params: Params$Resource$Projects$Locations$Products$Purge, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5689
7078
|
purge(params: Params$Resource$Projects$Locations$Products$Purge, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
@@ -5758,56 +7147,272 @@ export declare namespace vision_v1 {
|
|
|
5758
7147
|
constructor(context: APIRequestContext);
|
|
5759
7148
|
/**
|
|
5760
7149
|
* Creates and returns a new ReferenceImage resource. The `bounding_poly` field is optional. If `bounding_poly` is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected. * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
|
|
7150
|
+
* @example
|
|
7151
|
+
* ```js
|
|
7152
|
+
* // Before running the sample:
|
|
7153
|
+
* // - Enable the API at:
|
|
7154
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7155
|
+
* // - Login into gcloud by running:
|
|
7156
|
+
* // ```sh
|
|
7157
|
+
* // $ gcloud auth application-default login
|
|
7158
|
+
* // ```
|
|
7159
|
+
* // - Install the npm module by running:
|
|
7160
|
+
* // ```sh
|
|
7161
|
+
* // $ npm install googleapis
|
|
7162
|
+
* // ```
|
|
7163
|
+
*
|
|
7164
|
+
* const {google} = require('googleapis');
|
|
7165
|
+
* const vision = google.vision('v1');
|
|
7166
|
+
*
|
|
7167
|
+
* async function main() {
|
|
7168
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7169
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7170
|
+
* scopes: [
|
|
7171
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7172
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7173
|
+
* ],
|
|
7174
|
+
* });
|
|
7175
|
+
*
|
|
7176
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7177
|
+
* const authClient = await auth.getClient();
|
|
7178
|
+
* google.options({auth: authClient});
|
|
7179
|
+
*
|
|
7180
|
+
* // Do the magic
|
|
7181
|
+
* const res = await vision.projects.locations.products.referenceImages.create({
|
|
7182
|
+
* // Required. Resource name of the product in which to create the reference image. Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
|
|
7183
|
+
* parent: 'projects/my-project/locations/my-location/products/my-product',
|
|
7184
|
+
* // A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character `/`.
|
|
7185
|
+
* referenceImageId: 'placeholder-value',
|
|
7186
|
+
*
|
|
7187
|
+
* // Request body metadata
|
|
7188
|
+
* requestBody: {
|
|
7189
|
+
* // request body parameters
|
|
7190
|
+
* // {
|
|
7191
|
+
* // "boundingPolys": [],
|
|
7192
|
+
* // "name": "my_name",
|
|
7193
|
+
* // "uri": "my_uri"
|
|
7194
|
+
* // }
|
|
7195
|
+
* },
|
|
7196
|
+
* });
|
|
7197
|
+
* console.log(res.data);
|
|
7198
|
+
*
|
|
7199
|
+
* // Example response
|
|
7200
|
+
* // {
|
|
7201
|
+
* // "boundingPolys": [],
|
|
7202
|
+
* // "name": "my_name",
|
|
7203
|
+
* // "uri": "my_uri"
|
|
7204
|
+
* // }
|
|
7205
|
+
* }
|
|
7206
|
+
*
|
|
7207
|
+
* main().catch(e => {
|
|
7208
|
+
* console.error(e);
|
|
7209
|
+
* throw e;
|
|
7210
|
+
* });
|
|
7211
|
+
*
|
|
7212
|
+
* ```
|
|
5761
7213
|
*
|
|
5762
7214
|
* @param params - Parameters for request
|
|
5763
7215
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5764
7216
|
* @param callback - Optional callback that handles the response.
|
|
5765
7217
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5766
7218
|
*/
|
|
5767
|
-
create(params: Params$Resource$Projects$Locations$Products$Referenceimages$Create, options: StreamMethodOptions):
|
|
5768
|
-
create(params?: Params$Resource$Projects$Locations$Products$Referenceimages$Create, options?: MethodOptions):
|
|
7219
|
+
create(params: Params$Resource$Projects$Locations$Products$Referenceimages$Create, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7220
|
+
create(params?: Params$Resource$Projects$Locations$Products$Referenceimages$Create, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ReferenceImage>>;
|
|
5769
7221
|
create(params: Params$Resource$Projects$Locations$Products$Referenceimages$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5770
7222
|
create(params: Params$Resource$Projects$Locations$Products$Referenceimages$Create, options: MethodOptions | BodyResponseCallback<Schema$ReferenceImage>, callback: BodyResponseCallback<Schema$ReferenceImage>): void;
|
|
5771
7223
|
create(params: Params$Resource$Projects$Locations$Products$Referenceimages$Create, callback: BodyResponseCallback<Schema$ReferenceImage>): void;
|
|
5772
7224
|
create(callback: BodyResponseCallback<Schema$ReferenceImage>): void;
|
|
5773
7225
|
/**
|
|
5774
7226
|
* Permanently deletes a reference image. The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage.
|
|
7227
|
+
* @example
|
|
7228
|
+
* ```js
|
|
7229
|
+
* // Before running the sample:
|
|
7230
|
+
* // - Enable the API at:
|
|
7231
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7232
|
+
* // - Login into gcloud by running:
|
|
7233
|
+
* // ```sh
|
|
7234
|
+
* // $ gcloud auth application-default login
|
|
7235
|
+
* // ```
|
|
7236
|
+
* // - Install the npm module by running:
|
|
7237
|
+
* // ```sh
|
|
7238
|
+
* // $ npm install googleapis
|
|
7239
|
+
* // ```
|
|
7240
|
+
*
|
|
7241
|
+
* const {google} = require('googleapis');
|
|
7242
|
+
* const vision = google.vision('v1');
|
|
7243
|
+
*
|
|
7244
|
+
* async function main() {
|
|
7245
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7246
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7247
|
+
* scopes: [
|
|
7248
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7249
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7250
|
+
* ],
|
|
7251
|
+
* });
|
|
7252
|
+
*
|
|
7253
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7254
|
+
* const authClient = await auth.getClient();
|
|
7255
|
+
* google.options({auth: authClient});
|
|
7256
|
+
*
|
|
7257
|
+
* // Do the magic
|
|
7258
|
+
* const res = await vision.projects.locations.products.referenceImages.delete({
|
|
7259
|
+
* // Required. The resource name of the reference image to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
|
|
7260
|
+
* name: 'projects/my-project/locations/my-location/products/my-product/referenceImages/my-referenceImage',
|
|
7261
|
+
* });
|
|
7262
|
+
* console.log(res.data);
|
|
7263
|
+
*
|
|
7264
|
+
* // Example response
|
|
7265
|
+
* // {}
|
|
7266
|
+
* }
|
|
7267
|
+
*
|
|
7268
|
+
* main().catch(e => {
|
|
7269
|
+
* console.error(e);
|
|
7270
|
+
* throw e;
|
|
7271
|
+
* });
|
|
7272
|
+
*
|
|
7273
|
+
* ```
|
|
5775
7274
|
*
|
|
5776
7275
|
* @param params - Parameters for request
|
|
5777
7276
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5778
7277
|
* @param callback - Optional callback that handles the response.
|
|
5779
7278
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5780
7279
|
*/
|
|
5781
|
-
delete(params: Params$Resource$Projects$Locations$Products$Referenceimages$Delete, options: StreamMethodOptions):
|
|
5782
|
-
delete(params?: Params$Resource$Projects$Locations$Products$Referenceimages$Delete, options?: MethodOptions):
|
|
7280
|
+
delete(params: Params$Resource$Projects$Locations$Products$Referenceimages$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7281
|
+
delete(params?: Params$Resource$Projects$Locations$Products$Referenceimages$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
5783
7282
|
delete(params: Params$Resource$Projects$Locations$Products$Referenceimages$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5784
7283
|
delete(params: Params$Resource$Projects$Locations$Products$Referenceimages$Delete, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5785
7284
|
delete(params: Params$Resource$Projects$Locations$Products$Referenceimages$Delete, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5786
7285
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5787
7286
|
/**
|
|
5788
7287
|
* Gets information associated with a ReferenceImage. Possible errors: * Returns NOT_FOUND if the specified image does not exist.
|
|
7288
|
+
* @example
|
|
7289
|
+
* ```js
|
|
7290
|
+
* // Before running the sample:
|
|
7291
|
+
* // - Enable the API at:
|
|
7292
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7293
|
+
* // - Login into gcloud by running:
|
|
7294
|
+
* // ```sh
|
|
7295
|
+
* // $ gcloud auth application-default login
|
|
7296
|
+
* // ```
|
|
7297
|
+
* // - Install the npm module by running:
|
|
7298
|
+
* // ```sh
|
|
7299
|
+
* // $ npm install googleapis
|
|
7300
|
+
* // ```
|
|
7301
|
+
*
|
|
7302
|
+
* const {google} = require('googleapis');
|
|
7303
|
+
* const vision = google.vision('v1');
|
|
7304
|
+
*
|
|
7305
|
+
* async function main() {
|
|
7306
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7307
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7308
|
+
* scopes: [
|
|
7309
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7310
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7311
|
+
* ],
|
|
7312
|
+
* });
|
|
7313
|
+
*
|
|
7314
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7315
|
+
* const authClient = await auth.getClient();
|
|
7316
|
+
* google.options({auth: authClient});
|
|
7317
|
+
*
|
|
7318
|
+
* // Do the magic
|
|
7319
|
+
* const res = await vision.projects.locations.products.referenceImages.get({
|
|
7320
|
+
* // Required. The resource name of the ReferenceImage to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
|
|
7321
|
+
* name: 'projects/my-project/locations/my-location/products/my-product/referenceImages/my-referenceImage',
|
|
7322
|
+
* });
|
|
7323
|
+
* console.log(res.data);
|
|
7324
|
+
*
|
|
7325
|
+
* // Example response
|
|
7326
|
+
* // {
|
|
7327
|
+
* // "boundingPolys": [],
|
|
7328
|
+
* // "name": "my_name",
|
|
7329
|
+
* // "uri": "my_uri"
|
|
7330
|
+
* // }
|
|
7331
|
+
* }
|
|
7332
|
+
*
|
|
7333
|
+
* main().catch(e => {
|
|
7334
|
+
* console.error(e);
|
|
7335
|
+
* throw e;
|
|
7336
|
+
* });
|
|
7337
|
+
*
|
|
7338
|
+
* ```
|
|
5789
7339
|
*
|
|
5790
7340
|
* @param params - Parameters for request
|
|
5791
7341
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5792
7342
|
* @param callback - Optional callback that handles the response.
|
|
5793
7343
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5794
7344
|
*/
|
|
5795
|
-
get(params: Params$Resource$Projects$Locations$Products$Referenceimages$Get, options: StreamMethodOptions):
|
|
5796
|
-
get(params?: Params$Resource$Projects$Locations$Products$Referenceimages$Get, options?: MethodOptions):
|
|
7345
|
+
get(params: Params$Resource$Projects$Locations$Products$Referenceimages$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7346
|
+
get(params?: Params$Resource$Projects$Locations$Products$Referenceimages$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ReferenceImage>>;
|
|
5797
7347
|
get(params: Params$Resource$Projects$Locations$Products$Referenceimages$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5798
7348
|
get(params: Params$Resource$Projects$Locations$Products$Referenceimages$Get, options: MethodOptions | BodyResponseCallback<Schema$ReferenceImage>, callback: BodyResponseCallback<Schema$ReferenceImage>): void;
|
|
5799
7349
|
get(params: Params$Resource$Projects$Locations$Products$Referenceimages$Get, callback: BodyResponseCallback<Schema$ReferenceImage>): void;
|
|
5800
7350
|
get(callback: BodyResponseCallback<Schema$ReferenceImage>): void;
|
|
5801
7351
|
/**
|
|
5802
7352
|
* Lists reference images. Possible errors: * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1.
|
|
7353
|
+
* @example
|
|
7354
|
+
* ```js
|
|
7355
|
+
* // Before running the sample:
|
|
7356
|
+
* // - Enable the API at:
|
|
7357
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7358
|
+
* // - Login into gcloud by running:
|
|
7359
|
+
* // ```sh
|
|
7360
|
+
* // $ gcloud auth application-default login
|
|
7361
|
+
* // ```
|
|
7362
|
+
* // - Install the npm module by running:
|
|
7363
|
+
* // ```sh
|
|
7364
|
+
* // $ npm install googleapis
|
|
7365
|
+
* // ```
|
|
7366
|
+
*
|
|
7367
|
+
* const {google} = require('googleapis');
|
|
7368
|
+
* const vision = google.vision('v1');
|
|
7369
|
+
*
|
|
7370
|
+
* async function main() {
|
|
7371
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7372
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7373
|
+
* scopes: [
|
|
7374
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7375
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7376
|
+
* ],
|
|
7377
|
+
* });
|
|
7378
|
+
*
|
|
7379
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7380
|
+
* const authClient = await auth.getClient();
|
|
7381
|
+
* google.options({auth: authClient});
|
|
7382
|
+
*
|
|
7383
|
+
* // Do the magic
|
|
7384
|
+
* const res = await vision.projects.locations.products.referenceImages.list({
|
|
7385
|
+
* // The maximum number of items to return. Default 10, maximum 100.
|
|
7386
|
+
* pageSize: 'placeholder-value',
|
|
7387
|
+
* // A token identifying a page of results to be returned. This is the value of `nextPageToken` returned in a previous reference image list request. Defaults to the first page if not specified.
|
|
7388
|
+
* pageToken: 'placeholder-value',
|
|
7389
|
+
* // Required. Resource name of the product containing the reference images. Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
|
|
7390
|
+
* parent: 'projects/my-project/locations/my-location/products/my-product',
|
|
7391
|
+
* });
|
|
7392
|
+
* console.log(res.data);
|
|
7393
|
+
*
|
|
7394
|
+
* // Example response
|
|
7395
|
+
* // {
|
|
7396
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
7397
|
+
* // "pageSize": 0,
|
|
7398
|
+
* // "referenceImages": []
|
|
7399
|
+
* // }
|
|
7400
|
+
* }
|
|
7401
|
+
*
|
|
7402
|
+
* main().catch(e => {
|
|
7403
|
+
* console.error(e);
|
|
7404
|
+
* throw e;
|
|
7405
|
+
* });
|
|
7406
|
+
*
|
|
7407
|
+
* ```
|
|
5803
7408
|
*
|
|
5804
7409
|
* @param params - Parameters for request
|
|
5805
7410
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5806
7411
|
* @param callback - Optional callback that handles the response.
|
|
5807
7412
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5808
7413
|
*/
|
|
5809
|
-
list(params: Params$Resource$Projects$Locations$Products$Referenceimages$List, options: StreamMethodOptions):
|
|
5810
|
-
list(params?: Params$Resource$Projects$Locations$Products$Referenceimages$List, options?: MethodOptions):
|
|
7414
|
+
list(params: Params$Resource$Projects$Locations$Products$Referenceimages$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7415
|
+
list(params?: Params$Resource$Projects$Locations$Products$Referenceimages$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListReferenceImagesResponse>>;
|
|
5811
7416
|
list(params: Params$Resource$Projects$Locations$Products$Referenceimages$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5812
7417
|
list(params: Params$Resource$Projects$Locations$Products$Referenceimages$List, options: MethodOptions | BodyResponseCallback<Schema$ListReferenceImagesResponse>, callback: BodyResponseCallback<Schema$ListReferenceImagesResponse>): void;
|
|
5813
7418
|
list(params: Params$Resource$Projects$Locations$Products$Referenceimages$List, callback: BodyResponseCallback<Schema$ListReferenceImagesResponse>): void;
|
|
@@ -5859,112 +7464,566 @@ export declare namespace vision_v1 {
|
|
|
5859
7464
|
constructor(context: APIRequestContext);
|
|
5860
7465
|
/**
|
|
5861
7466
|
* Adds a Product to the specified ProductSet. If the Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
|
|
7467
|
+
* @example
|
|
7468
|
+
* ```js
|
|
7469
|
+
* // Before running the sample:
|
|
7470
|
+
* // - Enable the API at:
|
|
7471
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7472
|
+
* // - Login into gcloud by running:
|
|
7473
|
+
* // ```sh
|
|
7474
|
+
* // $ gcloud auth application-default login
|
|
7475
|
+
* // ```
|
|
7476
|
+
* // - Install the npm module by running:
|
|
7477
|
+
* // ```sh
|
|
7478
|
+
* // $ npm install googleapis
|
|
7479
|
+
* // ```
|
|
7480
|
+
*
|
|
7481
|
+
* const {google} = require('googleapis');
|
|
7482
|
+
* const vision = google.vision('v1');
|
|
7483
|
+
*
|
|
7484
|
+
* async function main() {
|
|
7485
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7486
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7487
|
+
* scopes: [
|
|
7488
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7489
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7490
|
+
* ],
|
|
7491
|
+
* });
|
|
7492
|
+
*
|
|
7493
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7494
|
+
* const authClient = await auth.getClient();
|
|
7495
|
+
* google.options({auth: authClient});
|
|
7496
|
+
*
|
|
7497
|
+
* // Do the magic
|
|
7498
|
+
* const res = await vision.projects.locations.productSets.addProduct({
|
|
7499
|
+
* // Required. The resource name for the ProductSet to modify. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
7500
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
7501
|
+
*
|
|
7502
|
+
* // Request body metadata
|
|
7503
|
+
* requestBody: {
|
|
7504
|
+
* // request body parameters
|
|
7505
|
+
* // {
|
|
7506
|
+
* // "product": "my_product"
|
|
7507
|
+
* // }
|
|
7508
|
+
* },
|
|
7509
|
+
* });
|
|
7510
|
+
* console.log(res.data);
|
|
7511
|
+
*
|
|
7512
|
+
* // Example response
|
|
7513
|
+
* // {}
|
|
7514
|
+
* }
|
|
7515
|
+
*
|
|
7516
|
+
* main().catch(e => {
|
|
7517
|
+
* console.error(e);
|
|
7518
|
+
* throw e;
|
|
7519
|
+
* });
|
|
7520
|
+
*
|
|
7521
|
+
* ```
|
|
5862
7522
|
*
|
|
5863
7523
|
* @param params - Parameters for request
|
|
5864
7524
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5865
7525
|
* @param callback - Optional callback that handles the response.
|
|
5866
7526
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5867
7527
|
*/
|
|
5868
|
-
addProduct(params: Params$Resource$Projects$Locations$Productsets$Addproduct, options: StreamMethodOptions):
|
|
5869
|
-
addProduct(params?: Params$Resource$Projects$Locations$Productsets$Addproduct, options?: MethodOptions):
|
|
7528
|
+
addProduct(params: Params$Resource$Projects$Locations$Productsets$Addproduct, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7529
|
+
addProduct(params?: Params$Resource$Projects$Locations$Productsets$Addproduct, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
5870
7530
|
addProduct(params: Params$Resource$Projects$Locations$Productsets$Addproduct, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5871
7531
|
addProduct(params: Params$Resource$Projects$Locations$Productsets$Addproduct, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5872
7532
|
addProduct(params: Params$Resource$Projects$Locations$Productsets$Addproduct, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5873
7533
|
addProduct(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5874
7534
|
/**
|
|
5875
7535
|
* Creates and returns a new ProductSet resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
|
|
7536
|
+
* @example
|
|
7537
|
+
* ```js
|
|
7538
|
+
* // Before running the sample:
|
|
7539
|
+
* // - Enable the API at:
|
|
7540
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7541
|
+
* // - Login into gcloud by running:
|
|
7542
|
+
* // ```sh
|
|
7543
|
+
* // $ gcloud auth application-default login
|
|
7544
|
+
* // ```
|
|
7545
|
+
* // - Install the npm module by running:
|
|
7546
|
+
* // ```sh
|
|
7547
|
+
* // $ npm install googleapis
|
|
7548
|
+
* // ```
|
|
7549
|
+
*
|
|
7550
|
+
* const {google} = require('googleapis');
|
|
7551
|
+
* const vision = google.vision('v1');
|
|
7552
|
+
*
|
|
7553
|
+
* async function main() {
|
|
7554
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7555
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7556
|
+
* scopes: [
|
|
7557
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7558
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7559
|
+
* ],
|
|
7560
|
+
* });
|
|
7561
|
+
*
|
|
7562
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7563
|
+
* const authClient = await auth.getClient();
|
|
7564
|
+
* google.options({auth: authClient});
|
|
7565
|
+
*
|
|
7566
|
+
* // Do the magic
|
|
7567
|
+
* const res = await vision.projects.locations.productSets.create({
|
|
7568
|
+
* // Required. The project in which the ProductSet should be created. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
7569
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
7570
|
+
* // A user-supplied resource id for this ProductSet. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character `/`.
|
|
7571
|
+
* productSetId: 'placeholder-value',
|
|
7572
|
+
*
|
|
7573
|
+
* // Request body metadata
|
|
7574
|
+
* requestBody: {
|
|
7575
|
+
* // request body parameters
|
|
7576
|
+
* // {
|
|
7577
|
+
* // "displayName": "my_displayName",
|
|
7578
|
+
* // "indexError": {},
|
|
7579
|
+
* // "indexTime": "my_indexTime",
|
|
7580
|
+
* // "name": "my_name"
|
|
7581
|
+
* // }
|
|
7582
|
+
* },
|
|
7583
|
+
* });
|
|
7584
|
+
* console.log(res.data);
|
|
7585
|
+
*
|
|
7586
|
+
* // Example response
|
|
7587
|
+
* // {
|
|
7588
|
+
* // "displayName": "my_displayName",
|
|
7589
|
+
* // "indexError": {},
|
|
7590
|
+
* // "indexTime": "my_indexTime",
|
|
7591
|
+
* // "name": "my_name"
|
|
7592
|
+
* // }
|
|
7593
|
+
* }
|
|
7594
|
+
*
|
|
7595
|
+
* main().catch(e => {
|
|
7596
|
+
* console.error(e);
|
|
7597
|
+
* throw e;
|
|
7598
|
+
* });
|
|
7599
|
+
*
|
|
7600
|
+
* ```
|
|
5876
7601
|
*
|
|
5877
7602
|
* @param params - Parameters for request
|
|
5878
7603
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5879
7604
|
* @param callback - Optional callback that handles the response.
|
|
5880
7605
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5881
7606
|
*/
|
|
5882
|
-
create(params: Params$Resource$Projects$Locations$Productsets$Create, options: StreamMethodOptions):
|
|
5883
|
-
create(params?: Params$Resource$Projects$Locations$Productsets$Create, options?: MethodOptions):
|
|
7607
|
+
create(params: Params$Resource$Projects$Locations$Productsets$Create, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7608
|
+
create(params?: Params$Resource$Projects$Locations$Productsets$Create, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ProductSet>>;
|
|
5884
7609
|
create(params: Params$Resource$Projects$Locations$Productsets$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5885
7610
|
create(params: Params$Resource$Projects$Locations$Productsets$Create, options: MethodOptions | BodyResponseCallback<Schema$ProductSet>, callback: BodyResponseCallback<Schema$ProductSet>): void;
|
|
5886
7611
|
create(params: Params$Resource$Projects$Locations$Productsets$Create, callback: BodyResponseCallback<Schema$ProductSet>): void;
|
|
5887
7612
|
create(callback: BodyResponseCallback<Schema$ProductSet>): void;
|
|
5888
7613
|
/**
|
|
5889
7614
|
* Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted. The actual image files are not deleted from Google Cloud Storage.
|
|
7615
|
+
* @example
|
|
7616
|
+
* ```js
|
|
7617
|
+
* // Before running the sample:
|
|
7618
|
+
* // - Enable the API at:
|
|
7619
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7620
|
+
* // - Login into gcloud by running:
|
|
7621
|
+
* // ```sh
|
|
7622
|
+
* // $ gcloud auth application-default login
|
|
7623
|
+
* // ```
|
|
7624
|
+
* // - Install the npm module by running:
|
|
7625
|
+
* // ```sh
|
|
7626
|
+
* // $ npm install googleapis
|
|
7627
|
+
* // ```
|
|
7628
|
+
*
|
|
7629
|
+
* const {google} = require('googleapis');
|
|
7630
|
+
* const vision = google.vision('v1');
|
|
7631
|
+
*
|
|
7632
|
+
* async function main() {
|
|
7633
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7634
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7635
|
+
* scopes: [
|
|
7636
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7637
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7638
|
+
* ],
|
|
7639
|
+
* });
|
|
7640
|
+
*
|
|
7641
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7642
|
+
* const authClient = await auth.getClient();
|
|
7643
|
+
* google.options({auth: authClient});
|
|
7644
|
+
*
|
|
7645
|
+
* // Do the magic
|
|
7646
|
+
* const res = await vision.projects.locations.productSets.delete({
|
|
7647
|
+
* // Required. Resource name of the ProductSet to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
7648
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
7649
|
+
* });
|
|
7650
|
+
* console.log(res.data);
|
|
7651
|
+
*
|
|
7652
|
+
* // Example response
|
|
7653
|
+
* // {}
|
|
7654
|
+
* }
|
|
7655
|
+
*
|
|
7656
|
+
* main().catch(e => {
|
|
7657
|
+
* console.error(e);
|
|
7658
|
+
* throw e;
|
|
7659
|
+
* });
|
|
7660
|
+
*
|
|
7661
|
+
* ```
|
|
5890
7662
|
*
|
|
5891
7663
|
* @param params - Parameters for request
|
|
5892
7664
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5893
7665
|
* @param callback - Optional callback that handles the response.
|
|
5894
7666
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5895
7667
|
*/
|
|
5896
|
-
delete(params: Params$Resource$Projects$Locations$Productsets$Delete, options: StreamMethodOptions):
|
|
5897
|
-
delete(params?: Params$Resource$Projects$Locations$Productsets$Delete, options?: MethodOptions):
|
|
7668
|
+
delete(params: Params$Resource$Projects$Locations$Productsets$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7669
|
+
delete(params?: Params$Resource$Projects$Locations$Productsets$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
5898
7670
|
delete(params: Params$Resource$Projects$Locations$Productsets$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5899
7671
|
delete(params: Params$Resource$Projects$Locations$Productsets$Delete, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5900
7672
|
delete(params: Params$Resource$Projects$Locations$Productsets$Delete, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5901
7673
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5902
7674
|
/**
|
|
5903
7675
|
* Gets information associated with a ProductSet. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist.
|
|
7676
|
+
* @example
|
|
7677
|
+
* ```js
|
|
7678
|
+
* // Before running the sample:
|
|
7679
|
+
* // - Enable the API at:
|
|
7680
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7681
|
+
* // - Login into gcloud by running:
|
|
7682
|
+
* // ```sh
|
|
7683
|
+
* // $ gcloud auth application-default login
|
|
7684
|
+
* // ```
|
|
7685
|
+
* // - Install the npm module by running:
|
|
7686
|
+
* // ```sh
|
|
7687
|
+
* // $ npm install googleapis
|
|
7688
|
+
* // ```
|
|
7689
|
+
*
|
|
7690
|
+
* const {google} = require('googleapis');
|
|
7691
|
+
* const vision = google.vision('v1');
|
|
7692
|
+
*
|
|
7693
|
+
* async function main() {
|
|
7694
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7695
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7696
|
+
* scopes: [
|
|
7697
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7698
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7699
|
+
* ],
|
|
7700
|
+
* });
|
|
7701
|
+
*
|
|
7702
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7703
|
+
* const authClient = await auth.getClient();
|
|
7704
|
+
* google.options({auth: authClient});
|
|
7705
|
+
*
|
|
7706
|
+
* // Do the magic
|
|
7707
|
+
* const res = await vision.projects.locations.productSets.get({
|
|
7708
|
+
* // Required. Resource name of the ProductSet to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
7709
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
7710
|
+
* });
|
|
7711
|
+
* console.log(res.data);
|
|
7712
|
+
*
|
|
7713
|
+
* // Example response
|
|
7714
|
+
* // {
|
|
7715
|
+
* // "displayName": "my_displayName",
|
|
7716
|
+
* // "indexError": {},
|
|
7717
|
+
* // "indexTime": "my_indexTime",
|
|
7718
|
+
* // "name": "my_name"
|
|
7719
|
+
* // }
|
|
7720
|
+
* }
|
|
7721
|
+
*
|
|
7722
|
+
* main().catch(e => {
|
|
7723
|
+
* console.error(e);
|
|
7724
|
+
* throw e;
|
|
7725
|
+
* });
|
|
7726
|
+
*
|
|
7727
|
+
* ```
|
|
5904
7728
|
*
|
|
5905
7729
|
* @param params - Parameters for request
|
|
5906
7730
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5907
7731
|
* @param callback - Optional callback that handles the response.
|
|
5908
7732
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5909
7733
|
*/
|
|
5910
|
-
get(params: Params$Resource$Projects$Locations$Productsets$Get, options: StreamMethodOptions):
|
|
5911
|
-
get(params?: Params$Resource$Projects$Locations$Productsets$Get, options?: MethodOptions):
|
|
7734
|
+
get(params: Params$Resource$Projects$Locations$Productsets$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7735
|
+
get(params?: Params$Resource$Projects$Locations$Productsets$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ProductSet>>;
|
|
5912
7736
|
get(params: Params$Resource$Projects$Locations$Productsets$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5913
7737
|
get(params: Params$Resource$Projects$Locations$Productsets$Get, options: MethodOptions | BodyResponseCallback<Schema$ProductSet>, callback: BodyResponseCallback<Schema$ProductSet>): void;
|
|
5914
7738
|
get(params: Params$Resource$Projects$Locations$Productsets$Get, callback: BodyResponseCallback<Schema$ProductSet>): void;
|
|
5915
7739
|
get(callback: BodyResponseCallback<Schema$ProductSet>): void;
|
|
5916
7740
|
/**
|
|
5917
7741
|
* Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see ImportProductSetsGcsSource.csv_file_uri.
|
|
7742
|
+
* @example
|
|
7743
|
+
* ```js
|
|
7744
|
+
* // Before running the sample:
|
|
7745
|
+
* // - Enable the API at:
|
|
7746
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7747
|
+
* // - Login into gcloud by running:
|
|
7748
|
+
* // ```sh
|
|
7749
|
+
* // $ gcloud auth application-default login
|
|
7750
|
+
* // ```
|
|
7751
|
+
* // - Install the npm module by running:
|
|
7752
|
+
* // ```sh
|
|
7753
|
+
* // $ npm install googleapis
|
|
7754
|
+
* // ```
|
|
7755
|
+
*
|
|
7756
|
+
* const {google} = require('googleapis');
|
|
7757
|
+
* const vision = google.vision('v1');
|
|
7758
|
+
*
|
|
7759
|
+
* async function main() {
|
|
7760
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7761
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7762
|
+
* scopes: [
|
|
7763
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7764
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7765
|
+
* ],
|
|
7766
|
+
* });
|
|
7767
|
+
*
|
|
7768
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7769
|
+
* const authClient = await auth.getClient();
|
|
7770
|
+
* google.options({auth: authClient});
|
|
7771
|
+
*
|
|
7772
|
+
* // Do the magic
|
|
7773
|
+
* const res = await vision.projects.locations.productSets.import({
|
|
7774
|
+
* // Required. The project in which the ProductSets should be imported. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
7775
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
7776
|
+
*
|
|
7777
|
+
* // Request body metadata
|
|
7778
|
+
* requestBody: {
|
|
7779
|
+
* // request body parameters
|
|
7780
|
+
* // {
|
|
7781
|
+
* // "inputConfig": {}
|
|
7782
|
+
* // }
|
|
7783
|
+
* },
|
|
7784
|
+
* });
|
|
7785
|
+
* console.log(res.data);
|
|
7786
|
+
*
|
|
7787
|
+
* // Example response
|
|
7788
|
+
* // {
|
|
7789
|
+
* // "done": false,
|
|
7790
|
+
* // "error": {},
|
|
7791
|
+
* // "metadata": {},
|
|
7792
|
+
* // "name": "my_name",
|
|
7793
|
+
* // "response": {}
|
|
7794
|
+
* // }
|
|
7795
|
+
* }
|
|
7796
|
+
*
|
|
7797
|
+
* main().catch(e => {
|
|
7798
|
+
* console.error(e);
|
|
7799
|
+
* throw e;
|
|
7800
|
+
* });
|
|
7801
|
+
*
|
|
7802
|
+
* ```
|
|
5918
7803
|
*
|
|
5919
7804
|
* @param params - Parameters for request
|
|
5920
7805
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5921
7806
|
* @param callback - Optional callback that handles the response.
|
|
5922
7807
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5923
7808
|
*/
|
|
5924
|
-
import(params: Params$Resource$Projects$Locations$Productsets$Import, options: StreamMethodOptions):
|
|
5925
|
-
import(params?: Params$Resource$Projects$Locations$Productsets$Import, options?: MethodOptions):
|
|
7809
|
+
import(params: Params$Resource$Projects$Locations$Productsets$Import, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7810
|
+
import(params?: Params$Resource$Projects$Locations$Productsets$Import, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
5926
7811
|
import(params: Params$Resource$Projects$Locations$Productsets$Import, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5927
7812
|
import(params: Params$Resource$Projects$Locations$Productsets$Import, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5928
7813
|
import(params: Params$Resource$Projects$Locations$Productsets$Import, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5929
7814
|
import(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
5930
7815
|
/**
|
|
5931
7816
|
* Lists ProductSets in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
|
|
7817
|
+
* @example
|
|
7818
|
+
* ```js
|
|
7819
|
+
* // Before running the sample:
|
|
7820
|
+
* // - Enable the API at:
|
|
7821
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7822
|
+
* // - Login into gcloud by running:
|
|
7823
|
+
* // ```sh
|
|
7824
|
+
* // $ gcloud auth application-default login
|
|
7825
|
+
* // ```
|
|
7826
|
+
* // - Install the npm module by running:
|
|
7827
|
+
* // ```sh
|
|
7828
|
+
* // $ npm install googleapis
|
|
7829
|
+
* // ```
|
|
7830
|
+
*
|
|
7831
|
+
* const {google} = require('googleapis');
|
|
7832
|
+
* const vision = google.vision('v1');
|
|
7833
|
+
*
|
|
7834
|
+
* async function main() {
|
|
7835
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7836
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7837
|
+
* scopes: [
|
|
7838
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7839
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7840
|
+
* ],
|
|
7841
|
+
* });
|
|
7842
|
+
*
|
|
7843
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7844
|
+
* const authClient = await auth.getClient();
|
|
7845
|
+
* google.options({auth: authClient});
|
|
7846
|
+
*
|
|
7847
|
+
* // Do the magic
|
|
7848
|
+
* const res = await vision.projects.locations.productSets.list({
|
|
7849
|
+
* // The maximum number of items to return. Default 10, maximum 100.
|
|
7850
|
+
* pageSize: 'placeholder-value',
|
|
7851
|
+
* // The next_page_token returned from a previous List request, if any.
|
|
7852
|
+
* pageToken: 'placeholder-value',
|
|
7853
|
+
* // Required. The project from which ProductSets should be listed. Format is `projects/PROJECT_ID/locations/LOC_ID`.
|
|
7854
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
7855
|
+
* });
|
|
7856
|
+
* console.log(res.data);
|
|
7857
|
+
*
|
|
7858
|
+
* // Example response
|
|
7859
|
+
* // {
|
|
7860
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
7861
|
+
* // "productSets": []
|
|
7862
|
+
* // }
|
|
7863
|
+
* }
|
|
7864
|
+
*
|
|
7865
|
+
* main().catch(e => {
|
|
7866
|
+
* console.error(e);
|
|
7867
|
+
* throw e;
|
|
7868
|
+
* });
|
|
7869
|
+
*
|
|
7870
|
+
* ```
|
|
5932
7871
|
*
|
|
5933
7872
|
* @param params - Parameters for request
|
|
5934
7873
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5935
7874
|
* @param callback - Optional callback that handles the response.
|
|
5936
7875
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5937
7876
|
*/
|
|
5938
|
-
list(params: Params$Resource$Projects$Locations$Productsets$List, options: StreamMethodOptions):
|
|
5939
|
-
list(params?: Params$Resource$Projects$Locations$Productsets$List, options?: MethodOptions):
|
|
7877
|
+
list(params: Params$Resource$Projects$Locations$Productsets$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7878
|
+
list(params?: Params$Resource$Projects$Locations$Productsets$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListProductSetsResponse>>;
|
|
5940
7879
|
list(params: Params$Resource$Projects$Locations$Productsets$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5941
7880
|
list(params: Params$Resource$Projects$Locations$Productsets$List, options: MethodOptions | BodyResponseCallback<Schema$ListProductSetsResponse>, callback: BodyResponseCallback<Schema$ListProductSetsResponse>): void;
|
|
5942
7881
|
list(params: Params$Resource$Projects$Locations$Productsets$List, callback: BodyResponseCallback<Schema$ListProductSetsResponse>): void;
|
|
5943
7882
|
list(callback: BodyResponseCallback<Schema$ListProductSetsResponse>): void;
|
|
5944
7883
|
/**
|
|
5945
7884
|
* Makes changes to a ProductSet resource. Only display_name can be updated currently. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.
|
|
7885
|
+
* @example
|
|
7886
|
+
* ```js
|
|
7887
|
+
* // Before running the sample:
|
|
7888
|
+
* // - Enable the API at:
|
|
7889
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7890
|
+
* // - Login into gcloud by running:
|
|
7891
|
+
* // ```sh
|
|
7892
|
+
* // $ gcloud auth application-default login
|
|
7893
|
+
* // ```
|
|
7894
|
+
* // - Install the npm module by running:
|
|
7895
|
+
* // ```sh
|
|
7896
|
+
* // $ npm install googleapis
|
|
7897
|
+
* // ```
|
|
7898
|
+
*
|
|
7899
|
+
* const {google} = require('googleapis');
|
|
7900
|
+
* const vision = google.vision('v1');
|
|
7901
|
+
*
|
|
7902
|
+
* async function main() {
|
|
7903
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7904
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7905
|
+
* scopes: [
|
|
7906
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7907
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7908
|
+
* ],
|
|
7909
|
+
* });
|
|
7910
|
+
*
|
|
7911
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7912
|
+
* const authClient = await auth.getClient();
|
|
7913
|
+
* google.options({auth: authClient});
|
|
7914
|
+
*
|
|
7915
|
+
* // Do the magic
|
|
7916
|
+
* const res = await vision.projects.locations.productSets.patch({
|
|
7917
|
+
* // The resource name of the ProductSet. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. This field is ignored when creating a ProductSet.
|
|
7918
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
7919
|
+
* // The FieldMask that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask path is `display_name`.
|
|
7920
|
+
* updateMask: 'placeholder-value',
|
|
7921
|
+
*
|
|
7922
|
+
* // Request body metadata
|
|
7923
|
+
* requestBody: {
|
|
7924
|
+
* // request body parameters
|
|
7925
|
+
* // {
|
|
7926
|
+
* // "displayName": "my_displayName",
|
|
7927
|
+
* // "indexError": {},
|
|
7928
|
+
* // "indexTime": "my_indexTime",
|
|
7929
|
+
* // "name": "my_name"
|
|
7930
|
+
* // }
|
|
7931
|
+
* },
|
|
7932
|
+
* });
|
|
7933
|
+
* console.log(res.data);
|
|
7934
|
+
*
|
|
7935
|
+
* // Example response
|
|
7936
|
+
* // {
|
|
7937
|
+
* // "displayName": "my_displayName",
|
|
7938
|
+
* // "indexError": {},
|
|
7939
|
+
* // "indexTime": "my_indexTime",
|
|
7940
|
+
* // "name": "my_name"
|
|
7941
|
+
* // }
|
|
7942
|
+
* }
|
|
7943
|
+
*
|
|
7944
|
+
* main().catch(e => {
|
|
7945
|
+
* console.error(e);
|
|
7946
|
+
* throw e;
|
|
7947
|
+
* });
|
|
7948
|
+
*
|
|
7949
|
+
* ```
|
|
5946
7950
|
*
|
|
5947
7951
|
* @param params - Parameters for request
|
|
5948
7952
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5949
7953
|
* @param callback - Optional callback that handles the response.
|
|
5950
7954
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5951
7955
|
*/
|
|
5952
|
-
patch(params: Params$Resource$Projects$Locations$Productsets$Patch, options: StreamMethodOptions):
|
|
5953
|
-
patch(params?: Params$Resource$Projects$Locations$Productsets$Patch, options?: MethodOptions):
|
|
7956
|
+
patch(params: Params$Resource$Projects$Locations$Productsets$Patch, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
7957
|
+
patch(params?: Params$Resource$Projects$Locations$Productsets$Patch, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ProductSet>>;
|
|
5954
7958
|
patch(params: Params$Resource$Projects$Locations$Productsets$Patch, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5955
7959
|
patch(params: Params$Resource$Projects$Locations$Productsets$Patch, options: MethodOptions | BodyResponseCallback<Schema$ProductSet>, callback: BodyResponseCallback<Schema$ProductSet>): void;
|
|
5956
7960
|
patch(params: Params$Resource$Projects$Locations$Productsets$Patch, callback: BodyResponseCallback<Schema$ProductSet>): void;
|
|
5957
7961
|
patch(callback: BodyResponseCallback<Schema$ProductSet>): void;
|
|
5958
7962
|
/**
|
|
5959
7963
|
* Removes a Product from the specified ProductSet.
|
|
7964
|
+
* @example
|
|
7965
|
+
* ```js
|
|
7966
|
+
* // Before running the sample:
|
|
7967
|
+
* // - Enable the API at:
|
|
7968
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
7969
|
+
* // - Login into gcloud by running:
|
|
7970
|
+
* // ```sh
|
|
7971
|
+
* // $ gcloud auth application-default login
|
|
7972
|
+
* // ```
|
|
7973
|
+
* // - Install the npm module by running:
|
|
7974
|
+
* // ```sh
|
|
7975
|
+
* // $ npm install googleapis
|
|
7976
|
+
* // ```
|
|
7977
|
+
*
|
|
7978
|
+
* const {google} = require('googleapis');
|
|
7979
|
+
* const vision = google.vision('v1');
|
|
7980
|
+
*
|
|
7981
|
+
* async function main() {
|
|
7982
|
+
* const auth = new google.auth.GoogleAuth({
|
|
7983
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
7984
|
+
* scopes: [
|
|
7985
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
7986
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
7987
|
+
* ],
|
|
7988
|
+
* });
|
|
7989
|
+
*
|
|
7990
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
7991
|
+
* const authClient = await auth.getClient();
|
|
7992
|
+
* google.options({auth: authClient});
|
|
7993
|
+
*
|
|
7994
|
+
* // Do the magic
|
|
7995
|
+
* const res = await vision.projects.locations.productSets.removeProduct({
|
|
7996
|
+
* // Required. The resource name for the ProductSet to modify. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
7997
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
7998
|
+
*
|
|
7999
|
+
* // Request body metadata
|
|
8000
|
+
* requestBody: {
|
|
8001
|
+
* // request body parameters
|
|
8002
|
+
* // {
|
|
8003
|
+
* // "product": "my_product"
|
|
8004
|
+
* // }
|
|
8005
|
+
* },
|
|
8006
|
+
* });
|
|
8007
|
+
* console.log(res.data);
|
|
8008
|
+
*
|
|
8009
|
+
* // Example response
|
|
8010
|
+
* // {}
|
|
8011
|
+
* }
|
|
8012
|
+
*
|
|
8013
|
+
* main().catch(e => {
|
|
8014
|
+
* console.error(e);
|
|
8015
|
+
* throw e;
|
|
8016
|
+
* });
|
|
8017
|
+
*
|
|
8018
|
+
* ```
|
|
5960
8019
|
*
|
|
5961
8020
|
* @param params - Parameters for request
|
|
5962
8021
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
5963
8022
|
* @param callback - Optional callback that handles the response.
|
|
5964
8023
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
5965
8024
|
*/
|
|
5966
|
-
removeProduct(params: Params$Resource$Projects$Locations$Productsets$Removeproduct, options: StreamMethodOptions):
|
|
5967
|
-
removeProduct(params?: Params$Resource$Projects$Locations$Productsets$Removeproduct, options?: MethodOptions):
|
|
8025
|
+
removeProduct(params: Params$Resource$Projects$Locations$Productsets$Removeproduct, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
8026
|
+
removeProduct(params?: Params$Resource$Projects$Locations$Productsets$Removeproduct, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
5968
8027
|
removeProduct(params: Params$Resource$Projects$Locations$Productsets$Removeproduct, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
5969
8028
|
removeProduct(params: Params$Resource$Projects$Locations$Productsets$Removeproduct, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
5970
8029
|
removeProduct(params: Params$Resource$Projects$Locations$Productsets$Removeproduct, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
@@ -6059,14 +8118,68 @@ export declare namespace vision_v1 {
|
|
|
6059
8118
|
constructor(context: APIRequestContext);
|
|
6060
8119
|
/**
|
|
6061
8120
|
* Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
|
|
8121
|
+
* @example
|
|
8122
|
+
* ```js
|
|
8123
|
+
* // Before running the sample:
|
|
8124
|
+
* // - Enable the API at:
|
|
8125
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
8126
|
+
* // - Login into gcloud by running:
|
|
8127
|
+
* // ```sh
|
|
8128
|
+
* // $ gcloud auth application-default login
|
|
8129
|
+
* // ```
|
|
8130
|
+
* // - Install the npm module by running:
|
|
8131
|
+
* // ```sh
|
|
8132
|
+
* // $ npm install googleapis
|
|
8133
|
+
* // ```
|
|
8134
|
+
*
|
|
8135
|
+
* const {google} = require('googleapis');
|
|
8136
|
+
* const vision = google.vision('v1');
|
|
8137
|
+
*
|
|
8138
|
+
* async function main() {
|
|
8139
|
+
* const auth = new google.auth.GoogleAuth({
|
|
8140
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
8141
|
+
* scopes: [
|
|
8142
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
8143
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
8144
|
+
* ],
|
|
8145
|
+
* });
|
|
8146
|
+
*
|
|
8147
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
8148
|
+
* const authClient = await auth.getClient();
|
|
8149
|
+
* google.options({auth: authClient});
|
|
8150
|
+
*
|
|
8151
|
+
* // Do the magic
|
|
8152
|
+
* const res = await vision.projects.locations.productSets.products.list({
|
|
8153
|
+
* // Required. The ProductSet resource for which to retrieve Products. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
|
|
8154
|
+
* name: 'projects/my-project/locations/my-location/productSets/my-productSet',
|
|
8155
|
+
* // The maximum number of items to return. Default 10, maximum 100.
|
|
8156
|
+
* pageSize: 'placeholder-value',
|
|
8157
|
+
* // The next_page_token returned from a previous List request, if any.
|
|
8158
|
+
* pageToken: 'placeholder-value',
|
|
8159
|
+
* });
|
|
8160
|
+
* console.log(res.data);
|
|
8161
|
+
*
|
|
8162
|
+
* // Example response
|
|
8163
|
+
* // {
|
|
8164
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
8165
|
+
* // "products": []
|
|
8166
|
+
* // }
|
|
8167
|
+
* }
|
|
8168
|
+
*
|
|
8169
|
+
* main().catch(e => {
|
|
8170
|
+
* console.error(e);
|
|
8171
|
+
* throw e;
|
|
8172
|
+
* });
|
|
8173
|
+
*
|
|
8174
|
+
* ```
|
|
6062
8175
|
*
|
|
6063
8176
|
* @param params - Parameters for request
|
|
6064
8177
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
6065
8178
|
* @param callback - Optional callback that handles the response.
|
|
6066
8179
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
6067
8180
|
*/
|
|
6068
|
-
list(params: Params$Resource$Projects$Locations$Productsets$Products$List, options: StreamMethodOptions):
|
|
6069
|
-
list(params?: Params$Resource$Projects$Locations$Productsets$Products$List, options?: MethodOptions):
|
|
8181
|
+
list(params: Params$Resource$Projects$Locations$Productsets$Products$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
8182
|
+
list(params?: Params$Resource$Projects$Locations$Productsets$Products$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListProductsInProductSetResponse>>;
|
|
6070
8183
|
list(params: Params$Resource$Projects$Locations$Productsets$Products$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
6071
8184
|
list(params: Params$Resource$Projects$Locations$Productsets$Products$List, options: MethodOptions | BodyResponseCallback<Schema$ListProductsInProductSetResponse>, callback: BodyResponseCallback<Schema$ListProductsInProductSetResponse>): void;
|
|
6072
8185
|
list(params: Params$Resource$Projects$Locations$Productsets$Products$List, callback: BodyResponseCallback<Schema$ListProductsInProductSetResponse>): void;
|
|
@@ -6091,14 +8204,67 @@ export declare namespace vision_v1 {
|
|
|
6091
8204
|
constructor(context: APIRequestContext);
|
|
6092
8205
|
/**
|
|
6093
8206
|
* Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
|
8207
|
+
* @example
|
|
8208
|
+
* ```js
|
|
8209
|
+
* // Before running the sample:
|
|
8210
|
+
* // - Enable the API at:
|
|
8211
|
+
* // https://console.developers.google.com/apis/api/vision.googleapis.com
|
|
8212
|
+
* // - Login into gcloud by running:
|
|
8213
|
+
* // ```sh
|
|
8214
|
+
* // $ gcloud auth application-default login
|
|
8215
|
+
* // ```
|
|
8216
|
+
* // - Install the npm module by running:
|
|
8217
|
+
* // ```sh
|
|
8218
|
+
* // $ npm install googleapis
|
|
8219
|
+
* // ```
|
|
8220
|
+
*
|
|
8221
|
+
* const {google} = require('googleapis');
|
|
8222
|
+
* const vision = google.vision('v1');
|
|
8223
|
+
*
|
|
8224
|
+
* async function main() {
|
|
8225
|
+
* const auth = new google.auth.GoogleAuth({
|
|
8226
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
8227
|
+
* scopes: [
|
|
8228
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
8229
|
+
* 'https://www.googleapis.com/auth/cloud-vision',
|
|
8230
|
+
* ],
|
|
8231
|
+
* });
|
|
8232
|
+
*
|
|
8233
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
8234
|
+
* const authClient = await auth.getClient();
|
|
8235
|
+
* google.options({auth: authClient});
|
|
8236
|
+
*
|
|
8237
|
+
* // Do the magic
|
|
8238
|
+
* const res = await vision.projects.operations.get({
|
|
8239
|
+
* // The name of the operation resource.
|
|
8240
|
+
* name: 'projects/my-project/operations/my-operation',
|
|
8241
|
+
* });
|
|
8242
|
+
* console.log(res.data);
|
|
8243
|
+
*
|
|
8244
|
+
* // Example response
|
|
8245
|
+
* // {
|
|
8246
|
+
* // "done": false,
|
|
8247
|
+
* // "error": {},
|
|
8248
|
+
* // "metadata": {},
|
|
8249
|
+
* // "name": "my_name",
|
|
8250
|
+
* // "response": {}
|
|
8251
|
+
* // }
|
|
8252
|
+
* }
|
|
8253
|
+
*
|
|
8254
|
+
* main().catch(e => {
|
|
8255
|
+
* console.error(e);
|
|
8256
|
+
* throw e;
|
|
8257
|
+
* });
|
|
8258
|
+
*
|
|
8259
|
+
* ```
|
|
6094
8260
|
*
|
|
6095
8261
|
* @param params - Parameters for request
|
|
6096
8262
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
6097
8263
|
* @param callback - Optional callback that handles the response.
|
|
6098
8264
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
6099
8265
|
*/
|
|
6100
|
-
get(params: Params$Resource$Projects$Operations$Get, options: StreamMethodOptions):
|
|
6101
|
-
get(params?: Params$Resource$Projects$Operations$Get, options?: MethodOptions):
|
|
8266
|
+
get(params: Params$Resource$Projects$Operations$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
8267
|
+
get(params?: Params$Resource$Projects$Operations$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
6102
8268
|
get(params: Params$Resource$Projects$Operations$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
6103
8269
|
get(params: Params$Resource$Projects$Operations$Get, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
6104
8270
|
get(params: Params$Resource$Projects$Operations$Get, callback: BodyResponseCallback<Schema$Operation>): void;
|