@google-cloud/discoveryengine 2.0.1 → 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 (167) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +7 -2
  3. package/build/protos/google/cloud/discoveryengine/v1/answer.proto +54 -2
  4. package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +2 -1
  5. package/build/protos/google/cloud/discoveryengine/v1/common.proto +35 -6
  6. package/build/protos/google/cloud/discoveryengine/v1/control.proto +113 -2
  7. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +168 -2
  8. package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +23 -4
  9. package/build/protos/google/cloud/discoveryengine/v1/document.proto +7 -2
  10. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +1 -1
  11. package/build/protos/google/cloud/discoveryengine/v1/engine.proto +16 -3
  12. package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +70 -9
  13. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +20 -1
  14. package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +9 -5
  15. package/build/protos/google/cloud/discoveryengine/v1/rank_service.proto +3 -1
  16. package/build/protos/google/cloud/discoveryengine/v1/recommendation_service.proto +2 -2
  17. package/build/protos/google/cloud/discoveryengine/v1/safety.proto +107 -0
  18. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +96 -8
  19. package/build/protos/google/cloud/discoveryengine/v1/serving_config.proto +271 -0
  20. package/build/protos/google/cloud/discoveryengine/v1/serving_config_service.proto +75 -0
  21. package/build/protos/google/cloud/discoveryengine/v1/session.proto +19 -0
  22. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +27 -3
  23. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine_service.proto +184 -5
  24. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +34 -0
  25. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +16 -4
  26. package/build/protos/protos.d.ts +4390 -300
  27. package/build/protos/protos.js +13785 -2922
  28. package/build/protos/protos.json +1355 -14
  29. package/build/src/index.d.ts +4 -1
  30. package/build/src/index.js +4 -21
  31. package/build/src/v1/completion_service_client.d.ts +313 -76
  32. package/build/src/v1/completion_service_client.js +451 -262
  33. package/build/src/v1/completion_service_proto_list.json +3 -0
  34. package/build/src/v1/control_service_client.d.ts +318 -81
  35. package/build/src/v1/control_service_client.js +422 -132
  36. package/build/src/v1/control_service_proto_list.json +3 -0
  37. package/build/src/v1/conversational_search_service_client.d.ts +341 -134
  38. package/build/src/v1/conversational_search_service_client.js +395 -223
  39. package/build/src/v1/conversational_search_service_client_config.json +5 -0
  40. package/build/src/v1/conversational_search_service_proto_list.json +3 -0
  41. package/build/src/v1/data_store_service_client.d.ts +359 -122
  42. package/build/src/v1/data_store_service_client.js +460 -280
  43. package/build/src/v1/data_store_service_proto_list.json +3 -0
  44. package/build/src/v1/document_service_client.d.ts +364 -121
  45. package/build/src/v1/document_service_client.js +469 -300
  46. package/build/src/v1/document_service_proto_list.json +3 -0
  47. package/build/src/v1/engine_service_client.d.ts +340 -103
  48. package/build/src/v1/engine_service_client.js +460 -279
  49. package/build/src/v1/engine_service_proto_list.json +3 -0
  50. package/build/src/v1/gapic_metadata.json +59 -0
  51. package/build/src/v1/grounded_generation_service_client.d.ts +286 -51
  52. package/build/src/v1/grounded_generation_service_client.js +405 -100
  53. package/build/src/v1/grounded_generation_service_proto_list.json +3 -0
  54. package/build/src/v1/index.d.ts +1 -0
  55. package/build/src/v1/index.js +3 -1
  56. package/build/src/v1/project_service_client.d.ts +313 -76
  57. package/build/src/v1/project_service_client.js +434 -222
  58. package/build/src/v1/project_service_proto_list.json +3 -0
  59. package/build/src/v1/rank_service_client.d.ts +285 -48
  60. package/build/src/v1/rank_service_client.js +398 -85
  61. package/build/src/v1/rank_service_proto_list.json +3 -0
  62. package/build/src/v1/recommendation_service_client.d.ts +142 -49
  63. package/build/src/v1/recommendation_service_client.js +198 -82
  64. package/build/src/v1/recommendation_service_proto_list.json +3 -0
  65. package/build/src/v1/schema_service_client.d.ts +348 -111
  66. package/build/src/v1/schema_service_client.js +457 -273
  67. package/build/src/v1/schema_service_proto_list.json +3 -0
  68. package/build/src/v1/search_service_client.d.ts +748 -559
  69. package/build/src/v1/search_service_client.js +302 -133
  70. package/build/src/v1/search_service_proto_list.json +3 -0
  71. package/build/src/v1/search_tuning_service_client.d.ts +314 -77
  72. package/build/src/v1/search_tuning_service_client.js +439 -235
  73. package/build/src/v1/search_tuning_service_proto_list.json +3 -0
  74. package/build/src/v1/serving_config_service_client.d.ts +1851 -0
  75. package/build/src/v1/serving_config_service_client.js +2642 -0
  76. package/build/src/v1/serving_config_service_client_config.json +30 -0
  77. package/build/src/v1/serving_config_service_proto_list.json +39 -0
  78. package/build/src/v1/site_search_engine_service_client.d.ts +504 -151
  79. package/build/src/v1/site_search_engine_service_client.js +625 -351
  80. package/build/src/v1/site_search_engine_service_client_config.json +12 -0
  81. package/build/src/v1/site_search_engine_service_proto_list.json +3 -0
  82. package/build/src/v1/user_event_service_client.d.ts +335 -86
  83. package/build/src/v1/user_event_service_client.js +447 -253
  84. package/build/src/v1/user_event_service_proto_list.json +3 -0
  85. package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
  86. package/build/src/v1alpha/acl_config_service_client.js +82 -106
  87. package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
  88. package/build/src/v1alpha/chunk_service_client.js +92 -120
  89. package/build/src/v1alpha/completion_service_client.d.ts +77 -77
  90. package/build/src/v1alpha/completion_service_client.js +134 -280
  91. package/build/src/v1alpha/control_service_client.d.ts +85 -85
  92. package/build/src/v1alpha/control_service_client.js +105 -151
  93. package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
  94. package/build/src/v1alpha/conversational_search_service_client.js +145 -237
  95. package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
  96. package/build/src/v1alpha/data_store_service_client.js +151 -316
  97. package/build/src/v1alpha/document_service_client.d.ts +126 -126
  98. package/build/src/v1alpha/document_service_client.js +156 -328
  99. package/build/src/v1alpha/engine_service_client.d.ts +106 -106
  100. package/build/src/v1alpha/engine_service_client.js +155 -325
  101. package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
  102. package/build/src/v1alpha/estimate_billing_service_client.js +118 -243
  103. package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
  104. package/build/src/v1alpha/evaluation_service_client.js +143 -295
  105. package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
  106. package/build/src/v1alpha/grounded_generation_service_client.js +79 -100
  107. package/build/src/v1alpha/project_service_client.d.ts +78 -78
  108. package/build/src/v1alpha/project_service_client.js +126 -262
  109. package/build/src/v1alpha/rank_service_client.d.ts +47 -47
  110. package/build/src/v1alpha/rank_service_client.js +81 -104
  111. package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
  112. package/build/src/v1alpha/recommendation_service_client.js +79 -100
  113. package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
  114. package/build/src/v1alpha/sample_query_service_client.js +144 -301
  115. package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
  116. package/build/src/v1alpha/sample_query_set_service_client.js +106 -153
  117. package/build/src/v1alpha/schema_service_client.d.ts +112 -112
  118. package/build/src/v1alpha/schema_service_client.js +140 -292
  119. package/build/src/v1alpha/search_service_client.d.ts +327 -327
  120. package/build/src/v1alpha/search_service_client.js +88 -112
  121. package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
  122. package/build/src/v1alpha/search_tuning_service_client.js +122 -253
  123. package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
  124. package/build/src/v1alpha/serving_config_service_client.js +97 -133
  125. package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
  126. package/build/src/v1alpha/site_search_engine_service_client.js +184 -387
  127. package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
  128. package/build/src/v1alpha/user_event_service_client.js +130 -271
  129. package/build/src/v1beta/completion_service_client.d.ts +78 -78
  130. package/build/src/v1beta/completion_service_client.js +136 -279
  131. package/build/src/v1beta/control_service_client.d.ts +84 -84
  132. package/build/src/v1beta/control_service_client.js +103 -147
  133. package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
  134. package/build/src/v1beta/conversational_search_service_client.js +143 -233
  135. package/build/src/v1beta/data_store_service_client.d.ts +124 -124
  136. package/build/src/v1beta/data_store_service_client.js +141 -288
  137. package/build/src/v1beta/document_service_client.d.ts +124 -124
  138. package/build/src/v1beta/document_service_client.js +150 -309
  139. package/build/src/v1beta/engine_service_client.d.ts +106 -106
  140. package/build/src/v1beta/engine_service_client.js +153 -315
  141. package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
  142. package/build/src/v1beta/evaluation_service_client.js +141 -285
  143. package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
  144. package/build/src/v1beta/grounded_generation_service_client.js +86 -114
  145. package/build/src/v1beta/project_service_client.d.ts +76 -76
  146. package/build/src/v1beta/project_service_client.js +115 -231
  147. package/build/src/v1beta/rank_service_client.d.ts +47 -47
  148. package/build/src/v1beta/rank_service_client.js +79 -99
  149. package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
  150. package/build/src/v1beta/recommendation_service_client.js +77 -96
  151. package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
  152. package/build/src/v1beta/sample_query_service_client.js +142 -291
  153. package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
  154. package/build/src/v1beta/sample_query_set_service_client.js +104 -149
  155. package/build/src/v1beta/schema_service_client.d.ts +111 -111
  156. package/build/src/v1beta/schema_service_client.js +138 -282
  157. package/build/src/v1beta/search_service_client.d.ts +665 -665
  158. package/build/src/v1beta/search_service_client.js +97 -128
  159. package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
  160. package/build/src/v1beta/search_tuning_service_client.js +120 -243
  161. package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
  162. package/build/src/v1beta/serving_config_service_client.js +95 -129
  163. package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
  164. package/build/src/v1beta/site_search_engine_service_client.js +186 -386
  165. package/build/src/v1beta/user_event_service_client.d.ts +78 -78
  166. package/build/src/v1beta/user_event_service_client.js +128 -261
  167. package/package.json +4 -4
@@ -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
  }
@@ -213,128 +207,23 @@ class UserEventServiceClient {
213
207
  // rather than holding a request open.
214
208
  const lroOptions = {
215
209
  auth: this.auth,
216
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
210
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
217
211
  };
218
212
  if (opts.fallback) {
219
213
  lroOptions.protoJson = protoFilesRoot;
220
- lroOptions.httpRules = [
221
- {
222
- selector: 'google.longrunning.Operations.CancelOperation',
223
- post: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
224
- body: '*',
225
- additional_bindings: [
226
- {
227
- post: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
228
- body: '*',
229
- },
230
- ],
231
- },
232
- {
233
- selector: 'google.longrunning.Operations.GetOperation',
234
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
235
- additional_bindings: [
236
- {
237
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
238
- },
239
- {
240
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
241
- },
242
- {
243
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
244
- },
245
- {
246
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
247
- },
248
- {
249
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
250
- },
251
- {
252
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
253
- },
254
- {
255
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
256
- },
257
- {
258
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}',
259
- },
260
- {
261
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
262
- },
263
- {
264
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
265
- },
266
- {
267
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}',
268
- },
269
- {
270
- get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}',
271
- },
272
- {
273
- get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}',
274
- },
275
- { get: '/v1alpha/{name=projects/*/locations/*/operations/*}' },
276
- {
277
- get: '/v1alpha/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
278
- },
279
- { get: '/v1alpha/{name=projects/*/operations/*}' },
280
- ],
281
- },
282
- {
283
- selector: 'google.longrunning.Operations.ListOperations',
284
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
285
- additional_bindings: [
286
- {
287
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
288
- },
289
- {
290
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
291
- },
292
- {
293
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
294
- },
295
- {
296
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
297
- },
298
- {
299
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
300
- },
301
- {
302
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
303
- },
304
- {
305
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations',
306
- },
307
- {
308
- get: '/v1alpha/{name=projects/*/locations/*/collections/*}/operations',
309
- },
310
- {
311
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
312
- },
313
- {
314
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
315
- },
316
- {
317
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations',
318
- },
319
- {
320
- get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*}/operations',
321
- },
322
- { get: '/v1alpha/{name=projects/*/locations/*}/operations' },
323
- { get: '/v1alpha/{name=projects/*}/operations' },
324
- ],
325
- },
326
- ];
214
+ lroOptions.httpRules = [{ selector: 'google.longrunning.Operations.CancelOperation', post: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', additional_bindings: [{ post: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }],
215
+ }, { selector: 'google.longrunning.Operations.GetOperation', get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', additional_bindings: [{ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/operations/*}', }],
216
+ }, { selector: 'google.longrunning.Operations.ListOperations', get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}/operations', additional_bindings: [{ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*}/operations', }, { get: '/v1alpha/{name=projects/*}/operations', }],
217
+ }];
327
218
  }
328
- this.operationsClient = this._gaxModule
329
- .lro(lroOptions)
330
- .operationsClient(opts);
219
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
331
220
  const purgeUserEventsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse');
332
221
  const purgeUserEventsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata');
333
222
  const importUserEventsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse');
334
223
  const importUserEventsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata');
335
224
  this.descriptors.longrunning = {
336
225
  purgeUserEvents: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeUserEventsResponse.decode.bind(purgeUserEventsResponse), purgeUserEventsMetadata.decode.bind(purgeUserEventsMetadata)),
337
- importUserEvents: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importUserEventsResponse.decode.bind(importUserEventsResponse), importUserEventsMetadata.decode.bind(importUserEventsMetadata)),
226
+ importUserEvents: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importUserEventsResponse.decode.bind(importUserEventsResponse), importUserEventsMetadata.decode.bind(importUserEventsMetadata))
338
227
  };
339
228
  // Put together the default options sent with requests.
340
229
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1alpha.UserEventService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -363,19 +252,13 @@ class UserEventServiceClient {
363
252
  }
364
253
  // Put together the "service stub" for
365
254
  // google.cloud.discoveryengine.v1alpha.UserEventService.
366
- this.userEventServiceStub = this._gaxGrpc.createStub(this._opts.fallback
367
- ? this._protos.lookupService('google.cloud.discoveryengine.v1alpha.UserEventService')
368
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
369
- this._protos.google.cloud.discoveryengine.v1alpha
370
- .UserEventService, this._opts, this._providedCustomServicePath);
255
+ this.userEventServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
256
+ this._protos.lookupService('google.cloud.discoveryengine.v1alpha.UserEventService') :
257
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
258
+ this._protos.google.cloud.discoveryengine.v1alpha.UserEventService, this._opts, this._providedCustomServicePath);
371
259
  // Iterate over each of the methods that the service provides
372
260
  // and create an API call method for each.
373
- const userEventServiceStubMethods = [
374
- 'writeUserEvent',
375
- 'collectUserEvent',
376
- 'purgeUserEvents',
377
- 'importUserEvents',
378
- ];
261
+ const userEventServiceStubMethods = ['writeUserEvent', 'collectUserEvent', 'purgeUserEvents', 'importUserEvents'];
379
262
  for (const methodName of userEventServiceStubMethods) {
380
263
  const callPromise = this.userEventServiceStub.then(stub => (...args) => {
381
264
  if (this._terminated) {
@@ -386,7 +269,8 @@ class UserEventServiceClient {
386
269
  }, (err) => () => {
387
270
  throw err;
388
271
  });
389
- const descriptor = this.descriptors.longrunning[methodName] || undefined;
272
+ const descriptor = this.descriptors.longrunning[methodName] ||
273
+ undefined;
390
274
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
391
275
  this.innerApiCalls[methodName] = apiCall;
392
276
  }
@@ -398,8 +282,7 @@ class UserEventServiceClient {
398
282
  * @returns {string} The DNS address for this service.
399
283
  */
400
284
  static get servicePath() {
401
- if (typeof process === 'object' &&
402
- typeof process.emitWarning === 'function') {
285
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
403
286
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
404
287
  }
405
288
  return 'discoveryengine.googleapis.com';
@@ -410,8 +293,7 @@ class UserEventServiceClient {
410
293
  * @returns {string} The DNS address for this service.
411
294
  */
412
295
  static get apiEndpoint() {
413
- if (typeof process === 'object' &&
414
- typeof process.emitWarning === 'function') {
296
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
415
297
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
416
298
  }
417
299
  return 'discoveryengine.googleapis.com';
@@ -439,7 +321,9 @@ class UserEventServiceClient {
439
321
  * @returns {string[]} List of default scopes.
440
322
  */
441
323
  static get scopes() {
442
- return ['https://www.googleapis.com/auth/cloud-platform'];
324
+ return [
325
+ 'https://www.googleapis.com/auth/cloud-platform'
326
+ ];
443
327
  }
444
328
  /**
445
329
  * Return the project ID used by this class.
@@ -465,13 +349,10 @@ class UserEventServiceClient {
465
349
  options = options || {};
466
350
  options.otherArgs = options.otherArgs || {};
467
351
  options.otherArgs.headers = options.otherArgs.headers || {};
468
- options.otherArgs.headers['x-goog-request-params'] =
469
- this._gaxModule.routingHeader.fromParams({
470
- parent: request.parent ?? '',
471
- });
472
- this.initialize().catch(err => {
473
- throw err;
352
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
353
+ 'parent': request.parent ?? '',
474
354
  });
355
+ this.initialize().catch(err => { throw err; });
475
356
  this._log.info('writeUserEvent request %j', request);
476
357
  const wrappedCallback = callback
477
358
  ? (error, response, options, rawResponse) => {
@@ -479,8 +360,7 @@ class UserEventServiceClient {
479
360
  callback(error, response, options, rawResponse); // We verified callback above.
480
361
  }
481
362
  : undefined;
482
- return this.innerApiCalls
483
- .writeUserEvent(request, options, wrappedCallback)
363
+ return this.innerApiCalls.writeUserEvent(request, options, wrappedCallback)
484
364
  ?.then(([response, options, rawResponse]) => {
485
365
  this._log.info('writeUserEvent response %j', response);
486
366
  return [response, options, rawResponse];
@@ -499,13 +379,10 @@ class UserEventServiceClient {
499
379
  options = options || {};
500
380
  options.otherArgs = options.otherArgs || {};
501
381
  options.otherArgs.headers = options.otherArgs.headers || {};
502
- options.otherArgs.headers['x-goog-request-params'] =
503
- this._gaxModule.routingHeader.fromParams({
504
- parent: request.parent ?? '',
505
- });
506
- this.initialize().catch(err => {
507
- throw err;
382
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
383
+ 'parent': request.parent ?? '',
508
384
  });
385
+ this.initialize().catch(err => { throw err; });
509
386
  this._log.info('collectUserEvent request %j', request);
510
387
  const wrappedCallback = callback
511
388
  ? (error, response, options, rawResponse) => {
@@ -513,8 +390,7 @@ class UserEventServiceClient {
513
390
  callback(error, response, options, rawResponse); // We verified callback above.
514
391
  }
515
392
  : undefined;
516
- return this.innerApiCalls
517
- .collectUserEvent(request, options, wrappedCallback)
393
+ return this.innerApiCalls.collectUserEvent(request, options, wrappedCallback)
518
394
  ?.then(([response, options, rawResponse]) => {
519
395
  this._log.info('collectUserEvent response %j', response);
520
396
  return [response, options, rawResponse];
@@ -533,13 +409,10 @@ class UserEventServiceClient {
533
409
  options = options || {};
534
410
  options.otherArgs = options.otherArgs || {};
535
411
  options.otherArgs.headers = options.otherArgs.headers || {};
536
- options.otherArgs.headers['x-goog-request-params'] =
537
- this._gaxModule.routingHeader.fromParams({
538
- parent: request.parent ?? '',
539
- });
540
- this.initialize().catch(err => {
541
- throw err;
412
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
413
+ 'parent': request.parent ?? '',
542
414
  });
415
+ this.initialize().catch(err => { throw err; });
543
416
  const wrappedCallback = callback
544
417
  ? (error, response, rawResponse, _) => {
545
418
  this._log.info('purgeUserEvents response %j', rawResponse);
@@ -547,8 +420,7 @@ class UserEventServiceClient {
547
420
  }
548
421
  : undefined;
549
422
  this._log.info('purgeUserEvents request %j', request);
550
- return this.innerApiCalls
551
- .purgeUserEvents(request, options, wrappedCallback)
423
+ return this.innerApiCalls.purgeUserEvents(request, options, wrappedCallback)
552
424
  ?.then(([response, rawResponse, _]) => {
553
425
  this._log.info('purgeUserEvents response %j', rawResponse);
554
426
  return [response, rawResponse, _];
@@ -585,13 +457,10 @@ class UserEventServiceClient {
585
457
  options = options || {};
586
458
  options.otherArgs = options.otherArgs || {};
587
459
  options.otherArgs.headers = options.otherArgs.headers || {};
588
- options.otherArgs.headers['x-goog-request-params'] =
589
- this._gaxModule.routingHeader.fromParams({
590
- parent: request.parent ?? '',
591
- });
592
- this.initialize().catch(err => {
593
- throw err;
460
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
461
+ 'parent': request.parent ?? '',
594
462
  });
463
+ this.initialize().catch(err => { throw err; });
595
464
  const wrappedCallback = callback
596
465
  ? (error, response, rawResponse, _) => {
597
466
  this._log.info('importUserEvents response %j', rawResponse);
@@ -599,8 +468,7 @@ class UserEventServiceClient {
599
468
  }
600
469
  : undefined;
601
470
  this._log.info('importUserEvents request %j', request);
602
- return this.innerApiCalls
603
- .importUserEvents(request, options, wrappedCallback)
471
+ return this.innerApiCalls.importUserEvents(request, options, wrappedCallback)
604
472
  ?.then(([response, rawResponse, _]) => {
605
473
  this._log.info('importUserEvents response %j', rawResponse);
606
474
  return [response, rawResponse, _];
@@ -625,90 +493,90 @@ class UserEventServiceClient {
625
493
  return decodeOperation;
626
494
  }
627
495
  /**
628
- * Gets information about a location.
629
- *
630
- * @param {Object} request
631
- * The request object that will be sent.
632
- * @param {string} request.name
633
- * Resource name for the location.
634
- * @param {object} [options]
635
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
636
- * @returns {Promise} - The promise which resolves to an array.
637
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
638
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
639
- * for more details and examples.
640
- * @example
641
- * ```
642
- * const [response] = await client.getLocation(request);
643
- * ```
644
- */
496
+ * Gets information about a location.
497
+ *
498
+ * @param {Object} request
499
+ * The request object that will be sent.
500
+ * @param {string} request.name
501
+ * Resource name for the location.
502
+ * @param {object} [options]
503
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
504
+ * @returns {Promise} - The promise which resolves to an array.
505
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
506
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
507
+ * for more details and examples.
508
+ * @example
509
+ * ```
510
+ * const [response] = await client.getLocation(request);
511
+ * ```
512
+ */
645
513
  getLocation(request, options, callback) {
646
514
  return this.locationsClient.getLocation(request, options, callback);
647
515
  }
648
516
  /**
649
- * Lists information about the supported locations for this service. Returns an iterable object.
650
- *
651
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
652
- * @param {Object} request
653
- * The request object that will be sent.
654
- * @param {string} request.name
655
- * The resource that owns the locations collection, if applicable.
656
- * @param {string} request.filter
657
- * The standard list filter.
658
- * @param {number} request.pageSize
659
- * The standard list page size.
660
- * @param {string} request.pageToken
661
- * The standard list page token.
662
- * @param {object} [options]
663
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
664
- * @returns {Object}
665
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
666
- * When you iterate the returned iterable, each element will be an object representing
667
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
668
- * so you can stop the iteration when you don't need more results.
669
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
670
- * for more details and examples.
671
- * @example
672
- * ```
673
- * const iterable = client.listLocationsAsync(request);
674
- * for await (const response of iterable) {
675
- * // process response
676
- * }
677
- * ```
678
- */
517
+ * Lists information about the supported locations for this service. Returns an iterable object.
518
+ *
519
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
520
+ * @param {Object} request
521
+ * The request object that will be sent.
522
+ * @param {string} request.name
523
+ * The resource that owns the locations collection, if applicable.
524
+ * @param {string} request.filter
525
+ * The standard list filter.
526
+ * @param {number} request.pageSize
527
+ * The standard list page size.
528
+ * @param {string} request.pageToken
529
+ * The standard list page token.
530
+ * @param {object} [options]
531
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
532
+ * @returns {Object}
533
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
534
+ * When you iterate the returned iterable, each element will be an object representing
535
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
536
+ * so you can stop the iteration when you don't need more results.
537
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
538
+ * for more details and examples.
539
+ * @example
540
+ * ```
541
+ * const iterable = client.listLocationsAsync(request);
542
+ * for await (const response of iterable) {
543
+ * // process response
544
+ * }
545
+ * ```
546
+ */
679
547
  listLocationsAsync(request, options) {
680
548
  return this.locationsClient.listLocationsAsync(request, options);
681
549
  }
682
550
  /**
683
- * Gets the latest state of a long-running operation. Clients can use this
684
- * method to poll the operation result at intervals as recommended by the API
685
- * service.
686
- *
687
- * @param {Object} request - The request object that will be sent.
688
- * @param {string} request.name - The name of the operation resource.
689
- * @param {Object=} options
690
- * Optional parameters. You can override the default settings for this call,
691
- * e.g, timeout, retries, paginations, etc. See {@link
692
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
693
- * for the details.
694
- * @param {function(?Error, ?Object)=} callback
695
- * The function which will be called with the result of the API call.
696
- *
697
- * The second parameter to the callback is an object representing
698
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
699
- * @return {Promise} - The promise which resolves to an array.
700
- * The first element of the array is an object representing
701
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
702
- * The promise has a method named "cancel" which cancels the ongoing API call.
703
- *
704
- * @example
705
- * ```
706
- * const client = longrunning.operationsClient();
707
- * const name = '';
708
- * const [response] = await client.getOperation({name});
709
- * // doThingsWith(response)
710
- * ```
711
- */
551
+ * Gets the latest state of a long-running operation. Clients can use this
552
+ * method to poll the operation result at intervals as recommended by the API
553
+ * service.
554
+ *
555
+ * @param {Object} request - The request object that will be sent.
556
+ * @param {string} request.name - The name of the operation resource.
557
+ * @param {Object=} options
558
+ * Optional parameters. You can override the default settings for this call,
559
+ * e.g, timeout, retries, paginations, etc. See {@link
560
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
561
+ * for the details.
562
+ * @param {function(?Error, ?Object)=} callback
563
+ * The function which will be called with the result of the API call.
564
+ *
565
+ * The second parameter to the callback is an object representing
566
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
567
+ * @return {Promise} - The promise which resolves to an array.
568
+ * The first element of the array is an object representing
569
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
570
+ * The promise has a method named "cancel" which cancels the ongoing API call.
571
+ *
572
+ * @example
573
+ * ```
574
+ * const client = longrunning.operationsClient();
575
+ * const name = '';
576
+ * const [response] = await client.getOperation({name});
577
+ * // doThingsWith(response)
578
+ * ```
579
+ */
712
580
  getOperation(request, optionsOrCallback, callback) {
713
581
  let options;
714
582
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -883,8 +751,7 @@ class UserEventServiceClient {
883
751
  * @returns {string} A string representing the project.
884
752
  */
885
753
  matchProjectFromAclConfigName(aclConfigName) {
886
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
887
- .project;
754
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
888
755
  }
889
756
  /**
890
757
  * Parse the location from AclConfig resource.
@@ -894,8 +761,7 @@ class UserEventServiceClient {
894
761
  * @returns {string} A string representing the location.
895
762
  */
896
763
  matchLocationFromAclConfigName(aclConfigName) {
897
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
898
- .location;
764
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
899
765
  }
900
766
  /**
901
767
  * Return a fully-qualified engine resource name string.
@@ -977,8 +843,7 @@ class UserEventServiceClient {
977
843
  * @returns {string} A string representing the project.
978
844
  */
979
845
  matchProjectFromEvaluationName(evaluationName) {
980
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
981
- .project;
846
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
982
847
  }
983
848
  /**
984
849
  * Parse the location from Evaluation resource.
@@ -988,8 +853,7 @@ class UserEventServiceClient {
988
853
  * @returns {string} A string representing the location.
989
854
  */
990
855
  matchLocationFromEvaluationName(evaluationName) {
991
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
992
- .location;
856
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
993
857
  }
994
858
  /**
995
859
  * Parse the evaluation from Evaluation resource.
@@ -999,8 +863,7 @@ class UserEventServiceClient {
999
863
  * @returns {string} A string representing the evaluation.
1000
864
  */
1001
865
  matchEvaluationFromEvaluationName(evaluationName) {
1002
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1003
- .evaluation;
866
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
1004
867
  }
1005
868
  /**
1006
869
  * Return a fully-qualified project resource name string.
@@ -3067,8 +2930,7 @@ class UserEventServiceClient {
3067
2930
  * @returns {string} A string representing the project.
3068
2931
  */
3069
2932
  matchProjectFromSampleQueryName(sampleQueryName) {
3070
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3071
- .project;
2933
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3072
2934
  }
3073
2935
  /**
3074
2936
  * Parse the location from SampleQuery resource.
@@ -3078,8 +2940,7 @@ class UserEventServiceClient {
3078
2940
  * @returns {string} A string representing the location.
3079
2941
  */
3080
2942
  matchLocationFromSampleQueryName(sampleQueryName) {
3081
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3082
- .location;
2943
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3083
2944
  }
3084
2945
  /**
3085
2946
  * Parse the sample_query_set from SampleQuery resource.
@@ -3089,8 +2950,7 @@ class UserEventServiceClient {
3089
2950
  * @returns {string} A string representing the sample_query_set.
3090
2951
  */
3091
2952
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3092
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3093
- .sample_query_set;
2953
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3094
2954
  }
3095
2955
  /**
3096
2956
  * Parse the sample_query from SampleQuery resource.
@@ -3100,8 +2960,7 @@ class UserEventServiceClient {
3100
2960
  * @returns {string} A string representing the sample_query.
3101
2961
  */
3102
2962
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3103
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3104
- .sample_query;
2963
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3105
2964
  }
3106
2965
  /**
3107
2966
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3160,8 +3019,8 @@ class UserEventServiceClient {
3160
3019
  this._log.info('ending gRPC channel');
3161
3020
  this._terminated = true;
3162
3021
  stub.close();
3163
- this.locationsClient.close();
3164
- this.operationsClient.close();
3022
+ this.locationsClient.close().catch(err => { throw err; });
3023
+ void this.operationsClient.close();
3165
3024
  });
3166
3025
  }
3167
3026
  return Promise.resolve();