@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
@@ -98,26 +98,17 @@ class UserEventServiceClient {
98
98
  constructor(opts, gaxInstance) {
99
99
  // Ensure that options include all the required fields.
100
100
  const staticMembers = this.constructor;
101
- if (opts?.universe_domain &&
102
- opts?.universeDomain &&
103
- opts?.universe_domain !== opts?.universeDomain) {
101
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
104
102
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
105
103
  }
106
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
107
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
108
- : undefined;
109
- this._universeDomain =
110
- opts?.universeDomain ??
111
- opts?.universe_domain ??
112
- universeDomainEnvVar ??
113
- 'googleapis.com';
104
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
105
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
114
106
  this._servicePath = 'discoveryengine.' + this._universeDomain;
115
107
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
116
108
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
117
109
  const port = opts?.port || staticMembers.port;
118
110
  const clientConfig = opts?.clientConfig ?? {};
119
- const fallback = opts?.fallback ??
120
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
111
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
121
112
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
122
113
  // Request numeric enum values if REST transport is used.
123
114
  opts.numericEnums = true;
@@ -147,7 +138,10 @@ class UserEventServiceClient {
147
138
  }
148
139
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
149
140
  // Determine the client header string.
150
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
141
+ const clientHeader = [
142
+ `gax/${this._gaxModule.version}`,
143
+ `gapic/${version}`,
144
+ ];
151
145
  if (typeof process === 'object' && 'versions' in process) {
152
146
  clientHeader.push(`gl-node/${process.versions.node}`);
153
147
  }
@@ -211,128 +205,23 @@ class UserEventServiceClient {
211
205
  // rather than holding a request open.
212
206
  const lroOptions = {
213
207
  auth: this.auth,
214
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
208
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
215
209
  };
216
210
  if (opts.fallback) {
217
211
  lroOptions.protoJson = protoFilesRoot;
218
- lroOptions.httpRules = [
219
- {
220
- selector: 'google.longrunning.Operations.CancelOperation',
221
- post: '/v1/{name=projects/*/operations/*}:cancel',
222
- body: '*',
223
- additional_bindings: [
224
- {
225
- post: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
226
- body: '*',
227
- },
228
- {
229
- post: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
230
- body: '*',
231
- },
232
- ],
233
- },
234
- {
235
- selector: 'google.longrunning.Operations.GetOperation',
236
- get: '/v1/{name=projects/*/operations/*}',
237
- additional_bindings: [
238
- {
239
- get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
240
- },
241
- {
242
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
243
- },
244
- {
245
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
246
- },
247
- {
248
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
249
- },
250
- {
251
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
252
- },
253
- {
254
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
255
- },
256
- {
257
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
258
- },
259
- {
260
- get: '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
261
- },
262
- {
263
- get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}',
264
- },
265
- {
266
- get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
267
- },
268
- {
269
- get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
270
- },
271
- {
272
- get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}',
273
- },
274
- {
275
- get: '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}',
276
- },
277
- { get: '/v1/{name=projects/*/locations/*/operations/*}' },
278
- { get: '/v1/{name=projects/*/operations/*}' },
279
- ],
280
- },
281
- {
282
- selector: 'google.longrunning.Operations.ListOperations',
283
- get: '/v1/{name=projects/*}/operations',
284
- additional_bindings: [
285
- {
286
- get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
287
- },
288
- {
289
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
290
- },
291
- {
292
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
293
- },
294
- {
295
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
296
- },
297
- {
298
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
299
- },
300
- {
301
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
302
- },
303
- {
304
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
305
- },
306
- {
307
- get: '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations',
308
- },
309
- { get: '/v1/{name=projects/*/locations/*/collections/*}/operations' },
310
- {
311
- get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
312
- },
313
- {
314
- get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
315
- },
316
- { get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations' },
317
- {
318
- get: '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations',
319
- },
320
- { get: '/v1/{name=projects/*/locations/*}/operations' },
321
- { get: '/v1/{name=projects/*}/operations' },
322
- ],
323
- },
324
- ];
212
+ 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: '*', }],
213
+ }, { 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/*}', }],
214
+ }, { 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', }],
215
+ }];
325
216
  }
326
- this.operationsClient = this._gaxModule
327
- .lro(lroOptions)
328
- .operationsClient(opts);
217
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
329
218
  const purgeUserEventsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.PurgeUserEventsResponse');
330
219
  const purgeUserEventsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.PurgeUserEventsMetadata');
331
220
  const importUserEventsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.ImportUserEventsResponse');
332
221
  const importUserEventsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.ImportUserEventsMetadata');
333
222
  this.descriptors.longrunning = {
334
223
  purgeUserEvents: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeUserEventsResponse.decode.bind(purgeUserEventsResponse), purgeUserEventsMetadata.decode.bind(purgeUserEventsMetadata)),
335
- importUserEvents: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importUserEventsResponse.decode.bind(importUserEventsResponse), importUserEventsMetadata.decode.bind(importUserEventsMetadata)),
224
+ importUserEvents: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importUserEventsResponse.decode.bind(importUserEventsResponse), importUserEventsMetadata.decode.bind(importUserEventsMetadata))
336
225
  };
337
226
  // Put together the default options sent with requests.
338
227
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.UserEventService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -361,19 +250,13 @@ class UserEventServiceClient {
361
250
  }
362
251
  // Put together the "service stub" for
363
252
  // google.cloud.discoveryengine.v1.UserEventService.
364
- this.userEventServiceStub = this._gaxGrpc.createStub(this._opts.fallback
365
- ? this._protos.lookupService('google.cloud.discoveryengine.v1.UserEventService')
366
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
367
- this._protos.google.cloud.discoveryengine.v1
368
- .UserEventService, this._opts, this._providedCustomServicePath);
253
+ this.userEventServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
254
+ this._protos.lookupService('google.cloud.discoveryengine.v1.UserEventService') :
255
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
256
+ this._protos.google.cloud.discoveryengine.v1.UserEventService, this._opts, this._providedCustomServicePath);
369
257
  // Iterate over each of the methods that the service provides
370
258
  // and create an API call method for each.
371
- const userEventServiceStubMethods = [
372
- 'writeUserEvent',
373
- 'collectUserEvent',
374
- 'purgeUserEvents',
375
- 'importUserEvents',
376
- ];
259
+ const userEventServiceStubMethods = ['writeUserEvent', 'collectUserEvent', 'purgeUserEvents', 'importUserEvents'];
377
260
  for (const methodName of userEventServiceStubMethods) {
378
261
  const callPromise = this.userEventServiceStub.then(stub => (...args) => {
379
262
  if (this._terminated) {
@@ -384,7 +267,8 @@ class UserEventServiceClient {
384
267
  }, (err) => () => {
385
268
  throw err;
386
269
  });
387
- const descriptor = this.descriptors.longrunning[methodName] || undefined;
270
+ const descriptor = this.descriptors.longrunning[methodName] ||
271
+ undefined;
388
272
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
389
273
  this.innerApiCalls[methodName] = apiCall;
390
274
  }
@@ -396,8 +280,7 @@ class UserEventServiceClient {
396
280
  * @returns {string} The DNS address for this service.
397
281
  */
398
282
  static get servicePath() {
399
- if (typeof process === 'object' &&
400
- typeof process.emitWarning === 'function') {
283
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
401
284
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
402
285
  }
403
286
  return 'discoveryengine.googleapis.com';
@@ -408,8 +291,7 @@ class UserEventServiceClient {
408
291
  * @returns {string} The DNS address for this service.
409
292
  */
410
293
  static get apiEndpoint() {
411
- if (typeof process === 'object' &&
412
- typeof process.emitWarning === 'function') {
294
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
413
295
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
414
296
  }
415
297
  return 'discoveryengine.googleapis.com';
@@ -437,7 +319,9 @@ class UserEventServiceClient {
437
319
  * @returns {string[]} List of default scopes.
438
320
  */
439
321
  static get scopes() {
440
- return ['https://www.googleapis.com/auth/cloud-platform'];
322
+ return [
323
+ 'https://www.googleapis.com/auth/cloud-platform'
324
+ ];
441
325
  }
442
326
  /**
443
327
  * Return the project ID used by this class.
@@ -463,13 +347,10 @@ class UserEventServiceClient {
463
347
  options = options || {};
464
348
  options.otherArgs = options.otherArgs || {};
465
349
  options.otherArgs.headers = options.otherArgs.headers || {};
466
- options.otherArgs.headers['x-goog-request-params'] =
467
- this._gaxModule.routingHeader.fromParams({
468
- parent: request.parent ?? '',
469
- });
470
- this.initialize().catch(err => {
471
- throw err;
350
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
351
+ 'parent': request.parent ?? '',
472
352
  });
353
+ this.initialize().catch(err => { throw err; });
473
354
  this._log.info('writeUserEvent request %j', request);
474
355
  const wrappedCallback = callback
475
356
  ? (error, response, options, rawResponse) => {
@@ -477,8 +358,7 @@ class UserEventServiceClient {
477
358
  callback(error, response, options, rawResponse); // We verified callback above.
478
359
  }
479
360
  : undefined;
480
- return this.innerApiCalls
481
- .writeUserEvent(request, options, wrappedCallback)
361
+ return this.innerApiCalls.writeUserEvent(request, options, wrappedCallback)
482
362
  ?.then(([response, options, rawResponse]) => {
483
363
  this._log.info('writeUserEvent response %j', response);
484
364
  return [response, options, rawResponse];
@@ -497,13 +377,10 @@ class UserEventServiceClient {
497
377
  options = options || {};
498
378
  options.otherArgs = options.otherArgs || {};
499
379
  options.otherArgs.headers = options.otherArgs.headers || {};
500
- options.otherArgs.headers['x-goog-request-params'] =
501
- this._gaxModule.routingHeader.fromParams({
502
- parent: request.parent ?? '',
503
- });
504
- this.initialize().catch(err => {
505
- throw err;
380
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
381
+ 'parent': request.parent ?? '',
506
382
  });
383
+ this.initialize().catch(err => { throw err; });
507
384
  this._log.info('collectUserEvent request %j', request);
508
385
  const wrappedCallback = callback
509
386
  ? (error, response, options, rawResponse) => {
@@ -511,8 +388,7 @@ class UserEventServiceClient {
511
388
  callback(error, response, options, rawResponse); // We verified callback above.
512
389
  }
513
390
  : undefined;
514
- return this.innerApiCalls
515
- .collectUserEvent(request, options, wrappedCallback)
391
+ return this.innerApiCalls.collectUserEvent(request, options, wrappedCallback)
516
392
  ?.then(([response, options, rawResponse]) => {
517
393
  this._log.info('collectUserEvent response %j', response);
518
394
  return [response, options, rawResponse];
@@ -531,13 +407,10 @@ class UserEventServiceClient {
531
407
  options = options || {};
532
408
  options.otherArgs = options.otherArgs || {};
533
409
  options.otherArgs.headers = options.otherArgs.headers || {};
534
- options.otherArgs.headers['x-goog-request-params'] =
535
- this._gaxModule.routingHeader.fromParams({
536
- parent: request.parent ?? '',
537
- });
538
- this.initialize().catch(err => {
539
- throw err;
410
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
411
+ 'parent': request.parent ?? '',
540
412
  });
413
+ this.initialize().catch(err => { throw err; });
541
414
  const wrappedCallback = callback
542
415
  ? (error, response, rawResponse, _) => {
543
416
  this._log.info('purgeUserEvents response %j', rawResponse);
@@ -545,8 +418,7 @@ class UserEventServiceClient {
545
418
  }
546
419
  : undefined;
547
420
  this._log.info('purgeUserEvents request %j', request);
548
- return this.innerApiCalls
549
- .purgeUserEvents(request, options, wrappedCallback)
421
+ return this.innerApiCalls.purgeUserEvents(request, options, wrappedCallback)
550
422
  ?.then(([response, rawResponse, _]) => {
551
423
  this._log.info('purgeUserEvents response %j', rawResponse);
552
424
  return [response, rawResponse, _];
@@ -583,13 +455,10 @@ class UserEventServiceClient {
583
455
  options = options || {};
584
456
  options.otherArgs = options.otherArgs || {};
585
457
  options.otherArgs.headers = options.otherArgs.headers || {};
586
- options.otherArgs.headers['x-goog-request-params'] =
587
- this._gaxModule.routingHeader.fromParams({
588
- parent: request.parent ?? '',
589
- });
590
- this.initialize().catch(err => {
591
- throw err;
458
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
459
+ 'parent': request.parent ?? '',
592
460
  });
461
+ this.initialize().catch(err => { throw err; });
593
462
  const wrappedCallback = callback
594
463
  ? (error, response, rawResponse, _) => {
595
464
  this._log.info('importUserEvents response %j', rawResponse);
@@ -597,8 +466,7 @@ class UserEventServiceClient {
597
466
  }
598
467
  : undefined;
599
468
  this._log.info('importUserEvents request %j', request);
600
- return this.innerApiCalls
601
- .importUserEvents(request, options, wrappedCallback)
469
+ return this.innerApiCalls.importUserEvents(request, options, wrappedCallback)
602
470
  ?.then(([response, rawResponse, _]) => {
603
471
  this._log.info('importUserEvents response %j', rawResponse);
604
472
  return [response, rawResponse, _];
@@ -623,90 +491,90 @@ class UserEventServiceClient {
623
491
  return decodeOperation;
624
492
  }
625
493
  /**
626
- * Gets information about a location.
627
- *
628
- * @param {Object} request
629
- * The request object that will be sent.
630
- * @param {string} request.name
631
- * Resource name for the location.
632
- * @param {object} [options]
633
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
634
- * @returns {Promise} - The promise which resolves to an array.
635
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
636
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
637
- * for more details and examples.
638
- * @example
639
- * ```
640
- * const [response] = await client.getLocation(request);
641
- * ```
642
- */
494
+ * Gets information about a location.
495
+ *
496
+ * @param {Object} request
497
+ * The request object that will be sent.
498
+ * @param {string} request.name
499
+ * Resource name for the location.
500
+ * @param {object} [options]
501
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
502
+ * @returns {Promise} - The promise which resolves to an array.
503
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
504
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
505
+ * for more details and examples.
506
+ * @example
507
+ * ```
508
+ * const [response] = await client.getLocation(request);
509
+ * ```
510
+ */
643
511
  getLocation(request, options, callback) {
644
512
  return this.locationsClient.getLocation(request, options, callback);
645
513
  }
646
514
  /**
647
- * Lists information about the supported locations for this service. Returns an iterable object.
648
- *
649
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
650
- * @param {Object} request
651
- * The request object that will be sent.
652
- * @param {string} request.name
653
- * The resource that owns the locations collection, if applicable.
654
- * @param {string} request.filter
655
- * The standard list filter.
656
- * @param {number} request.pageSize
657
- * The standard list page size.
658
- * @param {string} request.pageToken
659
- * The standard list page token.
660
- * @param {object} [options]
661
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
662
- * @returns {Object}
663
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
664
- * When you iterate the returned iterable, each element will be an object representing
665
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
666
- * so you can stop the iteration when you don't need more results.
667
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
668
- * for more details and examples.
669
- * @example
670
- * ```
671
- * const iterable = client.listLocationsAsync(request);
672
- * for await (const response of iterable) {
673
- * // process response
674
- * }
675
- * ```
676
- */
515
+ * Lists information about the supported locations for this service. Returns an iterable object.
516
+ *
517
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
518
+ * @param {Object} request
519
+ * The request object that will be sent.
520
+ * @param {string} request.name
521
+ * The resource that owns the locations collection, if applicable.
522
+ * @param {string} request.filter
523
+ * The standard list filter.
524
+ * @param {number} request.pageSize
525
+ * The standard list page size.
526
+ * @param {string} request.pageToken
527
+ * The standard list page token.
528
+ * @param {object} [options]
529
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
530
+ * @returns {Object}
531
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
532
+ * When you iterate the returned iterable, each element will be an object representing
533
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
534
+ * so you can stop the iteration when you don't need more results.
535
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
536
+ * for more details and examples.
537
+ * @example
538
+ * ```
539
+ * const iterable = client.listLocationsAsync(request);
540
+ * for await (const response of iterable) {
541
+ * // process response
542
+ * }
543
+ * ```
544
+ */
677
545
  listLocationsAsync(request, options) {
678
546
  return this.locationsClient.listLocationsAsync(request, options);
679
547
  }
680
548
  /**
681
- * Gets the latest state of a long-running operation. Clients can use this
682
- * method to poll the operation result at intervals as recommended by the API
683
- * service.
684
- *
685
- * @param {Object} request - The request object that will be sent.
686
- * @param {string} request.name - The name of the operation resource.
687
- * @param {Object=} options
688
- * Optional parameters. You can override the default settings for this call,
689
- * e.g, timeout, retries, paginations, etc. See {@link
690
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
691
- * for the details.
692
- * @param {function(?Error, ?Object)=} callback
693
- * The function which will be called with the result of the API call.
694
- *
695
- * The second parameter to the callback is an object representing
696
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
697
- * @return {Promise} - The promise which resolves to an array.
698
- * The first element of the array is an object representing
699
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
700
- * The promise has a method named "cancel" which cancels the ongoing API call.
701
- *
702
- * @example
703
- * ```
704
- * const client = longrunning.operationsClient();
705
- * const name = '';
706
- * const [response] = await client.getOperation({name});
707
- * // doThingsWith(response)
708
- * ```
709
- */
549
+ * Gets the latest state of a long-running operation. Clients can use this
550
+ * method to poll the operation result at intervals as recommended by the API
551
+ * service.
552
+ *
553
+ * @param {Object} request - The request object that will be sent.
554
+ * @param {string} request.name - The name of the operation resource.
555
+ * @param {Object=} options
556
+ * Optional parameters. You can override the default settings for this call,
557
+ * e.g, timeout, retries, paginations, etc. See {@link
558
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
559
+ * for the details.
560
+ * @param {function(?Error, ?Object)=} callback
561
+ * The function which will be called with the result of the API call.
562
+ *
563
+ * The second parameter to the callback is an object representing
564
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
565
+ * @return {Promise} - The promise which resolves to an array.
566
+ * The first element of the array is an object representing
567
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
568
+ * The promise has a method named "cancel" which cancels the ongoing API call.
569
+ *
570
+ * @example
571
+ * ```
572
+ * const client = longrunning.operationsClient();
573
+ * const name = '';
574
+ * const [response] = await client.getOperation({name});
575
+ * // doThingsWith(response)
576
+ * ```
577
+ */
710
578
  getOperation(request, optionsOrCallback, callback) {
711
579
  let options;
712
580
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -3095,8 +2963,8 @@ class UserEventServiceClient {
3095
2963
  this._log.info('ending gRPC channel');
3096
2964
  this._terminated = true;
3097
2965
  stub.close();
3098
- this.locationsClient.close();
3099
- this.operationsClient.close();
2966
+ this.locationsClient.close().catch(err => { throw err; });
2967
+ void this.operationsClient.close();
3100
2968
  });
3101
2969
  }
3102
2970
  return Promise.resolve();