@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
@@ -99,26 +99,17 @@ class ProjectServiceClient {
99
99
  constructor(opts, gaxInstance) {
100
100
  // Ensure that options include all the required fields.
101
101
  const staticMembers = this.constructor;
102
- if (opts?.universe_domain &&
103
- opts?.universeDomain &&
104
- opts?.universe_domain !== opts?.universeDomain) {
102
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
105
103
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
106
104
  }
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';
105
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
106
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
115
107
  this._servicePath = 'discoveryengine.' + this._universeDomain;
116
108
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
117
109
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
118
110
  const port = opts?.port || staticMembers.port;
119
111
  const clientConfig = opts?.clientConfig ?? {};
120
- const fallback = opts?.fallback ??
121
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
112
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
122
113
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
123
114
  // Request numeric enum values if REST transport is used.
124
115
  opts.numericEnums = true;
@@ -148,7 +139,10 @@ class ProjectServiceClient {
148
139
  }
149
140
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
150
141
  // Determine the client header string.
151
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
142
+ const clientHeader = [
143
+ `gax/${this._gaxModule.version}`,
144
+ `gapic/${version}`,
145
+ ];
152
146
  if (typeof process === 'object' && 'versions' in process) {
153
147
  clientHeader.push(`gl-node/${process.versions.node}`);
154
148
  }
@@ -216,119 +210,20 @@ class ProjectServiceClient {
216
210
  // rather than holding a request open.
217
211
  const lroOptions = {
218
212
  auth: this.auth,
219
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
213
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
220
214
  };
221
215
  if (opts.fallback) {
222
216
  lroOptions.protoJson = protoFilesRoot;
223
- lroOptions.httpRules = [
224
- {
225
- selector: 'google.longrunning.Operations.CancelOperation',
226
- post: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
227
- body: '*',
228
- additional_bindings: [
229
- {
230
- post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
231
- body: '*',
232
- },
233
- ],
234
- },
235
- {
236
- selector: 'google.longrunning.Operations.GetOperation',
237
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
238
- additional_bindings: [
239
- {
240
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
241
- },
242
- {
243
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
244
- },
245
- {
246
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
247
- },
248
- {
249
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
250
- },
251
- {
252
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
253
- },
254
- {
255
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
256
- },
257
- {
258
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
259
- },
260
- {
261
- get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}',
262
- },
263
- {
264
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
265
- },
266
- {
267
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
268
- },
269
- {
270
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}',
271
- },
272
- {
273
- get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}',
274
- },
275
- { get: '/v1beta/{name=projects/*/locations/*/operations/*}' },
276
- {
277
- get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
278
- },
279
- { get: '/v1beta/{name=projects/*/operations/*}' },
280
- ],
281
- },
282
- {
283
- selector: 'google.longrunning.Operations.ListOperations',
284
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
285
- additional_bindings: [
286
- {
287
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
288
- },
289
- {
290
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
291
- },
292
- {
293
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
294
- },
295
- {
296
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
297
- },
298
- {
299
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
300
- },
301
- {
302
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
303
- },
304
- {
305
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations',
306
- },
307
- {
308
- get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations',
309
- },
310
- {
311
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
312
- },
313
- {
314
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
315
- },
316
- {
317
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations',
318
- },
319
- { get: '/v1beta/{name=projects/*/locations/*}/operations' },
320
- { get: '/v1beta/{name=projects/*}/operations' },
321
- ],
322
- },
323
- ];
217
+ lroOptions.httpRules = [{ selector: 'google.longrunning.Operations.CancelOperation', post: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', additional_bindings: [{ post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }],
218
+ }, { selector: 'google.longrunning.Operations.GetOperation', get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', additional_bindings: [{ get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}', }, { get: '/v1beta/{name=projects/*/operations/*}', }],
219
+ }, { selector: 'google.longrunning.Operations.ListOperations', get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations', additional_bindings: [{ get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*}/operations', }, { get: '/v1beta/{name=projects/*}/operations', }],
220
+ }];
324
221
  }
325
- this.operationsClient = this._gaxModule
326
- .lro(lroOptions)
327
- .operationsClient(opts);
222
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
328
223
  const provisionProjectResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.Project');
329
224
  const provisionProjectMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.ProvisionProjectMetadata');
330
225
  this.descriptors.longrunning = {
331
- provisionProject: new this._gaxModule.LongrunningDescriptor(this.operationsClient, provisionProjectResponse.decode.bind(provisionProjectResponse), provisionProjectMetadata.decode.bind(provisionProjectMetadata)),
226
+ provisionProject: new this._gaxModule.LongrunningDescriptor(this.operationsClient, provisionProjectResponse.decode.bind(provisionProjectResponse), provisionProjectMetadata.decode.bind(provisionProjectMetadata))
332
227
  };
333
228
  // Put together the default options sent with requests.
334
229
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.ProjectService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -357,11 +252,10 @@ class ProjectServiceClient {
357
252
  }
358
253
  // Put together the "service stub" for
359
254
  // google.cloud.discoveryengine.v1beta.ProjectService.
360
- this.projectServiceStub = this._gaxGrpc.createStub(this._opts.fallback
361
- ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.ProjectService')
362
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
363
- this._protos.google.cloud.discoveryengine.v1beta
364
- .ProjectService, this._opts, this._providedCustomServicePath);
255
+ this.projectServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
256
+ this._protos.lookupService('google.cloud.discoveryengine.v1beta.ProjectService') :
257
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
258
+ this._protos.google.cloud.discoveryengine.v1beta.ProjectService, this._opts, this._providedCustomServicePath);
365
259
  // Iterate over each of the methods that the service provides
366
260
  // and create an API call method for each.
367
261
  const projectServiceStubMethods = ['provisionProject'];
@@ -375,7 +269,8 @@ class ProjectServiceClient {
375
269
  }, (err) => () => {
376
270
  throw err;
377
271
  });
378
- const descriptor = this.descriptors.longrunning[methodName] || undefined;
272
+ const descriptor = this.descriptors.longrunning[methodName] ||
273
+ undefined;
379
274
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
380
275
  this.innerApiCalls[methodName] = apiCall;
381
276
  }
@@ -387,8 +282,7 @@ class ProjectServiceClient {
387
282
  * @returns {string} The DNS address for this service.
388
283
  */
389
284
  static get servicePath() {
390
- if (typeof process === 'object' &&
391
- typeof process.emitWarning === 'function') {
285
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
392
286
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
393
287
  }
394
288
  return 'discoveryengine.googleapis.com';
@@ -399,8 +293,7 @@ class ProjectServiceClient {
399
293
  * @returns {string} The DNS address for this service.
400
294
  */
401
295
  static get apiEndpoint() {
402
- if (typeof process === 'object' &&
403
- typeof process.emitWarning === 'function') {
296
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
404
297
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
405
298
  }
406
299
  return 'discoveryengine.googleapis.com';
@@ -428,7 +321,9 @@ class ProjectServiceClient {
428
321
  * @returns {string[]} List of default scopes.
429
322
  */
430
323
  static get scopes() {
431
- return ['https://www.googleapis.com/auth/cloud-platform'];
324
+ return [
325
+ 'https://www.googleapis.com/auth/cloud-platform'
326
+ ];
432
327
  }
433
328
  /**
434
329
  * Return the project ID used by this class.
@@ -454,13 +349,10 @@ class ProjectServiceClient {
454
349
  options = options || {};
455
350
  options.otherArgs = options.otherArgs || {};
456
351
  options.otherArgs.headers = options.otherArgs.headers || {};
457
- options.otherArgs.headers['x-goog-request-params'] =
458
- this._gaxModule.routingHeader.fromParams({
459
- name: request.name ?? '',
460
- });
461
- this.initialize().catch(err => {
462
- throw err;
352
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
353
+ 'name': request.name ?? '',
463
354
  });
355
+ this.initialize().catch(err => { throw err; });
464
356
  const wrappedCallback = callback
465
357
  ? (error, response, rawResponse, _) => {
466
358
  this._log.info('provisionProject response %j', rawResponse);
@@ -468,8 +360,7 @@ class ProjectServiceClient {
468
360
  }
469
361
  : undefined;
470
362
  this._log.info('provisionProject request %j', request);
471
- return this.innerApiCalls
472
- .provisionProject(request, options, wrappedCallback)
363
+ return this.innerApiCalls.provisionProject(request, options, wrappedCallback)
473
364
  ?.then(([response, rawResponse, _]) => {
474
365
  this._log.info('provisionProject response %j', rawResponse);
475
366
  return [response, rawResponse, _];
@@ -494,90 +385,90 @@ class ProjectServiceClient {
494
385
  return decodeOperation;
495
386
  }
496
387
  /**
497
- * Gets information about a location.
498
- *
499
- * @param {Object} request
500
- * The request object that will be sent.
501
- * @param {string} request.name
502
- * Resource name for the location.
503
- * @param {object} [options]
504
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
505
- * @returns {Promise} - The promise which resolves to an array.
506
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
507
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
508
- * for more details and examples.
509
- * @example
510
- * ```
511
- * const [response] = await client.getLocation(request);
512
- * ```
513
- */
388
+ * Gets information about a location.
389
+ *
390
+ * @param {Object} request
391
+ * The request object that will be sent.
392
+ * @param {string} request.name
393
+ * Resource name for the location.
394
+ * @param {object} [options]
395
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
396
+ * @returns {Promise} - The promise which resolves to an array.
397
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
398
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
399
+ * for more details and examples.
400
+ * @example
401
+ * ```
402
+ * const [response] = await client.getLocation(request);
403
+ * ```
404
+ */
514
405
  getLocation(request, options, callback) {
515
406
  return this.locationsClient.getLocation(request, options, callback);
516
407
  }
517
408
  /**
518
- * Lists information about the supported locations for this service. Returns an iterable object.
519
- *
520
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
521
- * @param {Object} request
522
- * The request object that will be sent.
523
- * @param {string} request.name
524
- * The resource that owns the locations collection, if applicable.
525
- * @param {string} request.filter
526
- * The standard list filter.
527
- * @param {number} request.pageSize
528
- * The standard list page size.
529
- * @param {string} request.pageToken
530
- * The standard list page token.
531
- * @param {object} [options]
532
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
533
- * @returns {Object}
534
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
535
- * When you iterate the returned iterable, each element will be an object representing
536
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
537
- * so you can stop the iteration when you don't need more results.
538
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
539
- * for more details and examples.
540
- * @example
541
- * ```
542
- * const iterable = client.listLocationsAsync(request);
543
- * for await (const response of iterable) {
544
- * // process response
545
- * }
546
- * ```
547
- */
409
+ * Lists information about the supported locations for this service. Returns an iterable object.
410
+ *
411
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
412
+ * @param {Object} request
413
+ * The request object that will be sent.
414
+ * @param {string} request.name
415
+ * The resource that owns the locations collection, if applicable.
416
+ * @param {string} request.filter
417
+ * The standard list filter.
418
+ * @param {number} request.pageSize
419
+ * The standard list page size.
420
+ * @param {string} request.pageToken
421
+ * The standard list page token.
422
+ * @param {object} [options]
423
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
424
+ * @returns {Object}
425
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
426
+ * When you iterate the returned iterable, each element will be an object representing
427
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
428
+ * so you can stop the iteration when you don't need more results.
429
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
430
+ * for more details and examples.
431
+ * @example
432
+ * ```
433
+ * const iterable = client.listLocationsAsync(request);
434
+ * for await (const response of iterable) {
435
+ * // process response
436
+ * }
437
+ * ```
438
+ */
548
439
  listLocationsAsync(request, options) {
549
440
  return this.locationsClient.listLocationsAsync(request, options);
550
441
  }
551
442
  /**
552
- * Gets the latest state of a long-running operation. Clients can use this
553
- * method to poll the operation result at intervals as recommended by the API
554
- * service.
555
- *
556
- * @param {Object} request - The request object that will be sent.
557
- * @param {string} request.name - The name of the operation resource.
558
- * @param {Object=} options
559
- * Optional parameters. You can override the default settings for this call,
560
- * e.g, timeout, retries, paginations, etc. See {@link
561
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
562
- * for the details.
563
- * @param {function(?Error, ?Object)=} callback
564
- * The function which will be called with the result of the API call.
565
- *
566
- * The second parameter to the callback is an object representing
567
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
568
- * @return {Promise} - The promise which resolves to an array.
569
- * The first element of the array is an object representing
570
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
571
- * The promise has a method named "cancel" which cancels the ongoing API call.
572
- *
573
- * @example
574
- * ```
575
- * const client = longrunning.operationsClient();
576
- * const name = '';
577
- * const [response] = await client.getOperation({name});
578
- * // doThingsWith(response)
579
- * ```
580
- */
443
+ * Gets the latest state of a long-running operation. Clients can use this
444
+ * method to poll the operation result at intervals as recommended by the API
445
+ * service.
446
+ *
447
+ * @param {Object} request - The request object that will be sent.
448
+ * @param {string} request.name - The name of the operation resource.
449
+ * @param {Object=} options
450
+ * Optional parameters. You can override the default settings for this call,
451
+ * e.g, timeout, retries, paginations, etc. See {@link
452
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
453
+ * for the details.
454
+ * @param {function(?Error, ?Object)=} callback
455
+ * The function which will be called with the result of the API call.
456
+ *
457
+ * The second parameter to the callback is an object representing
458
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
459
+ * @return {Promise} - The promise which resolves to an array.
460
+ * The first element of the array is an object representing
461
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
462
+ * The promise has a method named "cancel" which cancels the ongoing API call.
463
+ *
464
+ * @example
465
+ * ```
466
+ * const client = longrunning.operationsClient();
467
+ * const name = '';
468
+ * const [response] = await client.getOperation({name});
469
+ * // doThingsWith(response)
470
+ * ```
471
+ */
581
472
  getOperation(request, optionsOrCallback, callback) {
582
473
  let options;
583
474
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -811,8 +702,7 @@ class ProjectServiceClient {
811
702
  * @returns {string} A string representing the project.
812
703
  */
813
704
  matchProjectFromEvaluationName(evaluationName) {
814
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
815
- .project;
705
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
816
706
  }
817
707
  /**
818
708
  * Parse the location from Evaluation resource.
@@ -822,8 +712,7 @@ class ProjectServiceClient {
822
712
  * @returns {string} A string representing the location.
823
713
  */
824
714
  matchLocationFromEvaluationName(evaluationName) {
825
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
826
- .location;
715
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
827
716
  }
828
717
  /**
829
718
  * Parse the evaluation from Evaluation resource.
@@ -833,8 +722,7 @@ class ProjectServiceClient {
833
722
  * @returns {string} A string representing the evaluation.
834
723
  */
835
724
  matchEvaluationFromEvaluationName(evaluationName) {
836
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
837
- .evaluation;
725
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
838
726
  }
839
727
  /**
840
728
  * Return a fully-qualified groundingConfig resource name string.
@@ -3072,8 +2960,7 @@ class ProjectServiceClient {
3072
2960
  * @returns {string} A string representing the project.
3073
2961
  */
3074
2962
  matchProjectFromSampleQueryName(sampleQueryName) {
3075
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3076
- .project;
2963
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3077
2964
  }
3078
2965
  /**
3079
2966
  * Parse the location from SampleQuery resource.
@@ -3083,8 +2970,7 @@ class ProjectServiceClient {
3083
2970
  * @returns {string} A string representing the location.
3084
2971
  */
3085
2972
  matchLocationFromSampleQueryName(sampleQueryName) {
3086
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3087
- .location;
2973
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3088
2974
  }
3089
2975
  /**
3090
2976
  * Parse the sample_query_set from SampleQuery resource.
@@ -3094,8 +2980,7 @@ class ProjectServiceClient {
3094
2980
  * @returns {string} A string representing the sample_query_set.
3095
2981
  */
3096
2982
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3097
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3098
- .sample_query_set;
2983
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3099
2984
  }
3100
2985
  /**
3101
2986
  * Parse the sample_query from SampleQuery resource.
@@ -3105,8 +2990,7 @@ class ProjectServiceClient {
3105
2990
  * @returns {string} A string representing the sample_query.
3106
2991
  */
3107
2992
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3108
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3109
- .sample_query;
2993
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3110
2994
  }
3111
2995
  /**
3112
2996
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3165,8 +3049,8 @@ class ProjectServiceClient {
3165
3049
  this._log.info('ending gRPC channel');
3166
3050
  this._terminated = true;
3167
3051
  stub.close();
3168
- this.locationsClient.close();
3169
- this.operationsClient.close();
3052
+ this.locationsClient.close().catch(err => { throw err; });
3053
+ void this.operationsClient.close();
3170
3054
  });
3171
3055
  }
3172
3056
  return Promise.resolve();
@@ -175,55 +175,55 @@ export declare class RankServiceClient {
175
175
  rank(request: protos.google.cloud.discoveryengine.v1beta.IRankRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IRankResponse, protos.google.cloud.discoveryengine.v1beta.IRankRequest | null | undefined, {} | null | undefined>): void;
176
176
  rank(request: protos.google.cloud.discoveryengine.v1beta.IRankRequest, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IRankResponse, protos.google.cloud.discoveryengine.v1beta.IRankRequest | null | undefined, {} | null | undefined>): void;
177
177
  /**
178
- * Gets information about a location.
179
- *
180
- * @param {Object} request
181
- * The request object that will be sent.
182
- * @param {string} request.name
183
- * Resource name for the location.
184
- * @param {object} [options]
185
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
186
- * @returns {Promise} - The promise which resolves to an array.
187
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
188
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
189
- * for more details and examples.
190
- * @example
191
- * ```
192
- * const [response] = await client.getLocation(request);
193
- * ```
194
- */
178
+ * Gets information about a location.
179
+ *
180
+ * @param {Object} request
181
+ * The request object that will be sent.
182
+ * @param {string} request.name
183
+ * Resource name for the location.
184
+ * @param {object} [options]
185
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
186
+ * @returns {Promise} - The promise which resolves to an array.
187
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
188
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
189
+ * for more details and examples.
190
+ * @example
191
+ * ```
192
+ * const [response] = await client.getLocation(request);
193
+ * ```
194
+ */
195
195
  getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;
196
196
  /**
197
- * Lists information about the supported locations for this service. Returns an iterable object.
198
- *
199
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
200
- * @param {Object} request
201
- * The request object that will be sent.
202
- * @param {string} request.name
203
- * The resource that owns the locations collection, if applicable.
204
- * @param {string} request.filter
205
- * The standard list filter.
206
- * @param {number} request.pageSize
207
- * The standard list page size.
208
- * @param {string} request.pageToken
209
- * The standard list page token.
210
- * @param {object} [options]
211
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
212
- * @returns {Object}
213
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
214
- * When you iterate the returned iterable, each element will be an object representing
215
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
216
- * so you can stop the iteration when you don't need more results.
217
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
218
- * for more details and examples.
219
- * @example
220
- * ```
221
- * const iterable = client.listLocationsAsync(request);
222
- * for await (const response of iterable) {
223
- * // process response
224
- * }
225
- * ```
226
- */
197
+ * Lists information about the supported locations for this service. Returns an iterable object.
198
+ *
199
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
200
+ * @param {Object} request
201
+ * The request object that will be sent.
202
+ * @param {string} request.name
203
+ * The resource that owns the locations collection, if applicable.
204
+ * @param {string} request.filter
205
+ * The standard list filter.
206
+ * @param {number} request.pageSize
207
+ * The standard list page size.
208
+ * @param {string} request.pageToken
209
+ * The standard list page token.
210
+ * @param {object} [options]
211
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
212
+ * @returns {Object}
213
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
214
+ * When you iterate the returned iterable, each element will be an object representing
215
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
216
+ * so you can stop the iteration when you don't need more results.
217
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
218
+ * for more details and examples.
219
+ * @example
220
+ * ```
221
+ * const iterable = client.listLocationsAsync(request);
222
+ * for await (const response of iterable) {
223
+ * // process response
224
+ * }
225
+ * ```
226
+ */
227
227
  listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
228
228
  /**
229
229
  * Return a fully-qualified engine resource name string.