@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
  }
@@ -212,125 +206,20 @@ class ProjectServiceClient {
212
206
  // rather than holding a request open.
213
207
  const lroOptions = {
214
208
  auth: this.auth,
215
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
209
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
216
210
  };
217
211
  if (opts.fallback) {
218
212
  lroOptions.protoJson = protoFilesRoot;
219
- lroOptions.httpRules = [
220
- {
221
- selector: 'google.longrunning.Operations.CancelOperation',
222
- post: '/v1/{name=projects/*/operations/*}:cancel',
223
- body: '*',
224
- additional_bindings: [
225
- {
226
- post: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
227
- body: '*',
228
- },
229
- {
230
- post: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
231
- body: '*',
232
- },
233
- ],
234
- },
235
- {
236
- selector: 'google.longrunning.Operations.GetOperation',
237
- get: '/v1/{name=projects/*/operations/*}',
238
- additional_bindings: [
239
- {
240
- get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
241
- },
242
- {
243
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
244
- },
245
- {
246
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
247
- },
248
- {
249
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
250
- },
251
- {
252
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
253
- },
254
- {
255
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
256
- },
257
- {
258
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
259
- },
260
- {
261
- get: '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
262
- },
263
- {
264
- get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}',
265
- },
266
- {
267
- get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
268
- },
269
- {
270
- get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
271
- },
272
- {
273
- get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}',
274
- },
275
- {
276
- get: '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}',
277
- },
278
- { get: '/v1/{name=projects/*/locations/*/operations/*}' },
279
- { get: '/v1/{name=projects/*/operations/*}' },
280
- ],
281
- },
282
- {
283
- selector: 'google.longrunning.Operations.ListOperations',
284
- get: '/v1/{name=projects/*}/operations',
285
- additional_bindings: [
286
- {
287
- get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
288
- },
289
- {
290
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
291
- },
292
- {
293
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
294
- },
295
- {
296
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
297
- },
298
- {
299
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
300
- },
301
- {
302
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
303
- },
304
- {
305
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
306
- },
307
- {
308
- get: '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations',
309
- },
310
- { get: '/v1/{name=projects/*/locations/*/collections/*}/operations' },
311
- {
312
- get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
313
- },
314
- {
315
- get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
316
- },
317
- { get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations' },
318
- {
319
- get: '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations',
320
- },
321
- { get: '/v1/{name=projects/*/locations/*}/operations' },
322
- { get: '/v1/{name=projects/*}/operations' },
323
- ],
324
- },
325
- ];
213
+ lroOptions.httpRules = [{ selector: 'google.longrunning.Operations.CancelOperation', post: '/v1/{name=projects/*/operations/*}:cancel', body: '*', additional_bindings: [{ post: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }, { post: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }],
214
+ }, { selector: 'google.longrunning.Operations.GetOperation', get: '/v1/{name=projects/*/operations/*}', additional_bindings: [{ get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/operations/*}', }, { get: '/v1/{name=projects/*/operations/*}', }],
215
+ }, { selector: 'google.longrunning.Operations.ListOperations', get: '/v1/{name=projects/*}/operations', additional_bindings: [{ get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', }, { get: '/v1/{name=projects/*/locations/*}/operations', }, { get: '/v1/{name=projects/*}/operations', }],
216
+ }];
326
217
  }
327
- this.operationsClient = this._gaxModule
328
- .lro(lroOptions)
329
- .operationsClient(opts);
218
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
330
219
  const provisionProjectResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.Project');
331
220
  const provisionProjectMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.ProvisionProjectMetadata');
332
221
  this.descriptors.longrunning = {
333
- provisionProject: new this._gaxModule.LongrunningDescriptor(this.operationsClient, provisionProjectResponse.decode.bind(provisionProjectResponse), provisionProjectMetadata.decode.bind(provisionProjectMetadata)),
222
+ provisionProject: new this._gaxModule.LongrunningDescriptor(this.operationsClient, provisionProjectResponse.decode.bind(provisionProjectResponse), provisionProjectMetadata.decode.bind(provisionProjectMetadata))
334
223
  };
335
224
  // Put together the default options sent with requests.
336
225
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.ProjectService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -359,10 +248,10 @@ class ProjectServiceClient {
359
248
  }
360
249
  // Put together the "service stub" for
361
250
  // google.cloud.discoveryengine.v1.ProjectService.
362
- this.projectServiceStub = this._gaxGrpc.createStub(this._opts.fallback
363
- ? this._protos.lookupService('google.cloud.discoveryengine.v1.ProjectService')
364
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
365
- this._protos.google.cloud.discoveryengine.v1.ProjectService, this._opts, this._providedCustomServicePath);
251
+ this.projectServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
252
+ this._protos.lookupService('google.cloud.discoveryengine.v1.ProjectService') :
253
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
254
+ this._protos.google.cloud.discoveryengine.v1.ProjectService, this._opts, this._providedCustomServicePath);
366
255
  // Iterate over each of the methods that the service provides
367
256
  // and create an API call method for each.
368
257
  const projectServiceStubMethods = ['provisionProject'];
@@ -376,7 +265,8 @@ class ProjectServiceClient {
376
265
  }, (err) => () => {
377
266
  throw err;
378
267
  });
379
- const descriptor = this.descriptors.longrunning[methodName] || undefined;
268
+ const descriptor = this.descriptors.longrunning[methodName] ||
269
+ undefined;
380
270
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
381
271
  this.innerApiCalls[methodName] = apiCall;
382
272
  }
@@ -388,8 +278,7 @@ class ProjectServiceClient {
388
278
  * @returns {string} The DNS address for this service.
389
279
  */
390
280
  static get servicePath() {
391
- if (typeof process === 'object' &&
392
- typeof process.emitWarning === 'function') {
281
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
393
282
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
394
283
  }
395
284
  return 'discoveryengine.googleapis.com';
@@ -400,8 +289,7 @@ class ProjectServiceClient {
400
289
  * @returns {string} The DNS address for this service.
401
290
  */
402
291
  static get apiEndpoint() {
403
- if (typeof process === 'object' &&
404
- typeof process.emitWarning === 'function') {
292
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
405
293
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
406
294
  }
407
295
  return 'discoveryengine.googleapis.com';
@@ -429,7 +317,9 @@ class ProjectServiceClient {
429
317
  * @returns {string[]} List of default scopes.
430
318
  */
431
319
  static get scopes() {
432
- return ['https://www.googleapis.com/auth/cloud-platform'];
320
+ return [
321
+ 'https://www.googleapis.com/auth/cloud-platform'
322
+ ];
433
323
  }
434
324
  /**
435
325
  * Return the project ID used by this class.
@@ -455,13 +345,10 @@ class ProjectServiceClient {
455
345
  options = options || {};
456
346
  options.otherArgs = options.otherArgs || {};
457
347
  options.otherArgs.headers = options.otherArgs.headers || {};
458
- options.otherArgs.headers['x-goog-request-params'] =
459
- this._gaxModule.routingHeader.fromParams({
460
- name: request.name ?? '',
461
- });
462
- this.initialize().catch(err => {
463
- throw err;
348
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
349
+ 'name': request.name ?? '',
464
350
  });
351
+ this.initialize().catch(err => { throw err; });
465
352
  const wrappedCallback = callback
466
353
  ? (error, response, rawResponse, _) => {
467
354
  this._log.info('provisionProject response %j', rawResponse);
@@ -469,8 +356,7 @@ class ProjectServiceClient {
469
356
  }
470
357
  : undefined;
471
358
  this._log.info('provisionProject request %j', request);
472
- return this.innerApiCalls
473
- .provisionProject(request, options, wrappedCallback)
359
+ return this.innerApiCalls.provisionProject(request, options, wrappedCallback)
474
360
  ?.then(([response, rawResponse, _]) => {
475
361
  this._log.info('provisionProject response %j', rawResponse);
476
362
  return [response, rawResponse, _];
@@ -495,90 +381,90 @@ class ProjectServiceClient {
495
381
  return decodeOperation;
496
382
  }
497
383
  /**
498
- * Gets information about a location.
499
- *
500
- * @param {Object} request
501
- * The request object that will be sent.
502
- * @param {string} request.name
503
- * Resource name for the location.
504
- * @param {object} [options]
505
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
506
- * @returns {Promise} - The promise which resolves to an array.
507
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
508
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
509
- * for more details and examples.
510
- * @example
511
- * ```
512
- * const [response] = await client.getLocation(request);
513
- * ```
514
- */
384
+ * Gets information about a location.
385
+ *
386
+ * @param {Object} request
387
+ * The request object that will be sent.
388
+ * @param {string} request.name
389
+ * Resource name for the location.
390
+ * @param {object} [options]
391
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
392
+ * @returns {Promise} - The promise which resolves to an array.
393
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
394
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
395
+ * for more details and examples.
396
+ * @example
397
+ * ```
398
+ * const [response] = await client.getLocation(request);
399
+ * ```
400
+ */
515
401
  getLocation(request, options, callback) {
516
402
  return this.locationsClient.getLocation(request, options, callback);
517
403
  }
518
404
  /**
519
- * Lists information about the supported locations for this service. Returns an iterable object.
520
- *
521
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
522
- * @param {Object} request
523
- * The request object that will be sent.
524
- * @param {string} request.name
525
- * The resource that owns the locations collection, if applicable.
526
- * @param {string} request.filter
527
- * The standard list filter.
528
- * @param {number} request.pageSize
529
- * The standard list page size.
530
- * @param {string} request.pageToken
531
- * The standard list page token.
532
- * @param {object} [options]
533
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
534
- * @returns {Object}
535
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
536
- * When you iterate the returned iterable, each element will be an object representing
537
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
538
- * so you can stop the iteration when you don't need more results.
539
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
540
- * for more details and examples.
541
- * @example
542
- * ```
543
- * const iterable = client.listLocationsAsync(request);
544
- * for await (const response of iterable) {
545
- * // process response
546
- * }
547
- * ```
548
- */
405
+ * Lists information about the supported locations for this service. Returns an iterable object.
406
+ *
407
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
408
+ * @param {Object} request
409
+ * The request object that will be sent.
410
+ * @param {string} request.name
411
+ * The resource that owns the locations collection, if applicable.
412
+ * @param {string} request.filter
413
+ * The standard list filter.
414
+ * @param {number} request.pageSize
415
+ * The standard list page size.
416
+ * @param {string} request.pageToken
417
+ * The standard list page token.
418
+ * @param {object} [options]
419
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
420
+ * @returns {Object}
421
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
422
+ * When you iterate the returned iterable, each element will be an object representing
423
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
424
+ * so you can stop the iteration when you don't need more results.
425
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
426
+ * for more details and examples.
427
+ * @example
428
+ * ```
429
+ * const iterable = client.listLocationsAsync(request);
430
+ * for await (const response of iterable) {
431
+ * // process response
432
+ * }
433
+ * ```
434
+ */
549
435
  listLocationsAsync(request, options) {
550
436
  return this.locationsClient.listLocationsAsync(request, options);
551
437
  }
552
438
  /**
553
- * Gets the latest state of a long-running operation. Clients can use this
554
- * method to poll the operation result at intervals as recommended by the API
555
- * service.
556
- *
557
- * @param {Object} request - The request object that will be sent.
558
- * @param {string} request.name - The name of the operation resource.
559
- * @param {Object=} options
560
- * Optional parameters. You can override the default settings for this call,
561
- * e.g, timeout, retries, paginations, etc. See {@link
562
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
563
- * for the details.
564
- * @param {function(?Error, ?Object)=} callback
565
- * The function which will be called with the result of the API call.
566
- *
567
- * The second parameter to the callback is an object representing
568
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
569
- * @return {Promise} - The promise which resolves to an array.
570
- * The first element of the array is an object representing
571
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
572
- * The promise has a method named "cancel" which cancels the ongoing API call.
573
- *
574
- * @example
575
- * ```
576
- * const client = longrunning.operationsClient();
577
- * const name = '';
578
- * const [response] = await client.getOperation({name});
579
- * // doThingsWith(response)
580
- * ```
581
- */
439
+ * Gets the latest state of a long-running operation. Clients can use this
440
+ * method to poll the operation result at intervals as recommended by the API
441
+ * service.
442
+ *
443
+ * @param {Object} request - The request object that will be sent.
444
+ * @param {string} request.name - The name of the operation resource.
445
+ * @param {Object=} options
446
+ * Optional parameters. You can override the default settings for this call,
447
+ * e.g, timeout, retries, paginations, etc. See {@link
448
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
449
+ * for the details.
450
+ * @param {function(?Error, ?Object)=} callback
451
+ * The function which will be called with the result of the API call.
452
+ *
453
+ * The second parameter to the callback is an object representing
454
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
455
+ * @return {Promise} - The promise which resolves to an array.
456
+ * The first element of the array is an object representing
457
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
458
+ * The promise has a method named "cancel" which cancels the ongoing API call.
459
+ *
460
+ * @example
461
+ * ```
462
+ * const client = longrunning.operationsClient();
463
+ * const name = '';
464
+ * const [response] = await client.getOperation({name});
465
+ * // doThingsWith(response)
466
+ * ```
467
+ */
582
468
  getOperation(request, optionsOrCallback, callback) {
583
469
  let options;
584
470
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -2967,8 +2853,8 @@ class ProjectServiceClient {
2967
2853
  this._log.info('ending gRPC channel');
2968
2854
  this._terminated = true;
2969
2855
  stub.close();
2970
- this.locationsClient.close();
2971
- this.operationsClient.close();
2856
+ this.locationsClient.close().catch(err => { throw err; });
2857
+ void this.operationsClient.close();
2972
2858
  });
2973
2859
  }
2974
2860
  return Promise.resolve();
@@ -175,55 +175,55 @@ export declare class RankServiceClient {
175
175
  rank(request: protos.google.cloud.discoveryengine.v1.IRankRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1.IRankResponse, protos.google.cloud.discoveryengine.v1.IRankRequest | null | undefined, {} | null | undefined>): void;
176
176
  rank(request: protos.google.cloud.discoveryengine.v1.IRankRequest, callback: Callback<protos.google.cloud.discoveryengine.v1.IRankResponse, protos.google.cloud.discoveryengine.v1.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.