@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
@@ -99,26 +99,17 @@ class ProjectServiceClient {
99
99
  constructor(opts, gaxInstance) {
100
100
  // Ensure that options include all the required fields.
101
101
  const staticMembers = this.constructor;
102
- if (opts?.universe_domain &&
103
- opts?.universeDomain &&
104
- opts?.universe_domain !== opts?.universeDomain) {
102
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
105
103
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
106
104
  }
107
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
108
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
109
- : undefined;
110
- this._universeDomain =
111
- opts?.universeDomain ??
112
- opts?.universe_domain ??
113
- universeDomainEnvVar ??
114
- 'googleapis.com';
105
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
106
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
115
107
  this._servicePath = 'discoveryengine.' + this._universeDomain;
116
108
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
117
109
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
118
110
  const port = opts?.port || staticMembers.port;
119
111
  const clientConfig = opts?.clientConfig ?? {};
120
- const fallback = opts?.fallback ??
121
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
112
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
122
113
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
123
114
  // Request numeric enum values if REST transport is used.
124
115
  opts.numericEnums = true;
@@ -148,7 +139,10 @@ class ProjectServiceClient {
148
139
  }
149
140
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
150
141
  // Determine the client header string.
151
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
142
+ const clientHeader = [
143
+ `gax/${this._gaxModule.version}`,
144
+ `gapic/${version}`,
145
+ ];
152
146
  if (typeof process === 'object' && 'versions' in process) {
153
147
  clientHeader.push(`gl-node/${process.versions.node}`);
154
148
  }
@@ -214,125 +208,20 @@ class ProjectServiceClient {
214
208
  // rather than holding a request open.
215
209
  const lroOptions = {
216
210
  auth: this.auth,
217
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
211
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
218
212
  };
219
213
  if (opts.fallback) {
220
214
  lroOptions.protoJson = protoFilesRoot;
221
- lroOptions.httpRules = [
222
- {
223
- selector: 'google.longrunning.Operations.CancelOperation',
224
- post: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
225
- body: '*',
226
- additional_bindings: [
227
- {
228
- post: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
229
- body: '*',
230
- },
231
- ],
232
- },
233
- {
234
- selector: 'google.longrunning.Operations.GetOperation',
235
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
236
- additional_bindings: [
237
- {
238
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
239
- },
240
- {
241
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
242
- },
243
- {
244
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
245
- },
246
- {
247
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
248
- },
249
- {
250
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
251
- },
252
- {
253
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
254
- },
255
- {
256
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
257
- },
258
- {
259
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}',
260
- },
261
- {
262
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
263
- },
264
- {
265
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
266
- },
267
- {
268
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}',
269
- },
270
- {
271
- get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}',
272
- },
273
- {
274
- get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}',
275
- },
276
- { get: '/v1alpha/{name=projects/*/locations/*/operations/*}' },
277
- {
278
- get: '/v1alpha/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
279
- },
280
- { get: '/v1alpha/{name=projects/*/operations/*}' },
281
- ],
282
- },
283
- {
284
- selector: 'google.longrunning.Operations.ListOperations',
285
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
286
- additional_bindings: [
287
- {
288
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
289
- },
290
- {
291
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
292
- },
293
- {
294
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
295
- },
296
- {
297
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
298
- },
299
- {
300
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
301
- },
302
- {
303
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
304
- },
305
- {
306
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations',
307
- },
308
- {
309
- get: '/v1alpha/{name=projects/*/locations/*/collections/*}/operations',
310
- },
311
- {
312
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
313
- },
314
- {
315
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
316
- },
317
- {
318
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations',
319
- },
320
- {
321
- get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*}/operations',
322
- },
323
- { get: '/v1alpha/{name=projects/*/locations/*}/operations' },
324
- { get: '/v1alpha/{name=projects/*}/operations' },
325
- ],
326
- },
327
- ];
215
+ 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: '*', }],
216
+ }, { 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/*}', }],
217
+ }, { 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', }],
218
+ }];
328
219
  }
329
- this.operationsClient = this._gaxModule
330
- .lro(lroOptions)
331
- .operationsClient(opts);
220
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
332
221
  const provisionProjectResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.Project');
333
222
  const provisionProjectMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.ProvisionProjectMetadata');
334
223
  this.descriptors.longrunning = {
335
- provisionProject: new this._gaxModule.LongrunningDescriptor(this.operationsClient, provisionProjectResponse.decode.bind(provisionProjectResponse), provisionProjectMetadata.decode.bind(provisionProjectMetadata)),
224
+ provisionProject: new this._gaxModule.LongrunningDescriptor(this.operationsClient, provisionProjectResponse.decode.bind(provisionProjectResponse), provisionProjectMetadata.decode.bind(provisionProjectMetadata))
336
225
  };
337
226
  // Put together the default options sent with requests.
338
227
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1alpha.ProjectService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -361,18 +250,13 @@ class ProjectServiceClient {
361
250
  }
362
251
  // Put together the "service stub" for
363
252
  // google.cloud.discoveryengine.v1alpha.ProjectService.
364
- this.projectServiceStub = this._gaxGrpc.createStub(this._opts.fallback
365
- ? this._protos.lookupService('google.cloud.discoveryengine.v1alpha.ProjectService')
366
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
367
- this._protos.google.cloud.discoveryengine.v1alpha
368
- .ProjectService, this._opts, this._providedCustomServicePath);
253
+ this.projectServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
254
+ this._protos.lookupService('google.cloud.discoveryengine.v1alpha.ProjectService') :
255
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
256
+ this._protos.google.cloud.discoveryengine.v1alpha.ProjectService, 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 projectServiceStubMethods = [
372
- 'getProject',
373
- 'provisionProject',
374
- 'reportConsentChange',
375
- ];
259
+ const projectServiceStubMethods = ['getProject', 'provisionProject', 'reportConsentChange'];
376
260
  for (const methodName of projectServiceStubMethods) {
377
261
  const callPromise = this.projectServiceStub.then(stub => (...args) => {
378
262
  if (this._terminated) {
@@ -383,7 +267,8 @@ class ProjectServiceClient {
383
267
  }, (err) => () => {
384
268
  throw err;
385
269
  });
386
- const descriptor = this.descriptors.longrunning[methodName] || undefined;
270
+ const descriptor = this.descriptors.longrunning[methodName] ||
271
+ undefined;
387
272
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
388
273
  this.innerApiCalls[methodName] = apiCall;
389
274
  }
@@ -395,8 +280,7 @@ class ProjectServiceClient {
395
280
  * @returns {string} The DNS address for this service.
396
281
  */
397
282
  static get servicePath() {
398
- if (typeof process === 'object' &&
399
- typeof process.emitWarning === 'function') {
283
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
400
284
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
401
285
  }
402
286
  return 'discoveryengine.googleapis.com';
@@ -407,8 +291,7 @@ class ProjectServiceClient {
407
291
  * @returns {string} The DNS address for this service.
408
292
  */
409
293
  static get apiEndpoint() {
410
- if (typeof process === 'object' &&
411
- typeof process.emitWarning === 'function') {
294
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
412
295
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
413
296
  }
414
297
  return 'discoveryengine.googleapis.com';
@@ -436,7 +319,9 @@ class ProjectServiceClient {
436
319
  * @returns {string[]} List of default scopes.
437
320
  */
438
321
  static get scopes() {
439
- return ['https://www.googleapis.com/auth/cloud-platform'];
322
+ return [
323
+ 'https://www.googleapis.com/auth/cloud-platform'
324
+ ];
440
325
  }
441
326
  /**
442
327
  * Return the project ID used by this class.
@@ -462,13 +347,10 @@ class ProjectServiceClient {
462
347
  options = options || {};
463
348
  options.otherArgs = options.otherArgs || {};
464
349
  options.otherArgs.headers = options.otherArgs.headers || {};
465
- options.otherArgs.headers['x-goog-request-params'] =
466
- this._gaxModule.routingHeader.fromParams({
467
- name: request.name ?? '',
468
- });
469
- this.initialize().catch(err => {
470
- throw err;
350
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
351
+ 'name': request.name ?? '',
471
352
  });
353
+ this.initialize().catch(err => { throw err; });
472
354
  this._log.info('getProject request %j', request);
473
355
  const wrappedCallback = callback
474
356
  ? (error, response, options, rawResponse) => {
@@ -476,8 +358,7 @@ class ProjectServiceClient {
476
358
  callback(error, response, options, rawResponse); // We verified callback above.
477
359
  }
478
360
  : undefined;
479
- return this.innerApiCalls
480
- .getProject(request, options, wrappedCallback)
361
+ return this.innerApiCalls.getProject(request, options, wrappedCallback)
481
362
  ?.then(([response, options, rawResponse]) => {
482
363
  this._log.info('getProject response %j', response);
483
364
  return [response, options, rawResponse];
@@ -496,13 +377,10 @@ class ProjectServiceClient {
496
377
  options = options || {};
497
378
  options.otherArgs = options.otherArgs || {};
498
379
  options.otherArgs.headers = options.otherArgs.headers || {};
499
- options.otherArgs.headers['x-goog-request-params'] =
500
- this._gaxModule.routingHeader.fromParams({
501
- project: request.project ?? '',
502
- });
503
- this.initialize().catch(err => {
504
- throw err;
380
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
381
+ 'project': request.project ?? '',
505
382
  });
383
+ this.initialize().catch(err => { throw err; });
506
384
  this._log.info('reportConsentChange request %j', request);
507
385
  const wrappedCallback = callback
508
386
  ? (error, response, options, rawResponse) => {
@@ -510,8 +388,7 @@ class ProjectServiceClient {
510
388
  callback(error, response, options, rawResponse); // We verified callback above.
511
389
  }
512
390
  : undefined;
513
- return this.innerApiCalls
514
- .reportConsentChange(request, options, wrappedCallback)
391
+ return this.innerApiCalls.reportConsentChange(request, options, wrappedCallback)
515
392
  ?.then(([response, options, rawResponse]) => {
516
393
  this._log.info('reportConsentChange response %j', response);
517
394
  return [response, options, rawResponse];
@@ -530,13 +407,10 @@ class ProjectServiceClient {
530
407
  options = options || {};
531
408
  options.otherArgs = options.otherArgs || {};
532
409
  options.otherArgs.headers = options.otherArgs.headers || {};
533
- options.otherArgs.headers['x-goog-request-params'] =
534
- this._gaxModule.routingHeader.fromParams({
535
- name: request.name ?? '',
536
- });
537
- this.initialize().catch(err => {
538
- throw err;
410
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
411
+ 'name': request.name ?? '',
539
412
  });
413
+ this.initialize().catch(err => { throw err; });
540
414
  const wrappedCallback = callback
541
415
  ? (error, response, rawResponse, _) => {
542
416
  this._log.info('provisionProject response %j', rawResponse);
@@ -544,8 +418,7 @@ class ProjectServiceClient {
544
418
  }
545
419
  : undefined;
546
420
  this._log.info('provisionProject request %j', request);
547
- return this.innerApiCalls
548
- .provisionProject(request, options, wrappedCallback)
421
+ return this.innerApiCalls.provisionProject(request, options, wrappedCallback)
549
422
  ?.then(([response, rawResponse, _]) => {
550
423
  this._log.info('provisionProject response %j', rawResponse);
551
424
  return [response, rawResponse, _];
@@ -570,90 +443,90 @@ class ProjectServiceClient {
570
443
  return decodeOperation;
571
444
  }
572
445
  /**
573
- * Gets information about a location.
574
- *
575
- * @param {Object} request
576
- * The request object that will be sent.
577
- * @param {string} request.name
578
- * Resource name for the location.
579
- * @param {object} [options]
580
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
581
- * @returns {Promise} - The promise which resolves to an array.
582
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
583
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
584
- * for more details and examples.
585
- * @example
586
- * ```
587
- * const [response] = await client.getLocation(request);
588
- * ```
589
- */
446
+ * Gets information about a location.
447
+ *
448
+ * @param {Object} request
449
+ * The request object that will be sent.
450
+ * @param {string} request.name
451
+ * Resource name for the location.
452
+ * @param {object} [options]
453
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
454
+ * @returns {Promise} - The promise which resolves to an array.
455
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
456
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
457
+ * for more details and examples.
458
+ * @example
459
+ * ```
460
+ * const [response] = await client.getLocation(request);
461
+ * ```
462
+ */
590
463
  getLocation(request, options, callback) {
591
464
  return this.locationsClient.getLocation(request, options, callback);
592
465
  }
593
466
  /**
594
- * Lists information about the supported locations for this service. Returns an iterable object.
595
- *
596
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
597
- * @param {Object} request
598
- * The request object that will be sent.
599
- * @param {string} request.name
600
- * The resource that owns the locations collection, if applicable.
601
- * @param {string} request.filter
602
- * The standard list filter.
603
- * @param {number} request.pageSize
604
- * The standard list page size.
605
- * @param {string} request.pageToken
606
- * The standard list page token.
607
- * @param {object} [options]
608
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
609
- * @returns {Object}
610
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
611
- * When you iterate the returned iterable, each element will be an object representing
612
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
613
- * so you can stop the iteration when you don't need more results.
614
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
615
- * for more details and examples.
616
- * @example
617
- * ```
618
- * const iterable = client.listLocationsAsync(request);
619
- * for await (const response of iterable) {
620
- * // process response
621
- * }
622
- * ```
623
- */
467
+ * Lists information about the supported locations for this service. Returns an iterable object.
468
+ *
469
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
470
+ * @param {Object} request
471
+ * The request object that will be sent.
472
+ * @param {string} request.name
473
+ * The resource that owns the locations collection, if applicable.
474
+ * @param {string} request.filter
475
+ * The standard list filter.
476
+ * @param {number} request.pageSize
477
+ * The standard list page size.
478
+ * @param {string} request.pageToken
479
+ * The standard list page token.
480
+ * @param {object} [options]
481
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
482
+ * @returns {Object}
483
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
484
+ * When you iterate the returned iterable, each element will be an object representing
485
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
486
+ * so you can stop the iteration when you don't need more results.
487
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
488
+ * for more details and examples.
489
+ * @example
490
+ * ```
491
+ * const iterable = client.listLocationsAsync(request);
492
+ * for await (const response of iterable) {
493
+ * // process response
494
+ * }
495
+ * ```
496
+ */
624
497
  listLocationsAsync(request, options) {
625
498
  return this.locationsClient.listLocationsAsync(request, options);
626
499
  }
627
500
  /**
628
- * Gets the latest state of a long-running operation. Clients can use this
629
- * method to poll the operation result at intervals as recommended by the API
630
- * service.
631
- *
632
- * @param {Object} request - The request object that will be sent.
633
- * @param {string} request.name - The name of the operation resource.
634
- * @param {Object=} options
635
- * Optional parameters. You can override the default settings for this call,
636
- * e.g, timeout, retries, paginations, etc. See {@link
637
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
638
- * for the details.
639
- * @param {function(?Error, ?Object)=} callback
640
- * The function which will be called with the result of the API call.
641
- *
642
- * The second parameter to the callback is an object representing
643
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
644
- * @return {Promise} - The promise which resolves to an array.
645
- * The first element of the array is an object representing
646
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
647
- * The promise has a method named "cancel" which cancels the ongoing API call.
648
- *
649
- * @example
650
- * ```
651
- * const client = longrunning.operationsClient();
652
- * const name = '';
653
- * const [response] = await client.getOperation({name});
654
- * // doThingsWith(response)
655
- * ```
656
- */
501
+ * Gets the latest state of a long-running operation. Clients can use this
502
+ * method to poll the operation result at intervals as recommended by the API
503
+ * service.
504
+ *
505
+ * @param {Object} request - The request object that will be sent.
506
+ * @param {string} request.name - The name of the operation resource.
507
+ * @param {Object=} options
508
+ * Optional parameters. You can override the default settings for this call,
509
+ * e.g, timeout, retries, paginations, etc. See {@link
510
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
511
+ * for the details.
512
+ * @param {function(?Error, ?Object)=} callback
513
+ * The function which will be called with the result of the API call.
514
+ *
515
+ * The second parameter to the callback is an object representing
516
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
517
+ * @return {Promise} - The promise which resolves to an array.
518
+ * The first element of the array is an object representing
519
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
520
+ * The promise has a method named "cancel" which cancels the ongoing API call.
521
+ *
522
+ * @example
523
+ * ```
524
+ * const client = longrunning.operationsClient();
525
+ * const name = '';
526
+ * const [response] = await client.getOperation({name});
527
+ * // doThingsWith(response)
528
+ * ```
529
+ */
657
530
  getOperation(request, optionsOrCallback, callback) {
658
531
  let options;
659
532
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -828,8 +701,7 @@ class ProjectServiceClient {
828
701
  * @returns {string} A string representing the project.
829
702
  */
830
703
  matchProjectFromAclConfigName(aclConfigName) {
831
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
832
- .project;
704
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
833
705
  }
834
706
  /**
835
707
  * Parse the location from AclConfig resource.
@@ -839,8 +711,7 @@ class ProjectServiceClient {
839
711
  * @returns {string} A string representing the location.
840
712
  */
841
713
  matchLocationFromAclConfigName(aclConfigName) {
842
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
843
- .location;
714
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
844
715
  }
845
716
  /**
846
717
  * Return a fully-qualified engine resource name string.
@@ -922,8 +793,7 @@ class ProjectServiceClient {
922
793
  * @returns {string} A string representing the project.
923
794
  */
924
795
  matchProjectFromEvaluationName(evaluationName) {
925
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
926
- .project;
796
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
927
797
  }
928
798
  /**
929
799
  * Parse the location from Evaluation resource.
@@ -933,8 +803,7 @@ class ProjectServiceClient {
933
803
  * @returns {string} A string representing the location.
934
804
  */
935
805
  matchLocationFromEvaluationName(evaluationName) {
936
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
937
- .location;
806
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
938
807
  }
939
808
  /**
940
809
  * Parse the evaluation from Evaluation resource.
@@ -944,8 +813,7 @@ class ProjectServiceClient {
944
813
  * @returns {string} A string representing the evaluation.
945
814
  */
946
815
  matchEvaluationFromEvaluationName(evaluationName) {
947
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
948
- .evaluation;
816
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
949
817
  }
950
818
  /**
951
819
  * Return a fully-qualified project resource name string.
@@ -3012,8 +2880,7 @@ class ProjectServiceClient {
3012
2880
  * @returns {string} A string representing the project.
3013
2881
  */
3014
2882
  matchProjectFromSampleQueryName(sampleQueryName) {
3015
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3016
- .project;
2883
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3017
2884
  }
3018
2885
  /**
3019
2886
  * Parse the location from SampleQuery resource.
@@ -3023,8 +2890,7 @@ class ProjectServiceClient {
3023
2890
  * @returns {string} A string representing the location.
3024
2891
  */
3025
2892
  matchLocationFromSampleQueryName(sampleQueryName) {
3026
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3027
- .location;
2893
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3028
2894
  }
3029
2895
  /**
3030
2896
  * Parse the sample_query_set from SampleQuery resource.
@@ -3034,8 +2900,7 @@ class ProjectServiceClient {
3034
2900
  * @returns {string} A string representing the sample_query_set.
3035
2901
  */
3036
2902
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3037
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3038
- .sample_query_set;
2903
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3039
2904
  }
3040
2905
  /**
3041
2906
  * Parse the sample_query from SampleQuery resource.
@@ -3045,8 +2910,7 @@ class ProjectServiceClient {
3045
2910
  * @returns {string} A string representing the sample_query.
3046
2911
  */
3047
2912
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3048
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3049
- .sample_query;
2913
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3050
2914
  }
3051
2915
  /**
3052
2916
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3105,8 +2969,8 @@ class ProjectServiceClient {
3105
2969
  this._log.info('ending gRPC channel');
3106
2970
  this._terminated = true;
3107
2971
  stub.close();
3108
- this.locationsClient.close();
3109
- this.operationsClient.close();
2972
+ this.locationsClient.close().catch(err => { throw err; });
2973
+ void this.operationsClient.close();
3110
2974
  });
3111
2975
  }
3112
2976
  return Promise.resolve();