@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 EngineServiceClient {
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 EngineServiceClient {
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
  }
@@ -211,7 +205,7 @@ class EngineServiceClient {
211
205
  // (e.g. 50 results at a time, with tokens to get subsequent
212
206
  // pages). Denote the keys used for pagination and results.
213
207
  this.descriptors.page = {
214
- listEngines: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'engines'),
208
+ listEngines: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'engines')
215
209
  };
216
210
  const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
217
211
  // This API contains "long-running operations", which return a
@@ -219,128 +213,23 @@ class EngineServiceClient {
219
213
  // rather than holding a request open.
220
214
  const lroOptions = {
221
215
  auth: this.auth,
222
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
216
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
223
217
  };
224
218
  if (opts.fallback) {
225
219
  lroOptions.protoJson = protoFilesRoot;
226
- lroOptions.httpRules = [
227
- {
228
- selector: 'google.longrunning.Operations.CancelOperation',
229
- post: '/v1/{name=projects/*/operations/*}:cancel',
230
- body: '*',
231
- additional_bindings: [
232
- {
233
- post: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
234
- body: '*',
235
- },
236
- {
237
- post: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
238
- body: '*',
239
- },
240
- ],
241
- },
242
- {
243
- selector: 'google.longrunning.Operations.GetOperation',
244
- get: '/v1/{name=projects/*/operations/*}',
245
- additional_bindings: [
246
- {
247
- get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
248
- },
249
- {
250
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
251
- },
252
- {
253
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
254
- },
255
- {
256
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
257
- },
258
- {
259
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
260
- },
261
- {
262
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
263
- },
264
- {
265
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
266
- },
267
- {
268
- get: '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
269
- },
270
- {
271
- get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}',
272
- },
273
- {
274
- get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
275
- },
276
- {
277
- get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
278
- },
279
- {
280
- get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}',
281
- },
282
- {
283
- get: '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}',
284
- },
285
- { get: '/v1/{name=projects/*/locations/*/operations/*}' },
286
- { get: '/v1/{name=projects/*/operations/*}' },
287
- ],
288
- },
289
- {
290
- selector: 'google.longrunning.Operations.ListOperations',
291
- get: '/v1/{name=projects/*}/operations',
292
- additional_bindings: [
293
- {
294
- get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
295
- },
296
- {
297
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
298
- },
299
- {
300
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
301
- },
302
- {
303
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
304
- },
305
- {
306
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
307
- },
308
- {
309
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
310
- },
311
- {
312
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
313
- },
314
- {
315
- get: '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations',
316
- },
317
- { get: '/v1/{name=projects/*/locations/*/collections/*}/operations' },
318
- {
319
- get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
320
- },
321
- {
322
- get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
323
- },
324
- { get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations' },
325
- {
326
- get: '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations',
327
- },
328
- { get: '/v1/{name=projects/*/locations/*}/operations' },
329
- { get: '/v1/{name=projects/*}/operations' },
330
- ],
331
- },
332
- ];
220
+ 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: '*', }],
221
+ }, { 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/*}', }],
222
+ }, { 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', }],
223
+ }];
333
224
  }
334
- this.operationsClient = this._gaxModule
335
- .lro(lroOptions)
336
- .operationsClient(opts);
225
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
337
226
  const createEngineResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.Engine');
338
227
  const createEngineMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.CreateEngineMetadata');
339
228
  const deleteEngineResponse = protoFilesRoot.lookup('.google.protobuf.Empty');
340
229
  const deleteEngineMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.DeleteEngineMetadata');
341
230
  this.descriptors.longrunning = {
342
231
  createEngine: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createEngineResponse.decode.bind(createEngineResponse), createEngineMetadata.decode.bind(createEngineMetadata)),
343
- deleteEngine: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteEngineResponse.decode.bind(deleteEngineResponse), deleteEngineMetadata.decode.bind(deleteEngineMetadata)),
232
+ deleteEngine: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteEngineResponse.decode.bind(deleteEngineResponse), deleteEngineMetadata.decode.bind(deleteEngineMetadata))
344
233
  };
345
234
  // Put together the default options sent with requests.
346
235
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.EngineService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -369,19 +258,13 @@ class EngineServiceClient {
369
258
  }
370
259
  // Put together the "service stub" for
371
260
  // google.cloud.discoveryengine.v1.EngineService.
372
- this.engineServiceStub = this._gaxGrpc.createStub(this._opts.fallback
373
- ? this._protos.lookupService('google.cloud.discoveryengine.v1.EngineService')
374
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
375
- this._protos.google.cloud.discoveryengine.v1.EngineService, this._opts, this._providedCustomServicePath);
261
+ this.engineServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
262
+ this._protos.lookupService('google.cloud.discoveryengine.v1.EngineService') :
263
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
264
+ this._protos.google.cloud.discoveryengine.v1.EngineService, this._opts, this._providedCustomServicePath);
376
265
  // Iterate over each of the methods that the service provides
377
266
  // and create an API call method for each.
378
- const engineServiceStubMethods = [
379
- 'createEngine',
380
- 'deleteEngine',
381
- 'updateEngine',
382
- 'getEngine',
383
- 'listEngines',
384
- ];
267
+ const engineServiceStubMethods = ['createEngine', 'deleteEngine', 'updateEngine', 'getEngine', 'listEngines'];
385
268
  for (const methodName of engineServiceStubMethods) {
386
269
  const callPromise = this.engineServiceStub.then(stub => (...args) => {
387
270
  if (this._terminated) {
@@ -406,8 +289,7 @@ class EngineServiceClient {
406
289
  * @returns {string} The DNS address for this service.
407
290
  */
408
291
  static get servicePath() {
409
- if (typeof process === 'object' &&
410
- typeof process.emitWarning === 'function') {
292
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
411
293
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
412
294
  }
413
295
  return 'discoveryengine.googleapis.com';
@@ -418,8 +300,7 @@ class EngineServiceClient {
418
300
  * @returns {string} The DNS address for this service.
419
301
  */
420
302
  static get apiEndpoint() {
421
- if (typeof process === 'object' &&
422
- typeof process.emitWarning === 'function') {
303
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
423
304
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
424
305
  }
425
306
  return 'discoveryengine.googleapis.com';
@@ -447,7 +328,9 @@ class EngineServiceClient {
447
328
  * @returns {string[]} List of default scopes.
448
329
  */
449
330
  static get scopes() {
450
- return ['https://www.googleapis.com/auth/cloud-platform'];
331
+ return [
332
+ 'https://www.googleapis.com/auth/cloud-platform'
333
+ ];
451
334
  }
452
335
  /**
453
336
  * Return the project ID used by this class.
@@ -473,13 +356,10 @@ class EngineServiceClient {
473
356
  options = options || {};
474
357
  options.otherArgs = options.otherArgs || {};
475
358
  options.otherArgs.headers = options.otherArgs.headers || {};
476
- options.otherArgs.headers['x-goog-request-params'] =
477
- this._gaxModule.routingHeader.fromParams({
478
- 'engine.name': request.engine.name ?? '',
479
- });
480
- this.initialize().catch(err => {
481
- throw err;
359
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
360
+ 'engine.name': request.engine.name ?? '',
482
361
  });
362
+ this.initialize().catch(err => { throw err; });
483
363
  this._log.info('updateEngine request %j', request);
484
364
  const wrappedCallback = callback
485
365
  ? (error, response, options, rawResponse) => {
@@ -487,8 +367,7 @@ class EngineServiceClient {
487
367
  callback(error, response, options, rawResponse); // We verified callback above.
488
368
  }
489
369
  : undefined;
490
- return this.innerApiCalls
491
- .updateEngine(request, options, wrappedCallback)
370
+ return this.innerApiCalls.updateEngine(request, options, wrappedCallback)
492
371
  ?.then(([response, options, rawResponse]) => {
493
372
  this._log.info('updateEngine response %j', response);
494
373
  return [response, options, rawResponse];
@@ -507,13 +386,10 @@ class EngineServiceClient {
507
386
  options = options || {};
508
387
  options.otherArgs = options.otherArgs || {};
509
388
  options.otherArgs.headers = options.otherArgs.headers || {};
510
- options.otherArgs.headers['x-goog-request-params'] =
511
- this._gaxModule.routingHeader.fromParams({
512
- name: request.name ?? '',
513
- });
514
- this.initialize().catch(err => {
515
- throw err;
389
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
390
+ 'name': request.name ?? '',
516
391
  });
392
+ this.initialize().catch(err => { throw err; });
517
393
  this._log.info('getEngine request %j', request);
518
394
  const wrappedCallback = callback
519
395
  ? (error, response, options, rawResponse) => {
@@ -521,8 +397,7 @@ class EngineServiceClient {
521
397
  callback(error, response, options, rawResponse); // We verified callback above.
522
398
  }
523
399
  : undefined;
524
- return this.innerApiCalls
525
- .getEngine(request, options, wrappedCallback)
400
+ return this.innerApiCalls.getEngine(request, options, wrappedCallback)
526
401
  ?.then(([response, options, rawResponse]) => {
527
402
  this._log.info('getEngine response %j', response);
528
403
  return [response, options, rawResponse];
@@ -541,13 +416,10 @@ class EngineServiceClient {
541
416
  options = options || {};
542
417
  options.otherArgs = options.otherArgs || {};
543
418
  options.otherArgs.headers = options.otherArgs.headers || {};
544
- options.otherArgs.headers['x-goog-request-params'] =
545
- this._gaxModule.routingHeader.fromParams({
546
- parent: request.parent ?? '',
547
- });
548
- this.initialize().catch(err => {
549
- throw err;
419
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
420
+ 'parent': request.parent ?? '',
550
421
  });
422
+ this.initialize().catch(err => { throw err; });
551
423
  const wrappedCallback = callback
552
424
  ? (error, response, rawResponse, _) => {
553
425
  this._log.info('createEngine response %j', rawResponse);
@@ -555,8 +427,7 @@ class EngineServiceClient {
555
427
  }
556
428
  : undefined;
557
429
  this._log.info('createEngine request %j', request);
558
- return this.innerApiCalls
559
- .createEngine(request, options, wrappedCallback)
430
+ return this.innerApiCalls.createEngine(request, options, wrappedCallback)
560
431
  ?.then(([response, rawResponse, _]) => {
561
432
  this._log.info('createEngine response %j', rawResponse);
562
433
  return [response, rawResponse, _];
@@ -593,13 +464,10 @@ class EngineServiceClient {
593
464
  options = options || {};
594
465
  options.otherArgs = options.otherArgs || {};
595
466
  options.otherArgs.headers = options.otherArgs.headers || {};
596
- options.otherArgs.headers['x-goog-request-params'] =
597
- this._gaxModule.routingHeader.fromParams({
598
- name: request.name ?? '',
599
- });
600
- this.initialize().catch(err => {
601
- throw err;
467
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
468
+ 'name': request.name ?? '',
602
469
  });
470
+ this.initialize().catch(err => { throw err; });
603
471
  const wrappedCallback = callback
604
472
  ? (error, response, rawResponse, _) => {
605
473
  this._log.info('deleteEngine response %j', rawResponse);
@@ -607,8 +475,7 @@ class EngineServiceClient {
607
475
  }
608
476
  : undefined;
609
477
  this._log.info('deleteEngine request %j', request);
610
- return this.innerApiCalls
611
- .deleteEngine(request, options, wrappedCallback)
478
+ return this.innerApiCalls.deleteEngine(request, options, wrappedCallback)
612
479
  ?.then(([response, rawResponse, _]) => {
613
480
  this._log.info('deleteEngine response %j', rawResponse);
614
481
  return [response, rawResponse, _];
@@ -645,13 +512,10 @@ class EngineServiceClient {
645
512
  options = options || {};
646
513
  options.otherArgs = options.otherArgs || {};
647
514
  options.otherArgs.headers = options.otherArgs.headers || {};
648
- options.otherArgs.headers['x-goog-request-params'] =
649
- this._gaxModule.routingHeader.fromParams({
650
- parent: request.parent ?? '',
651
- });
652
- this.initialize().catch(err => {
653
- throw err;
515
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
516
+ 'parent': request.parent ?? '',
654
517
  });
518
+ this.initialize().catch(err => { throw err; });
655
519
  const wrappedCallback = callback
656
520
  ? (error, values, nextPageRequest, rawResponse) => {
657
521
  this._log.info('listEngines values %j', values);
@@ -696,15 +560,12 @@ class EngineServiceClient {
696
560
  options = options || {};
697
561
  options.otherArgs = options.otherArgs || {};
698
562
  options.otherArgs.headers = options.otherArgs.headers || {};
699
- options.otherArgs.headers['x-goog-request-params'] =
700
- this._gaxModule.routingHeader.fromParams({
701
- parent: request.parent ?? '',
702
- });
563
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
564
+ 'parent': request.parent ?? '',
565
+ });
703
566
  const defaultCallSettings = this._defaults['listEngines'];
704
567
  const callSettings = defaultCallSettings.merge(options);
705
- this.initialize().catch(err => {
706
- throw err;
707
- });
568
+ this.initialize().catch(err => { throw err; });
708
569
  this._log.info('listEngines stream %j', request);
709
570
  return this.descriptors.page.listEngines.createStream(this.innerApiCalls.listEngines, request, callSettings);
710
571
  }
@@ -741,103 +602,100 @@ class EngineServiceClient {
741
602
  options = options || {};
742
603
  options.otherArgs = options.otherArgs || {};
743
604
  options.otherArgs.headers = options.otherArgs.headers || {};
744
- options.otherArgs.headers['x-goog-request-params'] =
745
- this._gaxModule.routingHeader.fromParams({
746
- parent: request.parent ?? '',
747
- });
605
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
606
+ 'parent': request.parent ?? '',
607
+ });
748
608
  const defaultCallSettings = this._defaults['listEngines'];
749
609
  const callSettings = defaultCallSettings.merge(options);
750
- this.initialize().catch(err => {
751
- throw err;
752
- });
610
+ this.initialize().catch(err => { throw err; });
753
611
  this._log.info('listEngines iterate %j', request);
754
612
  return this.descriptors.page.listEngines.asyncIterate(this.innerApiCalls['listEngines'], request, callSettings);
755
613
  }
756
614
  /**
757
- * Gets information about a location.
758
- *
759
- * @param {Object} request
760
- * The request object that will be sent.
761
- * @param {string} request.name
762
- * Resource name for the location.
763
- * @param {object} [options]
764
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
765
- * @returns {Promise} - The promise which resolves to an array.
766
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
767
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
768
- * for more details and examples.
769
- * @example
770
- * ```
771
- * const [response] = await client.getLocation(request);
772
- * ```
773
- */
615
+ * Gets information about a location.
616
+ *
617
+ * @param {Object} request
618
+ * The request object that will be sent.
619
+ * @param {string} request.name
620
+ * Resource name for the location.
621
+ * @param {object} [options]
622
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
623
+ * @returns {Promise} - The promise which resolves to an array.
624
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
625
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
626
+ * for more details and examples.
627
+ * @example
628
+ * ```
629
+ * const [response] = await client.getLocation(request);
630
+ * ```
631
+ */
774
632
  getLocation(request, options, callback) {
775
633
  return this.locationsClient.getLocation(request, options, callback);
776
634
  }
777
635
  /**
778
- * Lists information about the supported locations for this service. Returns an iterable object.
779
- *
780
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
781
- * @param {Object} request
782
- * The request object that will be sent.
783
- * @param {string} request.name
784
- * The resource that owns the locations collection, if applicable.
785
- * @param {string} request.filter
786
- * The standard list filter.
787
- * @param {number} request.pageSize
788
- * The standard list page size.
789
- * @param {string} request.pageToken
790
- * The standard list page token.
791
- * @param {object} [options]
792
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
793
- * @returns {Object}
794
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
795
- * When you iterate the returned iterable, each element will be an object representing
796
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
797
- * so you can stop the iteration when you don't need more results.
798
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
799
- * for more details and examples.
800
- * @example
801
- * ```
802
- * const iterable = client.listLocationsAsync(request);
803
- * for await (const response of iterable) {
804
- * // process response
805
- * }
806
- * ```
807
- */
636
+ * Lists information about the supported locations for this service. Returns an iterable object.
637
+ *
638
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
639
+ * @param {Object} request
640
+ * The request object that will be sent.
641
+ * @param {string} request.name
642
+ * The resource that owns the locations collection, if applicable.
643
+ * @param {string} request.filter
644
+ * The standard list filter.
645
+ * @param {number} request.pageSize
646
+ * The standard list page size.
647
+ * @param {string} request.pageToken
648
+ * The standard list page token.
649
+ * @param {object} [options]
650
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
651
+ * @returns {Object}
652
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
653
+ * When you iterate the returned iterable, each element will be an object representing
654
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
655
+ * so you can stop the iteration when you don't need more results.
656
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
657
+ * for more details and examples.
658
+ * @example
659
+ * ```
660
+ * const iterable = client.listLocationsAsync(request);
661
+ * for await (const response of iterable) {
662
+ * // process response
663
+ * }
664
+ * ```
665
+ */
808
666
  listLocationsAsync(request, options) {
809
667
  return this.locationsClient.listLocationsAsync(request, options);
810
668
  }
811
669
  /**
812
- * Gets the latest state of a long-running operation. Clients can use this
813
- * method to poll the operation result at intervals as recommended by the API
814
- * service.
815
- *
816
- * @param {Object} request - The request object that will be sent.
817
- * @param {string} request.name - The name of the operation resource.
818
- * @param {Object=} options
819
- * Optional parameters. You can override the default settings for this call,
820
- * e.g, timeout, retries, paginations, etc. See {@link
821
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
822
- * for the details.
823
- * @param {function(?Error, ?Object)=} callback
824
- * The function which will be called with the result of the API call.
825
- *
826
- * The second parameter to the callback is an object representing
827
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
828
- * @return {Promise} - The promise which resolves to an array.
829
- * The first element of the array is an object representing
830
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
831
- * The promise has a method named "cancel" which cancels the ongoing API call.
832
- *
833
- * @example
834
- * ```
835
- * const client = longrunning.operationsClient();
836
- * const name = '';
837
- * const [response] = await client.getOperation({name});
838
- * // doThingsWith(response)
839
- * ```
840
- */
670
+ * Gets the latest state of a long-running operation. Clients can use this
671
+ * method to poll the operation result at intervals as recommended by the API
672
+ * service.
673
+ *
674
+ * @param {Object} request - The request object that will be sent.
675
+ * @param {string} request.name - The name of the operation resource.
676
+ * @param {Object=} options
677
+ * Optional parameters. You can override the default settings for this call,
678
+ * e.g, timeout, retries, paginations, etc. See {@link
679
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
680
+ * for the details.
681
+ * @param {function(?Error, ?Object)=} callback
682
+ * The function which will be called with the result of the API call.
683
+ *
684
+ * The second parameter to the callback is an object representing
685
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
686
+ * @return {Promise} - The promise which resolves to an array.
687
+ * The first element of the array is an object representing
688
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
689
+ * The promise has a method named "cancel" which cancels the ongoing API call.
690
+ *
691
+ * @example
692
+ * ```
693
+ * const client = longrunning.operationsClient();
694
+ * const name = '';
695
+ * const [response] = await client.getOperation({name});
696
+ * // doThingsWith(response)
697
+ * ```
698
+ */
841
699
  getOperation(request, optionsOrCallback, callback) {
842
700
  let options;
843
701
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1014,8 +872,7 @@ class EngineServiceClient {
1014
872
  * @returns {string} A string representing the project.
1015
873
  */
1016
874
  matchProjectFromCollectionName(collectionName) {
1017
- return this.pathTemplates.collectionPathTemplate.match(collectionName)
1018
- .project;
875
+ return this.pathTemplates.collectionPathTemplate.match(collectionName).project;
1019
876
  }
1020
877
  /**
1021
878
  * Parse the location from Collection resource.
@@ -1025,8 +882,7 @@ class EngineServiceClient {
1025
882
  * @returns {string} A string representing the location.
1026
883
  */
1027
884
  matchLocationFromCollectionName(collectionName) {
1028
- return this.pathTemplates.collectionPathTemplate.match(collectionName)
1029
- .location;
885
+ return this.pathTemplates.collectionPathTemplate.match(collectionName).location;
1030
886
  }
1031
887
  /**
1032
888
  * Parse the collection from Collection resource.
@@ -1036,8 +892,7 @@ class EngineServiceClient {
1036
892
  * @returns {string} A string representing the collection.
1037
893
  */
1038
894
  matchCollectionFromCollectionName(collectionName) {
1039
- return this.pathTemplates.collectionPathTemplate.match(collectionName)
1040
- .collection;
895
+ return this.pathTemplates.collectionPathTemplate.match(collectionName).collection;
1041
896
  }
1042
897
  /**
1043
898
  * Return a fully-qualified engine resource name string.
@@ -3274,8 +3129,8 @@ class EngineServiceClient {
3274
3129
  this._log.info('ending gRPC channel');
3275
3130
  this._terminated = true;
3276
3131
  stub.close();
3277
- this.locationsClient.close();
3278
- this.operationsClient.close();
3132
+ this.locationsClient.close().catch(err => { throw err; });
3133
+ void this.operationsClient.close();
3279
3134
  });
3280
3135
  }
3281
3136
  return Promise.resolve();