@google-cloud/discoveryengine 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/protos/protos.d.ts +31 -316
  3. package/build/protos/protos.js +146 -593
  4. package/build/protos/protos.json +25 -1
  5. package/build/src/index.d.ts +1 -1
  6. package/build/src/index.js +1 -21
  7. package/build/src/v1/completion_service_client.d.ts +76 -76
  8. package/build/src/v1/completion_service_client.js +125 -262
  9. package/build/src/v1/control_service_client.d.ts +81 -81
  10. package/build/src/v1/control_service_client.js +96 -132
  11. package/build/src/v1/conversational_search_service_client.d.ts +143 -143
  12. package/build/src/v1/conversational_search_service_client.js +138 -226
  13. package/build/src/v1/data_store_service_client.d.ts +122 -122
  14. package/build/src/v1/data_store_service_client.js +134 -280
  15. package/build/src/v1/document_service_client.d.ts +120 -120
  16. package/build/src/v1/document_service_client.js +143 -300
  17. package/build/src/v1/engine_service_client.d.ts +103 -103
  18. package/build/src/v1/engine_service_client.js +134 -279
  19. package/build/src/v1/grounded_generation_service_client.d.ts +48 -48
  20. package/build/src/v1/grounded_generation_service_client.js +79 -100
  21. package/build/src/v1/project_service_client.d.ts +76 -76
  22. package/build/src/v1/project_service_client.js +108 -222
  23. package/build/src/v1/rank_service_client.d.ts +47 -47
  24. package/build/src/v1/rank_service_client.js +72 -85
  25. package/build/src/v1/recommendation_service_client.d.ts +47 -47
  26. package/build/src/v1/recommendation_service_client.js +70 -82
  27. package/build/src/v1/schema_service_client.d.ts +111 -111
  28. package/build/src/v1/schema_service_client.js +131 -273
  29. package/build/src/v1/search_service_client.d.ts +545 -545
  30. package/build/src/v1/search_service_client.js +90 -113
  31. package/build/src/v1/search_tuning_service_client.d.ts +77 -77
  32. package/build/src/v1/search_tuning_service_client.js +113 -235
  33. package/build/src/v1/serving_config_service_client.d.ts +48 -48
  34. package/build/src/v1/serving_config_service_client.js +69 -80
  35. package/build/src/v1/site_search_engine_service_client.d.ts +148 -148
  36. package/build/src/v1/site_search_engine_service_client.js +179 -378
  37. package/build/src/v1/user_event_service_client.d.ts +77 -77
  38. package/build/src/v1/user_event_service_client.js +121 -253
  39. package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
  40. package/build/src/v1alpha/acl_config_service_client.js +82 -106
  41. package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
  42. package/build/src/v1alpha/chunk_service_client.js +92 -120
  43. package/build/src/v1alpha/completion_service_client.d.ts +77 -77
  44. package/build/src/v1alpha/completion_service_client.js +134 -280
  45. package/build/src/v1alpha/control_service_client.d.ts +85 -85
  46. package/build/src/v1alpha/control_service_client.js +105 -151
  47. package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
  48. package/build/src/v1alpha/conversational_search_service_client.js +145 -237
  49. package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
  50. package/build/src/v1alpha/data_store_service_client.js +151 -316
  51. package/build/src/v1alpha/document_service_client.d.ts +126 -126
  52. package/build/src/v1alpha/document_service_client.js +156 -328
  53. package/build/src/v1alpha/engine_service_client.d.ts +106 -106
  54. package/build/src/v1alpha/engine_service_client.js +155 -325
  55. package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
  56. package/build/src/v1alpha/estimate_billing_service_client.js +118 -243
  57. package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
  58. package/build/src/v1alpha/evaluation_service_client.js +143 -295
  59. package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
  60. package/build/src/v1alpha/grounded_generation_service_client.js +79 -100
  61. package/build/src/v1alpha/project_service_client.d.ts +78 -78
  62. package/build/src/v1alpha/project_service_client.js +126 -262
  63. package/build/src/v1alpha/rank_service_client.d.ts +47 -47
  64. package/build/src/v1alpha/rank_service_client.js +81 -104
  65. package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
  66. package/build/src/v1alpha/recommendation_service_client.js +79 -100
  67. package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
  68. package/build/src/v1alpha/sample_query_service_client.js +144 -301
  69. package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
  70. package/build/src/v1alpha/sample_query_set_service_client.js +106 -153
  71. package/build/src/v1alpha/schema_service_client.d.ts +112 -112
  72. package/build/src/v1alpha/schema_service_client.js +140 -292
  73. package/build/src/v1alpha/search_service_client.d.ts +327 -327
  74. package/build/src/v1alpha/search_service_client.js +88 -112
  75. package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
  76. package/build/src/v1alpha/search_tuning_service_client.js +122 -253
  77. package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
  78. package/build/src/v1alpha/serving_config_service_client.js +97 -133
  79. package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
  80. package/build/src/v1alpha/site_search_engine_service_client.js +184 -387
  81. package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
  82. package/build/src/v1alpha/user_event_service_client.js +130 -271
  83. package/build/src/v1beta/completion_service_client.d.ts +78 -78
  84. package/build/src/v1beta/completion_service_client.js +136 -279
  85. package/build/src/v1beta/control_service_client.d.ts +84 -84
  86. package/build/src/v1beta/control_service_client.js +103 -147
  87. package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
  88. package/build/src/v1beta/conversational_search_service_client.js +143 -233
  89. package/build/src/v1beta/data_store_service_client.d.ts +124 -124
  90. package/build/src/v1beta/data_store_service_client.js +141 -288
  91. package/build/src/v1beta/document_service_client.d.ts +124 -124
  92. package/build/src/v1beta/document_service_client.js +150 -309
  93. package/build/src/v1beta/engine_service_client.d.ts +106 -106
  94. package/build/src/v1beta/engine_service_client.js +153 -315
  95. package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
  96. package/build/src/v1beta/evaluation_service_client.js +141 -285
  97. package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
  98. package/build/src/v1beta/grounded_generation_service_client.js +86 -114
  99. package/build/src/v1beta/project_service_client.d.ts +76 -76
  100. package/build/src/v1beta/project_service_client.js +115 -231
  101. package/build/src/v1beta/rank_service_client.d.ts +47 -47
  102. package/build/src/v1beta/rank_service_client.js +79 -99
  103. package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
  104. package/build/src/v1beta/recommendation_service_client.js +77 -96
  105. package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
  106. package/build/src/v1beta/sample_query_service_client.js +142 -291
  107. package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
  108. package/build/src/v1beta/sample_query_set_service_client.js +104 -149
  109. package/build/src/v1beta/schema_service_client.d.ts +111 -111
  110. package/build/src/v1beta/schema_service_client.js +138 -282
  111. package/build/src/v1beta/search_service_client.d.ts +665 -665
  112. package/build/src/v1beta/search_service_client.js +97 -128
  113. package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
  114. package/build/src/v1beta/search_tuning_service_client.js +120 -243
  115. package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
  116. package/build/src/v1beta/serving_config_service_client.js +95 -129
  117. package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
  118. package/build/src/v1beta/site_search_engine_service_client.js +186 -386
  119. package/build/src/v1beta/user_event_service_client.d.ts +78 -78
  120. package/build/src/v1beta/user_event_service_client.js +128 -261
  121. package/package.json +1 -1
@@ -100,26 +100,17 @@ class ControlServiceClient {
100
100
  constructor(opts, gaxInstance) {
101
101
  // Ensure that options include all the required fields.
102
102
  const staticMembers = this.constructor;
103
- if (opts?.universe_domain &&
104
- opts?.universeDomain &&
105
- opts?.universe_domain !== opts?.universeDomain) {
103
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
106
104
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
107
105
  }
108
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
109
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
110
- : undefined;
111
- this._universeDomain =
112
- opts?.universeDomain ??
113
- opts?.universe_domain ??
114
- universeDomainEnvVar ??
115
- 'googleapis.com';
106
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
107
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
116
108
  this._servicePath = 'discoveryengine.' + this._universeDomain;
117
109
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
118
110
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
119
111
  const port = opts?.port || staticMembers.port;
120
112
  const clientConfig = opts?.clientConfig ?? {};
121
- const fallback = opts?.fallback ??
122
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
113
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
123
114
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
124
115
  // Request numeric enum values if REST transport is used.
125
116
  opts.numericEnums = true;
@@ -149,7 +140,10 @@ class ControlServiceClient {
149
140
  }
150
141
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
151
142
  // Determine the client header string.
152
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
143
+ const clientHeader = [
144
+ `gax/${this._gaxModule.version}`,
145
+ `gapic/${version}`,
146
+ ];
153
147
  if (typeof process === 'object' && 'versions' in process) {
154
148
  clientHeader.push(`gl-node/${process.versions.node}`);
155
149
  }
@@ -216,7 +210,7 @@ class ControlServiceClient {
216
210
  // (e.g. 50 results at a time, with tokens to get subsequent
217
211
  // pages). Denote the keys used for pagination and results.
218
212
  this.descriptors.page = {
219
- listControls: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'controls'),
213
+ listControls: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'controls')
220
214
  };
221
215
  // Put together the default options sent with requests.
222
216
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.ControlService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -245,20 +239,13 @@ class ControlServiceClient {
245
239
  }
246
240
  // Put together the "service stub" for
247
241
  // google.cloud.discoveryengine.v1beta.ControlService.
248
- this.controlServiceStub = this._gaxGrpc.createStub(this._opts.fallback
249
- ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.ControlService')
250
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
251
- this._protos.google.cloud.discoveryengine.v1beta
252
- .ControlService, this._opts, this._providedCustomServicePath);
242
+ this.controlServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
243
+ this._protos.lookupService('google.cloud.discoveryengine.v1beta.ControlService') :
244
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
245
+ this._protos.google.cloud.discoveryengine.v1beta.ControlService, this._opts, this._providedCustomServicePath);
253
246
  // Iterate over each of the methods that the service provides
254
247
  // and create an API call method for each.
255
- const controlServiceStubMethods = [
256
- 'createControl',
257
- 'deleteControl',
258
- 'updateControl',
259
- 'getControl',
260
- 'listControls',
261
- ];
248
+ const controlServiceStubMethods = ['createControl', 'deleteControl', 'updateControl', 'getControl', 'listControls'];
262
249
  for (const methodName of controlServiceStubMethods) {
263
250
  const callPromise = this.controlServiceStub.then(stub => (...args) => {
264
251
  if (this._terminated) {
@@ -269,7 +256,8 @@ class ControlServiceClient {
269
256
  }, (err) => () => {
270
257
  throw err;
271
258
  });
272
- const descriptor = this.descriptors.page[methodName] || undefined;
259
+ const descriptor = this.descriptors.page[methodName] ||
260
+ undefined;
273
261
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
274
262
  this.innerApiCalls[methodName] = apiCall;
275
263
  }
@@ -281,8 +269,7 @@ class ControlServiceClient {
281
269
  * @returns {string} The DNS address for this service.
282
270
  */
283
271
  static get servicePath() {
284
- if (typeof process === 'object' &&
285
- typeof process.emitWarning === 'function') {
272
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
286
273
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
287
274
  }
288
275
  return 'discoveryengine.googleapis.com';
@@ -293,8 +280,7 @@ class ControlServiceClient {
293
280
  * @returns {string} The DNS address for this service.
294
281
  */
295
282
  static get apiEndpoint() {
296
- if (typeof process === 'object' &&
297
- typeof process.emitWarning === 'function') {
283
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
298
284
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
299
285
  }
300
286
  return 'discoveryengine.googleapis.com';
@@ -322,7 +308,9 @@ class ControlServiceClient {
322
308
  * @returns {string[]} List of default scopes.
323
309
  */
324
310
  static get scopes() {
325
- return ['https://www.googleapis.com/auth/cloud-platform'];
311
+ return [
312
+ 'https://www.googleapis.com/auth/cloud-platform'
313
+ ];
326
314
  }
327
315
  /**
328
316
  * Return the project ID used by this class.
@@ -348,13 +336,10 @@ class ControlServiceClient {
348
336
  options = options || {};
349
337
  options.otherArgs = options.otherArgs || {};
350
338
  options.otherArgs.headers = options.otherArgs.headers || {};
351
- options.otherArgs.headers['x-goog-request-params'] =
352
- this._gaxModule.routingHeader.fromParams({
353
- parent: request.parent ?? '',
354
- });
355
- this.initialize().catch(err => {
356
- throw err;
339
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
340
+ 'parent': request.parent ?? '',
357
341
  });
342
+ this.initialize().catch(err => { throw err; });
358
343
  this._log.info('createControl request %j', request);
359
344
  const wrappedCallback = callback
360
345
  ? (error, response, options, rawResponse) => {
@@ -362,8 +347,7 @@ class ControlServiceClient {
362
347
  callback(error, response, options, rawResponse); // We verified callback above.
363
348
  }
364
349
  : undefined;
365
- return this.innerApiCalls
366
- .createControl(request, options, wrappedCallback)
350
+ return this.innerApiCalls.createControl(request, options, wrappedCallback)
367
351
  ?.then(([response, options, rawResponse]) => {
368
352
  this._log.info('createControl response %j', response);
369
353
  return [response, options, rawResponse];
@@ -382,13 +366,10 @@ class ControlServiceClient {
382
366
  options = options || {};
383
367
  options.otherArgs = options.otherArgs || {};
384
368
  options.otherArgs.headers = options.otherArgs.headers || {};
385
- options.otherArgs.headers['x-goog-request-params'] =
386
- this._gaxModule.routingHeader.fromParams({
387
- name: request.name ?? '',
388
- });
389
- this.initialize().catch(err => {
390
- throw err;
369
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
370
+ 'name': request.name ?? '',
391
371
  });
372
+ this.initialize().catch(err => { throw err; });
392
373
  this._log.info('deleteControl request %j', request);
393
374
  const wrappedCallback = callback
394
375
  ? (error, response, options, rawResponse) => {
@@ -396,8 +377,7 @@ class ControlServiceClient {
396
377
  callback(error, response, options, rawResponse); // We verified callback above.
397
378
  }
398
379
  : undefined;
399
- return this.innerApiCalls
400
- .deleteControl(request, options, wrappedCallback)
380
+ return this.innerApiCalls.deleteControl(request, options, wrappedCallback)
401
381
  ?.then(([response, options, rawResponse]) => {
402
382
  this._log.info('deleteControl response %j', response);
403
383
  return [response, options, rawResponse];
@@ -416,13 +396,10 @@ class ControlServiceClient {
416
396
  options = options || {};
417
397
  options.otherArgs = options.otherArgs || {};
418
398
  options.otherArgs.headers = options.otherArgs.headers || {};
419
- options.otherArgs.headers['x-goog-request-params'] =
420
- this._gaxModule.routingHeader.fromParams({
421
- 'control.name': request.control.name ?? '',
422
- });
423
- this.initialize().catch(err => {
424
- throw err;
399
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
400
+ 'control.name': request.control.name ?? '',
425
401
  });
402
+ this.initialize().catch(err => { throw err; });
426
403
  this._log.info('updateControl request %j', request);
427
404
  const wrappedCallback = callback
428
405
  ? (error, response, options, rawResponse) => {
@@ -430,8 +407,7 @@ class ControlServiceClient {
430
407
  callback(error, response, options, rawResponse); // We verified callback above.
431
408
  }
432
409
  : undefined;
433
- return this.innerApiCalls
434
- .updateControl(request, options, wrappedCallback)
410
+ return this.innerApiCalls.updateControl(request, options, wrappedCallback)
435
411
  ?.then(([response, options, rawResponse]) => {
436
412
  this._log.info('updateControl response %j', response);
437
413
  return [response, options, rawResponse];
@@ -450,13 +426,10 @@ class ControlServiceClient {
450
426
  options = options || {};
451
427
  options.otherArgs = options.otherArgs || {};
452
428
  options.otherArgs.headers = options.otherArgs.headers || {};
453
- options.otherArgs.headers['x-goog-request-params'] =
454
- this._gaxModule.routingHeader.fromParams({
455
- name: request.name ?? '',
456
- });
457
- this.initialize().catch(err => {
458
- throw err;
429
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
430
+ 'name': request.name ?? '',
459
431
  });
432
+ this.initialize().catch(err => { throw err; });
460
433
  this._log.info('getControl request %j', request);
461
434
  const wrappedCallback = callback
462
435
  ? (error, response, options, rawResponse) => {
@@ -464,8 +437,7 @@ class ControlServiceClient {
464
437
  callback(error, response, options, rawResponse); // We verified callback above.
465
438
  }
466
439
  : undefined;
467
- return this.innerApiCalls
468
- .getControl(request, options, wrappedCallback)
440
+ return this.innerApiCalls.getControl(request, options, wrappedCallback)
469
441
  ?.then(([response, options, rawResponse]) => {
470
442
  this._log.info('getControl response %j', response);
471
443
  return [response, options, rawResponse];
@@ -484,13 +456,10 @@ class ControlServiceClient {
484
456
  options = options || {};
485
457
  options.otherArgs = options.otherArgs || {};
486
458
  options.otherArgs.headers = options.otherArgs.headers || {};
487
- options.otherArgs.headers['x-goog-request-params'] =
488
- this._gaxModule.routingHeader.fromParams({
489
- parent: request.parent ?? '',
490
- });
491
- this.initialize().catch(err => {
492
- throw err;
459
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
460
+ 'parent': request.parent ?? '',
493
461
  });
462
+ this.initialize().catch(err => { throw err; });
494
463
  const wrappedCallback = callback
495
464
  ? (error, values, nextPageRequest, rawResponse) => {
496
465
  this._log.info('listControls values %j', values);
@@ -542,15 +511,12 @@ class ControlServiceClient {
542
511
  options = options || {};
543
512
  options.otherArgs = options.otherArgs || {};
544
513
  options.otherArgs.headers = options.otherArgs.headers || {};
545
- options.otherArgs.headers['x-goog-request-params'] =
546
- this._gaxModule.routingHeader.fromParams({
547
- parent: request.parent ?? '',
548
- });
514
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
515
+ 'parent': request.parent ?? '',
516
+ });
549
517
  const defaultCallSettings = this._defaults['listControls'];
550
518
  const callSettings = defaultCallSettings.merge(options);
551
- this.initialize().catch(err => {
552
- throw err;
553
- });
519
+ this.initialize().catch(err => { throw err; });
554
520
  this._log.info('listControls stream %j', request);
555
521
  return this.descriptors.page.listControls.createStream(this.innerApiCalls.listControls, request, callSettings);
556
522
  }
@@ -594,70 +560,67 @@ class ControlServiceClient {
594
560
  options = options || {};
595
561
  options.otherArgs = options.otherArgs || {};
596
562
  options.otherArgs.headers = options.otherArgs.headers || {};
597
- options.otherArgs.headers['x-goog-request-params'] =
598
- this._gaxModule.routingHeader.fromParams({
599
- parent: request.parent ?? '',
600
- });
563
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
564
+ 'parent': request.parent ?? '',
565
+ });
601
566
  const defaultCallSettings = this._defaults['listControls'];
602
567
  const callSettings = defaultCallSettings.merge(options);
603
- this.initialize().catch(err => {
604
- throw err;
605
- });
568
+ this.initialize().catch(err => { throw err; });
606
569
  this._log.info('listControls iterate %j', request);
607
570
  return this.descriptors.page.listControls.asyncIterate(this.innerApiCalls['listControls'], request, callSettings);
608
571
  }
609
572
  /**
610
- * Gets information about a location.
611
- *
612
- * @param {Object} request
613
- * The request object that will be sent.
614
- * @param {string} request.name
615
- * Resource name for the location.
616
- * @param {object} [options]
617
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
618
- * @returns {Promise} - The promise which resolves to an array.
619
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
620
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
621
- * for more details and examples.
622
- * @example
623
- * ```
624
- * const [response] = await client.getLocation(request);
625
- * ```
626
- */
573
+ * Gets information about a location.
574
+ *
575
+ * @param {Object} request
576
+ * The request object that will be sent.
577
+ * @param {string} request.name
578
+ * Resource name for the location.
579
+ * @param {object} [options]
580
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
581
+ * @returns {Promise} - The promise which resolves to an array.
582
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
583
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
584
+ * for more details and examples.
585
+ * @example
586
+ * ```
587
+ * const [response] = await client.getLocation(request);
588
+ * ```
589
+ */
627
590
  getLocation(request, options, callback) {
628
591
  return this.locationsClient.getLocation(request, options, callback);
629
592
  }
630
593
  /**
631
- * Lists information about the supported locations for this service. Returns an iterable object.
632
- *
633
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
634
- * @param {Object} request
635
- * The request object that will be sent.
636
- * @param {string} request.name
637
- * The resource that owns the locations collection, if applicable.
638
- * @param {string} request.filter
639
- * The standard list filter.
640
- * @param {number} request.pageSize
641
- * The standard list page size.
642
- * @param {string} request.pageToken
643
- * The standard list page token.
644
- * @param {object} [options]
645
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
646
- * @returns {Object}
647
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
648
- * When you iterate the returned iterable, each element will be an object representing
649
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
650
- * so you can stop the iteration when you don't need more results.
651
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
652
- * for more details and examples.
653
- * @example
654
- * ```
655
- * const iterable = client.listLocationsAsync(request);
656
- * for await (const response of iterable) {
657
- * // process response
658
- * }
659
- * ```
660
- */
594
+ * Lists information about the supported locations for this service. Returns an iterable object.
595
+ *
596
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
597
+ * @param {Object} request
598
+ * The request object that will be sent.
599
+ * @param {string} request.name
600
+ * The resource that owns the locations collection, if applicable.
601
+ * @param {string} request.filter
602
+ * The standard list filter.
603
+ * @param {number} request.pageSize
604
+ * The standard list page size.
605
+ * @param {string} request.pageToken
606
+ * The standard list page token.
607
+ * @param {object} [options]
608
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
609
+ * @returns {Object}
610
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
611
+ * When you iterate the returned iterable, each element will be an object representing
612
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
613
+ * so you can stop the iteration when you don't need more results.
614
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
615
+ * for more details and examples.
616
+ * @example
617
+ * ```
618
+ * const iterable = client.listLocationsAsync(request);
619
+ * for await (const response of iterable) {
620
+ * // process response
621
+ * }
622
+ * ```
623
+ */
661
624
  listLocationsAsync(request, options) {
662
625
  return this.locationsClient.listLocationsAsync(request, options);
663
626
  }
@@ -744,8 +707,7 @@ class ControlServiceClient {
744
707
  * @returns {string} A string representing the project.
745
708
  */
746
709
  matchProjectFromEvaluationName(evaluationName) {
747
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
748
- .project;
710
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
749
711
  }
750
712
  /**
751
713
  * Parse the location from Evaluation resource.
@@ -755,8 +717,7 @@ class ControlServiceClient {
755
717
  * @returns {string} A string representing the location.
756
718
  */
757
719
  matchLocationFromEvaluationName(evaluationName) {
758
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
759
- .location;
720
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
760
721
  }
761
722
  /**
762
723
  * Parse the evaluation from Evaluation resource.
@@ -766,8 +727,7 @@ class ControlServiceClient {
766
727
  * @returns {string} A string representing the evaluation.
767
728
  */
768
729
  matchEvaluationFromEvaluationName(evaluationName) {
769
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
770
- .evaluation;
730
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
771
731
  }
772
732
  /**
773
733
  * Return a fully-qualified groundingConfig resource name string.
@@ -3038,8 +2998,7 @@ class ControlServiceClient {
3038
2998
  * @returns {string} A string representing the project.
3039
2999
  */
3040
3000
  matchProjectFromSampleQueryName(sampleQueryName) {
3041
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3042
- .project;
3001
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3043
3002
  }
3044
3003
  /**
3045
3004
  * Parse the location from SampleQuery resource.
@@ -3049,8 +3008,7 @@ class ControlServiceClient {
3049
3008
  * @returns {string} A string representing the location.
3050
3009
  */
3051
3010
  matchLocationFromSampleQueryName(sampleQueryName) {
3052
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3053
- .location;
3011
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3054
3012
  }
3055
3013
  /**
3056
3014
  * Parse the sample_query_set from SampleQuery resource.
@@ -3060,8 +3018,7 @@ class ControlServiceClient {
3060
3018
  * @returns {string} A string representing the sample_query_set.
3061
3019
  */
3062
3020
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3063
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3064
- .sample_query_set;
3021
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3065
3022
  }
3066
3023
  /**
3067
3024
  * Parse the sample_query from SampleQuery resource.
@@ -3071,8 +3028,7 @@ class ControlServiceClient {
3071
3028
  * @returns {string} A string representing the sample_query.
3072
3029
  */
3073
3030
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3074
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3075
- .sample_query;
3031
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3076
3032
  }
3077
3033
  /**
3078
3034
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3131,7 +3087,7 @@ class ControlServiceClient {
3131
3087
  this._log.info('ending gRPC channel');
3132
3088
  this._terminated = true;
3133
3089
  stub.close();
3134
- this.locationsClient.close();
3090
+ this.locationsClient.close().catch(err => { throw err; });
3135
3091
  });
3136
3092
  }
3137
3093
  return Promise.resolve();