@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
@@ -97,28 +97,18 @@ class ConversationalSearchServiceClient {
97
97
  */
98
98
  constructor(opts, gaxInstance) {
99
99
  // Ensure that options include all the required fields.
100
- const staticMembers = this
101
- .constructor;
102
- if (opts?.universe_domain &&
103
- opts?.universeDomain &&
104
- opts?.universe_domain !== opts?.universeDomain) {
100
+ const staticMembers = this.constructor;
101
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
105
102
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
106
103
  }
107
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
108
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
109
- : undefined;
110
- this._universeDomain =
111
- opts?.universeDomain ??
112
- opts?.universe_domain ??
113
- universeDomainEnvVar ??
114
- 'googleapis.com';
104
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
105
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
115
106
  this._servicePath = 'discoveryengine.' + this._universeDomain;
116
107
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
117
108
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
118
109
  const port = opts?.port || staticMembers.port;
119
110
  const clientConfig = opts?.clientConfig ?? {};
120
- const fallback = opts?.fallback ??
121
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
111
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
122
112
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
123
113
  // Request numeric enum values if REST transport is used.
124
114
  opts.numericEnums = true;
@@ -148,7 +138,10 @@ class ConversationalSearchServiceClient {
148
138
  }
149
139
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
150
140
  // Determine the client header string.
151
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
141
+ const clientHeader = [
142
+ `gax/${this._gaxModule.version}`,
143
+ `gapic/${version}`,
144
+ ];
152
145
  if (typeof process === 'object' && 'versions' in process) {
153
146
  clientHeader.push(`gl-node/${process.versions.node}`);
154
147
  }
@@ -211,12 +204,12 @@ class ConversationalSearchServiceClient {
211
204
  // pages). Denote the keys used for pagination and results.
212
205
  this.descriptors.page = {
213
206
  listConversations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'conversations'),
214
- listSessions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sessions'),
207
+ listSessions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sessions')
215
208
  };
216
209
  // Some of the methods on this service provide streaming responses.
217
210
  // Provide descriptors for these.
218
211
  this.descriptors.stream = {
219
- streamAnswerQuery: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
212
+ streamAnswerQuery: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries)
220
213
  };
221
214
  // Put together the default options sent with requests.
222
215
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.ConversationalSearchService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -245,29 +238,13 @@ class ConversationalSearchServiceClient {
245
238
  }
246
239
  // Put together the "service stub" for
247
240
  // google.cloud.discoveryengine.v1.ConversationalSearchService.
248
- this.conversationalSearchServiceStub = this._gaxGrpc.createStub(this._opts.fallback
249
- ? this._protos.lookupService('google.cloud.discoveryengine.v1.ConversationalSearchService')
250
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
251
- this._protos.google.cloud.discoveryengine.v1
252
- .ConversationalSearchService, this._opts, this._providedCustomServicePath);
241
+ this.conversationalSearchServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
242
+ this._protos.lookupService('google.cloud.discoveryengine.v1.ConversationalSearchService') :
243
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
244
+ this._protos.google.cloud.discoveryengine.v1.ConversationalSearchService, this._opts, this._providedCustomServicePath);
253
245
  // Iterate over each of the methods that the service provides
254
246
  // and create an API call method for each.
255
- const conversationalSearchServiceStubMethods = [
256
- 'converseConversation',
257
- 'createConversation',
258
- 'deleteConversation',
259
- 'updateConversation',
260
- 'getConversation',
261
- 'listConversations',
262
- 'answerQuery',
263
- 'streamAnswerQuery',
264
- 'getAnswer',
265
- 'createSession',
266
- 'deleteSession',
267
- 'updateSession',
268
- 'getSession',
269
- 'listSessions',
270
- ];
247
+ const conversationalSearchServiceStubMethods = ['converseConversation', 'createConversation', 'deleteConversation', 'updateConversation', 'getConversation', 'listConversations', 'answerQuery', 'streamAnswerQuery', 'getAnswer', 'createSession', 'deleteSession', 'updateSession', 'getSession', 'listSessions'];
271
248
  for (const methodName of conversationalSearchServiceStubMethods) {
272
249
  const callPromise = this.conversationalSearchServiceStub.then(stub => (...args) => {
273
250
  if (this._terminated) {
@@ -299,8 +276,7 @@ class ConversationalSearchServiceClient {
299
276
  * @returns {string} The DNS address for this service.
300
277
  */
301
278
  static get servicePath() {
302
- if (typeof process === 'object' &&
303
- typeof process.emitWarning === 'function') {
279
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
304
280
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
305
281
  }
306
282
  return 'discoveryengine.googleapis.com';
@@ -311,8 +287,7 @@ class ConversationalSearchServiceClient {
311
287
  * @returns {string} The DNS address for this service.
312
288
  */
313
289
  static get apiEndpoint() {
314
- if (typeof process === 'object' &&
315
- typeof process.emitWarning === 'function') {
290
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
316
291
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
317
292
  }
318
293
  return 'discoveryengine.googleapis.com';
@@ -340,7 +315,9 @@ class ConversationalSearchServiceClient {
340
315
  * @returns {string[]} List of default scopes.
341
316
  */
342
317
  static get scopes() {
343
- return ['https://www.googleapis.com/auth/cloud-platform'];
318
+ return [
319
+ 'https://www.googleapis.com/auth/cloud-platform'
320
+ ];
344
321
  }
345
322
  /**
346
323
  * Return the project ID used by this class.
@@ -366,13 +343,10 @@ class ConversationalSearchServiceClient {
366
343
  options = options || {};
367
344
  options.otherArgs = options.otherArgs || {};
368
345
  options.otherArgs.headers = options.otherArgs.headers || {};
369
- options.otherArgs.headers['x-goog-request-params'] =
370
- this._gaxModule.routingHeader.fromParams({
371
- name: request.name ?? '',
372
- });
373
- this.initialize().catch(err => {
374
- throw err;
346
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
347
+ 'name': request.name ?? '',
375
348
  });
349
+ this.initialize().catch(err => { throw err; });
376
350
  this._log.info('converseConversation request %j', request);
377
351
  const wrappedCallback = callback
378
352
  ? (error, response, options, rawResponse) => {
@@ -380,8 +354,7 @@ class ConversationalSearchServiceClient {
380
354
  callback(error, response, options, rawResponse); // We verified callback above.
381
355
  }
382
356
  : undefined;
383
- return this.innerApiCalls
384
- .converseConversation(request, options, wrappedCallback)
357
+ return this.innerApiCalls.converseConversation(request, options, wrappedCallback)
385
358
  ?.then(([response, options, rawResponse]) => {
386
359
  this._log.info('converseConversation response %j', response);
387
360
  return [response, options, rawResponse];
@@ -400,13 +373,10 @@ class ConversationalSearchServiceClient {
400
373
  options = options || {};
401
374
  options.otherArgs = options.otherArgs || {};
402
375
  options.otherArgs.headers = options.otherArgs.headers || {};
403
- options.otherArgs.headers['x-goog-request-params'] =
404
- this._gaxModule.routingHeader.fromParams({
405
- parent: request.parent ?? '',
406
- });
407
- this.initialize().catch(err => {
408
- throw err;
376
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
377
+ 'parent': request.parent ?? '',
409
378
  });
379
+ this.initialize().catch(err => { throw err; });
410
380
  this._log.info('createConversation request %j', request);
411
381
  const wrappedCallback = callback
412
382
  ? (error, response, options, rawResponse) => {
@@ -414,8 +384,7 @@ class ConversationalSearchServiceClient {
414
384
  callback(error, response, options, rawResponse); // We verified callback above.
415
385
  }
416
386
  : undefined;
417
- return this.innerApiCalls
418
- .createConversation(request, options, wrappedCallback)
387
+ return this.innerApiCalls.createConversation(request, options, wrappedCallback)
419
388
  ?.then(([response, options, rawResponse]) => {
420
389
  this._log.info('createConversation response %j', response);
421
390
  return [response, options, rawResponse];
@@ -434,13 +403,10 @@ class ConversationalSearchServiceClient {
434
403
  options = options || {};
435
404
  options.otherArgs = options.otherArgs || {};
436
405
  options.otherArgs.headers = options.otherArgs.headers || {};
437
- options.otherArgs.headers['x-goog-request-params'] =
438
- this._gaxModule.routingHeader.fromParams({
439
- name: request.name ?? '',
440
- });
441
- this.initialize().catch(err => {
442
- throw err;
406
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
407
+ 'name': request.name ?? '',
443
408
  });
409
+ this.initialize().catch(err => { throw err; });
444
410
  this._log.info('deleteConversation request %j', request);
445
411
  const wrappedCallback = callback
446
412
  ? (error, response, options, rawResponse) => {
@@ -448,8 +414,7 @@ class ConversationalSearchServiceClient {
448
414
  callback(error, response, options, rawResponse); // We verified callback above.
449
415
  }
450
416
  : undefined;
451
- return this.innerApiCalls
452
- .deleteConversation(request, options, wrappedCallback)
417
+ return this.innerApiCalls.deleteConversation(request, options, wrappedCallback)
453
418
  ?.then(([response, options, rawResponse]) => {
454
419
  this._log.info('deleteConversation response %j', response);
455
420
  return [response, options, rawResponse];
@@ -468,13 +433,10 @@ class ConversationalSearchServiceClient {
468
433
  options = options || {};
469
434
  options.otherArgs = options.otherArgs || {};
470
435
  options.otherArgs.headers = options.otherArgs.headers || {};
471
- options.otherArgs.headers['x-goog-request-params'] =
472
- this._gaxModule.routingHeader.fromParams({
473
- 'conversation.name': request.conversation.name ?? '',
474
- });
475
- this.initialize().catch(err => {
476
- throw err;
436
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
437
+ 'conversation.name': request.conversation.name ?? '',
477
438
  });
439
+ this.initialize().catch(err => { throw err; });
478
440
  this._log.info('updateConversation request %j', request);
479
441
  const wrappedCallback = callback
480
442
  ? (error, response, options, rawResponse) => {
@@ -482,8 +444,7 @@ class ConversationalSearchServiceClient {
482
444
  callback(error, response, options, rawResponse); // We verified callback above.
483
445
  }
484
446
  : undefined;
485
- return this.innerApiCalls
486
- .updateConversation(request, options, wrappedCallback)
447
+ return this.innerApiCalls.updateConversation(request, options, wrappedCallback)
487
448
  ?.then(([response, options, rawResponse]) => {
488
449
  this._log.info('updateConversation response %j', response);
489
450
  return [response, options, rawResponse];
@@ -502,13 +463,10 @@ class ConversationalSearchServiceClient {
502
463
  options = options || {};
503
464
  options.otherArgs = options.otherArgs || {};
504
465
  options.otherArgs.headers = options.otherArgs.headers || {};
505
- options.otherArgs.headers['x-goog-request-params'] =
506
- this._gaxModule.routingHeader.fromParams({
507
- name: request.name ?? '',
508
- });
509
- this.initialize().catch(err => {
510
- throw err;
466
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
467
+ 'name': request.name ?? '',
511
468
  });
469
+ this.initialize().catch(err => { throw err; });
512
470
  this._log.info('getConversation request %j', request);
513
471
  const wrappedCallback = callback
514
472
  ? (error, response, options, rawResponse) => {
@@ -516,8 +474,7 @@ class ConversationalSearchServiceClient {
516
474
  callback(error, response, options, rawResponse); // We verified callback above.
517
475
  }
518
476
  : undefined;
519
- return this.innerApiCalls
520
- .getConversation(request, options, wrappedCallback)
477
+ return this.innerApiCalls.getConversation(request, options, wrappedCallback)
521
478
  ?.then(([response, options, rawResponse]) => {
522
479
  this._log.info('getConversation response %j', response);
523
480
  return [response, options, rawResponse];
@@ -536,13 +493,10 @@ class ConversationalSearchServiceClient {
536
493
  options = options || {};
537
494
  options.otherArgs = options.otherArgs || {};
538
495
  options.otherArgs.headers = options.otherArgs.headers || {};
539
- options.otherArgs.headers['x-goog-request-params'] =
540
- this._gaxModule.routingHeader.fromParams({
541
- serving_config: request.servingConfig ?? '',
542
- });
543
- this.initialize().catch(err => {
544
- throw err;
496
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
497
+ 'serving_config': request.servingConfig ?? '',
545
498
  });
499
+ this.initialize().catch(err => { throw err; });
546
500
  this._log.info('answerQuery request %j', request);
547
501
  const wrappedCallback = callback
548
502
  ? (error, response, options, rawResponse) => {
@@ -550,8 +504,7 @@ class ConversationalSearchServiceClient {
550
504
  callback(error, response, options, rawResponse); // We verified callback above.
551
505
  }
552
506
  : undefined;
553
- return this.innerApiCalls
554
- .answerQuery(request, options, wrappedCallback)
507
+ return this.innerApiCalls.answerQuery(request, options, wrappedCallback)
555
508
  ?.then(([response, options, rawResponse]) => {
556
509
  this._log.info('answerQuery response %j', response);
557
510
  return [response, options, rawResponse];
@@ -570,13 +523,10 @@ class ConversationalSearchServiceClient {
570
523
  options = options || {};
571
524
  options.otherArgs = options.otherArgs || {};
572
525
  options.otherArgs.headers = options.otherArgs.headers || {};
573
- options.otherArgs.headers['x-goog-request-params'] =
574
- this._gaxModule.routingHeader.fromParams({
575
- name: request.name ?? '',
576
- });
577
- this.initialize().catch(err => {
578
- throw err;
526
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
527
+ 'name': request.name ?? '',
579
528
  });
529
+ this.initialize().catch(err => { throw err; });
580
530
  this._log.info('getAnswer request %j', request);
581
531
  const wrappedCallback = callback
582
532
  ? (error, response, options, rawResponse) => {
@@ -584,8 +534,7 @@ class ConversationalSearchServiceClient {
584
534
  callback(error, response, options, rawResponse); // We verified callback above.
585
535
  }
586
536
  : undefined;
587
- return this.innerApiCalls
588
- .getAnswer(request, options, wrappedCallback)
537
+ return this.innerApiCalls.getAnswer(request, options, wrappedCallback)
589
538
  ?.then(([response, options, rawResponse]) => {
590
539
  this._log.info('getAnswer response %j', response);
591
540
  return [response, options, rawResponse];
@@ -604,13 +553,10 @@ class ConversationalSearchServiceClient {
604
553
  options = options || {};
605
554
  options.otherArgs = options.otherArgs || {};
606
555
  options.otherArgs.headers = options.otherArgs.headers || {};
607
- options.otherArgs.headers['x-goog-request-params'] =
608
- this._gaxModule.routingHeader.fromParams({
609
- parent: request.parent ?? '',
610
- });
611
- this.initialize().catch(err => {
612
- throw err;
556
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
557
+ 'parent': request.parent ?? '',
613
558
  });
559
+ this.initialize().catch(err => { throw err; });
614
560
  this._log.info('createSession request %j', request);
615
561
  const wrappedCallback = callback
616
562
  ? (error, response, options, rawResponse) => {
@@ -618,8 +564,7 @@ class ConversationalSearchServiceClient {
618
564
  callback(error, response, options, rawResponse); // We verified callback above.
619
565
  }
620
566
  : undefined;
621
- return this.innerApiCalls
622
- .createSession(request, options, wrappedCallback)
567
+ return this.innerApiCalls.createSession(request, options, wrappedCallback)
623
568
  ?.then(([response, options, rawResponse]) => {
624
569
  this._log.info('createSession response %j', response);
625
570
  return [response, options, rawResponse];
@@ -638,13 +583,10 @@ class ConversationalSearchServiceClient {
638
583
  options = options || {};
639
584
  options.otherArgs = options.otherArgs || {};
640
585
  options.otherArgs.headers = options.otherArgs.headers || {};
641
- options.otherArgs.headers['x-goog-request-params'] =
642
- this._gaxModule.routingHeader.fromParams({
643
- name: request.name ?? '',
644
- });
645
- this.initialize().catch(err => {
646
- throw err;
586
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
587
+ 'name': request.name ?? '',
647
588
  });
589
+ this.initialize().catch(err => { throw err; });
648
590
  this._log.info('deleteSession request %j', request);
649
591
  const wrappedCallback = callback
650
592
  ? (error, response, options, rawResponse) => {
@@ -652,8 +594,7 @@ class ConversationalSearchServiceClient {
652
594
  callback(error, response, options, rawResponse); // We verified callback above.
653
595
  }
654
596
  : undefined;
655
- return this.innerApiCalls
656
- .deleteSession(request, options, wrappedCallback)
597
+ return this.innerApiCalls.deleteSession(request, options, wrappedCallback)
657
598
  ?.then(([response, options, rawResponse]) => {
658
599
  this._log.info('deleteSession response %j', response);
659
600
  return [response, options, rawResponse];
@@ -672,13 +613,10 @@ class ConversationalSearchServiceClient {
672
613
  options = options || {};
673
614
  options.otherArgs = options.otherArgs || {};
674
615
  options.otherArgs.headers = options.otherArgs.headers || {};
675
- options.otherArgs.headers['x-goog-request-params'] =
676
- this._gaxModule.routingHeader.fromParams({
677
- 'session.name': request.session.name ?? '',
678
- });
679
- this.initialize().catch(err => {
680
- throw err;
616
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
617
+ 'session.name': request.session.name ?? '',
681
618
  });
619
+ this.initialize().catch(err => { throw err; });
682
620
  this._log.info('updateSession request %j', request);
683
621
  const wrappedCallback = callback
684
622
  ? (error, response, options, rawResponse) => {
@@ -686,8 +624,7 @@ class ConversationalSearchServiceClient {
686
624
  callback(error, response, options, rawResponse); // We verified callback above.
687
625
  }
688
626
  : undefined;
689
- return this.innerApiCalls
690
- .updateSession(request, options, wrappedCallback)
627
+ return this.innerApiCalls.updateSession(request, options, wrappedCallback)
691
628
  ?.then(([response, options, rawResponse]) => {
692
629
  this._log.info('updateSession response %j', response);
693
630
  return [response, options, rawResponse];
@@ -706,13 +643,10 @@ class ConversationalSearchServiceClient {
706
643
  options = options || {};
707
644
  options.otherArgs = options.otherArgs || {};
708
645
  options.otherArgs.headers = options.otherArgs.headers || {};
709
- options.otherArgs.headers['x-goog-request-params'] =
710
- this._gaxModule.routingHeader.fromParams({
711
- name: request.name ?? '',
712
- });
713
- this.initialize().catch(err => {
714
- throw err;
646
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
647
+ 'name': request.name ?? '',
715
648
  });
649
+ this.initialize().catch(err => { throw err; });
716
650
  this._log.info('getSession request %j', request);
717
651
  const wrappedCallback = callback
718
652
  ? (error, response, options, rawResponse) => {
@@ -720,8 +654,7 @@ class ConversationalSearchServiceClient {
720
654
  callback(error, response, options, rawResponse); // We verified callback above.
721
655
  }
722
656
  : undefined;
723
- return this.innerApiCalls
724
- .getSession(request, options, wrappedCallback)
657
+ return this.innerApiCalls.getSession(request, options, wrappedCallback)
725
658
  ?.then(([response, options, rawResponse]) => {
726
659
  this._log.info('getSession response %j', response);
727
660
  return [response, options, rawResponse];
@@ -823,13 +756,10 @@ class ConversationalSearchServiceClient {
823
756
  options = options || {};
824
757
  options.otherArgs = options.otherArgs || {};
825
758
  options.otherArgs.headers = options.otherArgs.headers || {};
826
- options.otherArgs.headers['x-goog-request-params'] =
827
- this._gaxModule.routingHeader.fromParams({
828
- serving_config: request.servingConfig ?? '',
829
- });
830
- this.initialize().catch(err => {
831
- throw err;
759
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
760
+ 'serving_config': request.servingConfig ?? '',
832
761
  });
762
+ this.initialize().catch(err => { throw err; });
833
763
  this._log.info('streamAnswerQuery stream %j', options);
834
764
  return this.innerApiCalls.streamAnswerQuery(request, options);
835
765
  }
@@ -846,13 +776,10 @@ class ConversationalSearchServiceClient {
846
776
  options = options || {};
847
777
  options.otherArgs = options.otherArgs || {};
848
778
  options.otherArgs.headers = options.otherArgs.headers || {};
849
- options.otherArgs.headers['x-goog-request-params'] =
850
- this._gaxModule.routingHeader.fromParams({
851
- parent: request.parent ?? '',
852
- });
853
- this.initialize().catch(err => {
854
- throw err;
779
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
780
+ 'parent': request.parent ?? '',
855
781
  });
782
+ this.initialize().catch(err => { throw err; });
856
783
  const wrappedCallback = callback
857
784
  ? (error, values, nextPageRequest, rawResponse) => {
858
785
  this._log.info('listConversations values %j', values);
@@ -913,15 +840,12 @@ class ConversationalSearchServiceClient {
913
840
  options = options || {};
914
841
  options.otherArgs = options.otherArgs || {};
915
842
  options.otherArgs.headers = options.otherArgs.headers || {};
916
- options.otherArgs.headers['x-goog-request-params'] =
917
- this._gaxModule.routingHeader.fromParams({
918
- parent: request.parent ?? '',
919
- });
843
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
844
+ 'parent': request.parent ?? '',
845
+ });
920
846
  const defaultCallSettings = this._defaults['listConversations'];
921
847
  const callSettings = defaultCallSettings.merge(options);
922
- this.initialize().catch(err => {
923
- throw err;
924
- });
848
+ this.initialize().catch(err => { throw err; });
925
849
  this._log.info('listConversations stream %j', request);
926
850
  return this.descriptors.page.listConversations.createStream(this.innerApiCalls.listConversations, request, callSettings);
927
851
  }
@@ -974,15 +898,12 @@ class ConversationalSearchServiceClient {
974
898
  options = options || {};
975
899
  options.otherArgs = options.otherArgs || {};
976
900
  options.otherArgs.headers = options.otherArgs.headers || {};
977
- options.otherArgs.headers['x-goog-request-params'] =
978
- this._gaxModule.routingHeader.fromParams({
979
- parent: request.parent ?? '',
980
- });
901
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
902
+ 'parent': request.parent ?? '',
903
+ });
981
904
  const defaultCallSettings = this._defaults['listConversations'];
982
905
  const callSettings = defaultCallSettings.merge(options);
983
- this.initialize().catch(err => {
984
- throw err;
985
- });
906
+ this.initialize().catch(err => { throw err; });
986
907
  this._log.info('listConversations iterate %j', request);
987
908
  return this.descriptors.page.listConversations.asyncIterate(this.innerApiCalls['listConversations'], request, callSettings);
988
909
  }
@@ -999,13 +920,10 @@ class ConversationalSearchServiceClient {
999
920
  options = options || {};
1000
921
  options.otherArgs = options.otherArgs || {};
1001
922
  options.otherArgs.headers = options.otherArgs.headers || {};
1002
- options.otherArgs.headers['x-goog-request-params'] =
1003
- this._gaxModule.routingHeader.fromParams({
1004
- parent: request.parent ?? '',
1005
- });
1006
- this.initialize().catch(err => {
1007
- throw err;
923
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
924
+ 'parent': request.parent ?? '',
1008
925
  });
926
+ this.initialize().catch(err => { throw err; });
1009
927
  const wrappedCallback = callback
1010
928
  ? (error, values, nextPageRequest, rawResponse) => {
1011
929
  this._log.info('listSessions values %j', values);
@@ -1071,15 +989,12 @@ class ConversationalSearchServiceClient {
1071
989
  options = options || {};
1072
990
  options.otherArgs = options.otherArgs || {};
1073
991
  options.otherArgs.headers = options.otherArgs.headers || {};
1074
- options.otherArgs.headers['x-goog-request-params'] =
1075
- this._gaxModule.routingHeader.fromParams({
1076
- parent: request.parent ?? '',
1077
- });
992
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
993
+ 'parent': request.parent ?? '',
994
+ });
1078
995
  const defaultCallSettings = this._defaults['listSessions'];
1079
996
  const callSettings = defaultCallSettings.merge(options);
1080
- this.initialize().catch(err => {
1081
- throw err;
1082
- });
997
+ this.initialize().catch(err => { throw err; });
1083
998
  this._log.info('listSessions stream %j', request);
1084
999
  return this.descriptors.page.listSessions.createStream(this.innerApiCalls.listSessions, request, callSettings);
1085
1000
  }
@@ -1137,70 +1052,67 @@ class ConversationalSearchServiceClient {
1137
1052
  options = options || {};
1138
1053
  options.otherArgs = options.otherArgs || {};
1139
1054
  options.otherArgs.headers = options.otherArgs.headers || {};
1140
- options.otherArgs.headers['x-goog-request-params'] =
1141
- this._gaxModule.routingHeader.fromParams({
1142
- parent: request.parent ?? '',
1143
- });
1055
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1056
+ 'parent': request.parent ?? '',
1057
+ });
1144
1058
  const defaultCallSettings = this._defaults['listSessions'];
1145
1059
  const callSettings = defaultCallSettings.merge(options);
1146
- this.initialize().catch(err => {
1147
- throw err;
1148
- });
1060
+ this.initialize().catch(err => { throw err; });
1149
1061
  this._log.info('listSessions iterate %j', request);
1150
1062
  return this.descriptors.page.listSessions.asyncIterate(this.innerApiCalls['listSessions'], request, callSettings);
1151
1063
  }
1152
1064
  /**
1153
- * Gets information about a location.
1154
- *
1155
- * @param {Object} request
1156
- * The request object that will be sent.
1157
- * @param {string} request.name
1158
- * Resource name for the location.
1159
- * @param {object} [options]
1160
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
1161
- * @returns {Promise} - The promise which resolves to an array.
1162
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
1163
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
1164
- * for more details and examples.
1165
- * @example
1166
- * ```
1167
- * const [response] = await client.getLocation(request);
1168
- * ```
1169
- */
1065
+ * Gets information about a location.
1066
+ *
1067
+ * @param {Object} request
1068
+ * The request object that will be sent.
1069
+ * @param {string} request.name
1070
+ * Resource name for the location.
1071
+ * @param {object} [options]
1072
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
1073
+ * @returns {Promise} - The promise which resolves to an array.
1074
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
1075
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
1076
+ * for more details and examples.
1077
+ * @example
1078
+ * ```
1079
+ * const [response] = await client.getLocation(request);
1080
+ * ```
1081
+ */
1170
1082
  getLocation(request, options, callback) {
1171
1083
  return this.locationsClient.getLocation(request, options, callback);
1172
1084
  }
1173
1085
  /**
1174
- * Lists information about the supported locations for this service. Returns an iterable object.
1175
- *
1176
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1177
- * @param {Object} request
1178
- * The request object that will be sent.
1179
- * @param {string} request.name
1180
- * The resource that owns the locations collection, if applicable.
1181
- * @param {string} request.filter
1182
- * The standard list filter.
1183
- * @param {number} request.pageSize
1184
- * The standard list page size.
1185
- * @param {string} request.pageToken
1186
- * The standard list page token.
1187
- * @param {object} [options]
1188
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1189
- * @returns {Object}
1190
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1191
- * When you iterate the returned iterable, each element will be an object representing
1192
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
1193
- * so you can stop the iteration when you don't need more results.
1194
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1195
- * for more details and examples.
1196
- * @example
1197
- * ```
1198
- * const iterable = client.listLocationsAsync(request);
1199
- * for await (const response of iterable) {
1200
- * // process response
1201
- * }
1202
- * ```
1203
- */
1086
+ * Lists information about the supported locations for this service. Returns an iterable object.
1087
+ *
1088
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1089
+ * @param {Object} request
1090
+ * The request object that will be sent.
1091
+ * @param {string} request.name
1092
+ * The resource that owns the locations collection, if applicable.
1093
+ * @param {string} request.filter
1094
+ * The standard list filter.
1095
+ * @param {number} request.pageSize
1096
+ * The standard list page size.
1097
+ * @param {string} request.pageToken
1098
+ * The standard list page token.
1099
+ * @param {object} [options]
1100
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1101
+ * @returns {Object}
1102
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1103
+ * When you iterate the returned iterable, each element will be an object representing
1104
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
1105
+ * so you can stop the iteration when you don't need more results.
1106
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1107
+ * for more details and examples.
1108
+ * @example
1109
+ * ```
1110
+ * const iterable = client.listLocationsAsync(request);
1111
+ * for await (const response of iterable) {
1112
+ * // process response
1113
+ * }
1114
+ * ```
1115
+ */
1204
1116
  listLocationsAsync(request, options) {
1205
1117
  return this.locationsClient.listLocationsAsync(request, options);
1206
1118
  }
@@ -3442,7 +3354,7 @@ class ConversationalSearchServiceClient {
3442
3354
  this._log.info('ending gRPC channel');
3443
3355
  this._terminated = true;
3444
3356
  stub.close();
3445
- this.locationsClient.close();
3357
+ this.locationsClient.close().catch(err => { throw err; });
3446
3358
  });
3447
3359
  }
3448
3360
  return Promise.resolve();