@google-cloud/discoveryengine 2.1.0 → 2.3.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 (172) hide show
  1. package/README.md +13 -0
  2. package/build/protos/google/cloud/discoveryengine/v1/answer.proto +17 -0
  3. package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +52 -0
  4. package/build/protos/google/cloud/discoveryengine/v1/cmek_config_service.proto +300 -0
  5. package/build/protos/google/cloud/discoveryengine/v1/common.proto +67 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/control.proto +1 -3
  7. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +3 -0
  8. package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +54 -2
  9. package/build/protos/google/cloud/discoveryengine/v1/data_store_service.proto +14 -0
  10. package/build/protos/google/cloud/discoveryengine/v1/document.proto +95 -4
  11. package/build/protos/google/cloud/discoveryengine/v1/document_processing_config.proto +28 -1
  12. package/build/protos/google/cloud/discoveryengine/v1/engine.proto +131 -6
  13. package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +8 -0
  14. package/build/protos/google/cloud/discoveryengine/v1/grounding.proto +9 -0
  15. package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store.proto +84 -0
  16. package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store_service.proto +375 -0
  17. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +6 -0
  18. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +6 -0
  19. package/build/protos/google/cloud/discoveryengine/v1/user_license.proto +98 -0
  20. package/build/protos/google/cloud/discoveryengine/v1/user_license_service.proto +191 -0
  21. package/build/protos/protos.d.ts +5415 -578
  22. package/build/protos/protos.js +77830 -63391
  23. package/build/protos/protos.json +1537 -92
  24. package/build/src/index.d.ts +10 -1
  25. package/build/src/index.js +8 -22
  26. package/build/src/v1/cmek_config_service_client.d.ts +2287 -0
  27. package/build/src/v1/cmek_config_service_client.js +3274 -0
  28. package/build/src/v1/cmek_config_service_client_config.json +42 -0
  29. package/build/src/v1/cmek_config_service_proto_list.json +44 -0
  30. package/build/src/v1/completion_service_client.d.ts +166 -76
  31. package/build/src/v1/completion_service_client.js +258 -263
  32. package/build/src/v1/completion_service_proto_list.json +6 -1
  33. package/build/src/v1/control_service_client.d.ts +171 -81
  34. package/build/src/v1/control_service_client.js +246 -132
  35. package/build/src/v1/control_service_proto_list.json +6 -1
  36. package/build/src/v1/conversational_search_service_client.d.ts +233 -143
  37. package/build/src/v1/conversational_search_service_client.js +330 -226
  38. package/build/src/v1/conversational_search_service_proto_list.json +6 -1
  39. package/build/src/v1/data_store_service_client.d.ts +218 -122
  40. package/build/src/v1/data_store_service_client.js +273 -281
  41. package/build/src/v1/data_store_service_proto_list.json +6 -1
  42. package/build/src/v1/document_service_client.d.ts +210 -120
  43. package/build/src/v1/document_service_client.js +300 -301
  44. package/build/src/v1/document_service_proto_list.json +6 -1
  45. package/build/src/v1/engine_service_client.d.ts +193 -103
  46. package/build/src/v1/engine_service_client.js +273 -280
  47. package/build/src/v1/engine_service_proto_list.json +6 -1
  48. package/build/src/v1/gapic_metadata.json +184 -0
  49. package/build/src/v1/grounded_generation_service_client.d.ts +138 -48
  50. package/build/src/v1/grounded_generation_service_client.js +217 -100
  51. package/build/src/v1/grounded_generation_service_proto_list.json +6 -1
  52. package/build/src/v1/identity_mapping_store_service_client.d.ts +2470 -0
  53. package/build/src/v1/identity_mapping_store_service_client.js +3449 -0
  54. package/build/src/v1/identity_mapping_store_service_client_config.json +54 -0
  55. package/build/src/v1/identity_mapping_store_service_proto_list.json +44 -0
  56. package/build/src/v1/index.d.ts +3 -0
  57. package/build/src/v1/index.js +7 -1
  58. package/build/src/v1/project_service_client.d.ts +166 -76
  59. package/build/src/v1/project_service_client.js +235 -223
  60. package/build/src/v1/project_service_proto_list.json +6 -1
  61. package/build/src/v1/rank_service_client.d.ts +137 -47
  62. package/build/src/v1/rank_service_client.js +204 -85
  63. package/build/src/v1/rank_service_proto_list.json +6 -1
  64. package/build/src/v1/recommendation_service_client.d.ts +137 -47
  65. package/build/src/v1/recommendation_service_client.js +202 -82
  66. package/build/src/v1/recommendation_service_proto_list.json +6 -1
  67. package/build/src/v1/schema_service_client.d.ts +201 -111
  68. package/build/src/v1/schema_service_client.js +264 -274
  69. package/build/src/v1/schema_service_proto_list.json +6 -1
  70. package/build/src/v1/search_service_client.d.ts +661 -571
  71. package/build/src/v1/search_service_client.js +216 -113
  72. package/build/src/v1/search_service_proto_list.json +6 -1
  73. package/build/src/v1/search_tuning_service_client.d.ts +167 -77
  74. package/build/src/v1/search_tuning_service_client.js +246 -236
  75. package/build/src/v1/search_tuning_service_proto_list.json +6 -1
  76. package/build/src/v1/serving_config_service_client.d.ts +138 -48
  77. package/build/src/v1/serving_config_service_client.js +201 -80
  78. package/build/src/v1/serving_config_service_proto_list.json +6 -1
  79. package/build/src/v1/site_search_engine_service_client.d.ts +238 -148
  80. package/build/src/v1/site_search_engine_service_client.js +324 -379
  81. package/build/src/v1/site_search_engine_service_proto_list.json +6 -1
  82. package/build/src/v1/user_event_service_client.d.ts +167 -77
  83. package/build/src/v1/user_event_service_client.js +260 -254
  84. package/build/src/v1/user_event_service_proto_list.json +6 -1
  85. package/build/src/v1/user_license_service_client.d.ts +2256 -0
  86. package/build/src/v1/user_license_service_client.js +3194 -0
  87. package/build/src/v1/user_license_service_client_config.json +34 -0
  88. package/build/src/v1/user_license_service_proto_list.json +44 -0
  89. package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
  90. package/build/src/v1alpha/acl_config_service_client.js +94 -106
  91. package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
  92. package/build/src/v1alpha/chunk_service_client.js +98 -120
  93. package/build/src/v1alpha/completion_service_client.d.ts +77 -77
  94. package/build/src/v1alpha/completion_service_client.js +141 -281
  95. package/build/src/v1alpha/control_service_client.d.ts +85 -85
  96. package/build/src/v1alpha/control_service_client.js +129 -151
  97. package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
  98. package/build/src/v1alpha/conversational_search_service_client.js +211 -237
  99. package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
  100. package/build/src/v1alpha/data_store_service_client.js +176 -317
  101. package/build/src/v1alpha/document_service_client.d.ts +126 -126
  102. package/build/src/v1alpha/document_service_client.js +193 -329
  103. package/build/src/v1alpha/engine_service_client.d.ts +106 -106
  104. package/build/src/v1alpha/engine_service_client.js +180 -326
  105. package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
  106. package/build/src/v1alpha/estimate_billing_service_client.js +119 -244
  107. package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
  108. package/build/src/v1alpha/evaluation_service_client.js +150 -296
  109. package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
  110. package/build/src/v1alpha/grounded_generation_service_client.js +85 -100
  111. package/build/src/v1alpha/project_service_client.d.ts +78 -78
  112. package/build/src/v1alpha/project_service_client.js +139 -263
  113. package/build/src/v1alpha/rank_service_client.d.ts +47 -47
  114. package/build/src/v1alpha/rank_service_client.js +87 -104
  115. package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
  116. package/build/src/v1alpha/recommendation_service_client.js +85 -100
  117. package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
  118. package/build/src/v1alpha/sample_query_service_client.js +169 -302
  119. package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
  120. package/build/src/v1alpha/sample_query_set_service_client.js +130 -153
  121. package/build/src/v1alpha/schema_service_client.d.ts +112 -112
  122. package/build/src/v1alpha/schema_service_client.js +147 -293
  123. package/build/src/v1alpha/search_service_client.d.ts +327 -327
  124. package/build/src/v1alpha/search_service_client.js +88 -112
  125. package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
  126. package/build/src/v1alpha/search_tuning_service_client.js +129 -254
  127. package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
  128. package/build/src/v1alpha/serving_config_service_client.js +109 -133
  129. package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
  130. package/build/src/v1alpha/site_search_engine_service_client.js +203 -388
  131. package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
  132. package/build/src/v1alpha/user_event_service_client.js +143 -272
  133. package/build/src/v1beta/completion_service_client.d.ts +78 -78
  134. package/build/src/v1beta/completion_service_client.js +149 -280
  135. package/build/src/v1beta/control_service_client.d.ts +84 -84
  136. package/build/src/v1beta/control_service_client.js +127 -147
  137. package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
  138. package/build/src/v1beta/conversational_search_service_client.js +209 -233
  139. package/build/src/v1beta/data_store_service_client.d.ts +124 -124
  140. package/build/src/v1beta/data_store_service_client.js +154 -289
  141. package/build/src/v1beta/document_service_client.d.ts +124 -124
  142. package/build/src/v1beta/document_service_client.js +181 -310
  143. package/build/src/v1beta/engine_service_client.d.ts +106 -106
  144. package/build/src/v1beta/engine_service_client.js +178 -316
  145. package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
  146. package/build/src/v1beta/evaluation_service_client.js +148 -286
  147. package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
  148. package/build/src/v1beta/grounded_generation_service_client.js +98 -114
  149. package/build/src/v1beta/project_service_client.d.ts +76 -76
  150. package/build/src/v1beta/project_service_client.js +116 -232
  151. package/build/src/v1beta/rank_service_client.d.ts +47 -47
  152. package/build/src/v1beta/rank_service_client.js +85 -99
  153. package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
  154. package/build/src/v1beta/recommendation_service_client.js +83 -96
  155. package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
  156. package/build/src/v1beta/sample_query_service_client.js +167 -292
  157. package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
  158. package/build/src/v1beta/sample_query_set_service_client.js +128 -149
  159. package/build/src/v1beta/schema_service_client.d.ts +111 -111
  160. package/build/src/v1beta/schema_service_client.js +145 -283
  161. package/build/src/v1beta/search_service_client.d.ts +665 -665
  162. package/build/src/v1beta/search_service_client.js +97 -128
  163. package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
  164. package/build/src/v1beta/search_tuning_service_client.js +127 -244
  165. package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
  166. package/build/src/v1beta/serving_config_service_client.js +107 -129
  167. package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
  168. package/build/src/v1beta/site_search_engine_service_client.js +205 -387
  169. package/build/src/v1beta/user_event_service_client.d.ts +78 -78
  170. package/build/src/v1beta/user_event_service_client.js +141 -262
  171. package/package.json +7 -7
  172. package/CHANGELOG.md +0 -267
@@ -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
  }
@@ -210,125 +204,26 @@ class ProjectServiceClient {
210
204
  sampleQueryPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}'),
211
205
  sampleQuerySetPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}'),
212
206
  };
213
- const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
207
+ const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
214
208
  // This API contains "long-running operations", which return a
215
209
  // an Operation object that allows for tracking of the operation,
216
210
  // rather than holding a request open.
217
211
  const lroOptions = {
218
212
  auth: this.auth,
219
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
213
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
220
214
  };
221
215
  if (opts.fallback) {
222
216
  lroOptions.protoJson = protoFilesRoot;
223
- lroOptions.httpRules = [
224
- {
225
- selector: 'google.longrunning.Operations.CancelOperation',
226
- post: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
227
- body: '*',
228
- additional_bindings: [
229
- {
230
- post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
231
- body: '*',
232
- },
233
- ],
234
- },
235
- {
236
- selector: 'google.longrunning.Operations.GetOperation',
237
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
238
- additional_bindings: [
239
- {
240
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
241
- },
242
- {
243
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
244
- },
245
- {
246
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
247
- },
248
- {
249
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
250
- },
251
- {
252
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
253
- },
254
- {
255
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
256
- },
257
- {
258
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
259
- },
260
- {
261
- get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}',
262
- },
263
- {
264
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
265
- },
266
- {
267
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
268
- },
269
- {
270
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}',
271
- },
272
- {
273
- get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}',
274
- },
275
- { get: '/v1beta/{name=projects/*/locations/*/operations/*}' },
276
- {
277
- get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
278
- },
279
- { get: '/v1beta/{name=projects/*/operations/*}' },
280
- ],
281
- },
282
- {
283
- selector: 'google.longrunning.Operations.ListOperations',
284
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
285
- additional_bindings: [
286
- {
287
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
288
- },
289
- {
290
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
291
- },
292
- {
293
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
294
- },
295
- {
296
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
297
- },
298
- {
299
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
300
- },
301
- {
302
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
303
- },
304
- {
305
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations',
306
- },
307
- {
308
- get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations',
309
- },
310
- {
311
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
312
- },
313
- {
314
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
315
- },
316
- {
317
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations',
318
- },
319
- { get: '/v1beta/{name=projects/*/locations/*}/operations' },
320
- { get: '/v1beta/{name=projects/*}/operations' },
321
- ],
322
- },
323
- ];
217
+ lroOptions.httpRules = [{ selector: 'google.longrunning.Operations.CancelOperation', post: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', additional_bindings: [{ post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }],
218
+ }, { selector: 'google.longrunning.Operations.GetOperation', get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', additional_bindings: [{ get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}', }, { get: '/v1beta/{name=projects/*/operations/*}', }],
219
+ }, { selector: 'google.longrunning.Operations.ListOperations', get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations', additional_bindings: [{ get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*}/operations', }, { get: '/v1beta/{name=projects/*}/operations', }],
220
+ }];
324
221
  }
325
- this.operationsClient = this._gaxModule
326
- .lro(lroOptions)
327
- .operationsClient(opts);
222
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
328
223
  const provisionProjectResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.Project');
329
224
  const provisionProjectMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.ProvisionProjectMetadata');
330
225
  this.descriptors.longrunning = {
331
- provisionProject: new this._gaxModule.LongrunningDescriptor(this.operationsClient, provisionProjectResponse.decode.bind(provisionProjectResponse), provisionProjectMetadata.decode.bind(provisionProjectMetadata)),
226
+ provisionProject: new this._gaxModule.LongrunningDescriptor(this.operationsClient, provisionProjectResponse.decode.bind(provisionProjectResponse), provisionProjectMetadata.decode.bind(provisionProjectMetadata))
332
227
  };
333
228
  // Put together the default options sent with requests.
334
229
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.ProjectService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -357,11 +252,10 @@ class ProjectServiceClient {
357
252
  }
358
253
  // Put together the "service stub" for
359
254
  // google.cloud.discoveryengine.v1beta.ProjectService.
360
- this.projectServiceStub = this._gaxGrpc.createStub(this._opts.fallback
361
- ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.ProjectService')
362
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
363
- this._protos.google.cloud.discoveryengine.v1beta
364
- .ProjectService, this._opts, this._providedCustomServicePath);
255
+ this.projectServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
256
+ this._protos.lookupService('google.cloud.discoveryengine.v1beta.ProjectService') :
257
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
258
+ this._protos.google.cloud.discoveryengine.v1beta.ProjectService, this._opts, this._providedCustomServicePath);
365
259
  // Iterate over each of the methods that the service provides
366
260
  // and create an API call method for each.
367
261
  const projectServiceStubMethods = ['provisionProject'];
@@ -375,7 +269,8 @@ class ProjectServiceClient {
375
269
  }, (err) => () => {
376
270
  throw err;
377
271
  });
378
- const descriptor = this.descriptors.longrunning[methodName] || undefined;
272
+ const descriptor = this.descriptors.longrunning[methodName] ||
273
+ undefined;
379
274
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
380
275
  this.innerApiCalls[methodName] = apiCall;
381
276
  }
@@ -387,8 +282,7 @@ class ProjectServiceClient {
387
282
  * @returns {string} The DNS address for this service.
388
283
  */
389
284
  static get servicePath() {
390
- if (typeof process === 'object' &&
391
- typeof process.emitWarning === 'function') {
285
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
392
286
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
393
287
  }
394
288
  return 'discoveryengine.googleapis.com';
@@ -399,8 +293,7 @@ class ProjectServiceClient {
399
293
  * @returns {string} The DNS address for this service.
400
294
  */
401
295
  static get apiEndpoint() {
402
- if (typeof process === 'object' &&
403
- typeof process.emitWarning === 'function') {
296
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
404
297
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
405
298
  }
406
299
  return 'discoveryengine.googleapis.com';
@@ -428,7 +321,9 @@ class ProjectServiceClient {
428
321
  * @returns {string[]} List of default scopes.
429
322
  */
430
323
  static get scopes() {
431
- return ['https://www.googleapis.com/auth/cloud-platform'];
324
+ return [
325
+ 'https://www.googleapis.com/auth/cloud-platform'
326
+ ];
432
327
  }
433
328
  /**
434
329
  * Return the project ID used by this class.
@@ -454,13 +349,10 @@ class ProjectServiceClient {
454
349
  options = options || {};
455
350
  options.otherArgs = options.otherArgs || {};
456
351
  options.otherArgs.headers = options.otherArgs.headers || {};
457
- options.otherArgs.headers['x-goog-request-params'] =
458
- this._gaxModule.routingHeader.fromParams({
459
- name: request.name ?? '',
460
- });
461
- this.initialize().catch(err => {
462
- throw err;
352
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
353
+ 'name': request.name ?? '',
463
354
  });
355
+ this.initialize().catch(err => { throw err; });
464
356
  const wrappedCallback = callback
465
357
  ? (error, response, rawResponse, _) => {
466
358
  this._log.info('provisionProject response %j', rawResponse);
@@ -468,8 +360,7 @@ class ProjectServiceClient {
468
360
  }
469
361
  : undefined;
470
362
  this._log.info('provisionProject request %j', request);
471
- return this.innerApiCalls
472
- .provisionProject(request, options, wrappedCallback)
363
+ return this.innerApiCalls.provisionProject(request, options, wrappedCallback)
473
364
  ?.then(([response, rawResponse, _]) => {
474
365
  this._log.info('provisionProject response %j', rawResponse);
475
366
  return [response, rawResponse, _];
@@ -494,90 +385,90 @@ class ProjectServiceClient {
494
385
  return decodeOperation;
495
386
  }
496
387
  /**
497
- * Gets information about a location.
498
- *
499
- * @param {Object} request
500
- * The request object that will be sent.
501
- * @param {string} request.name
502
- * Resource name for the location.
503
- * @param {object} [options]
504
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
505
- * @returns {Promise} - The promise which resolves to an array.
506
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
507
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
508
- * for more details and examples.
509
- * @example
510
- * ```
511
- * const [response] = await client.getLocation(request);
512
- * ```
513
- */
388
+ * Gets information about a location.
389
+ *
390
+ * @param {Object} request
391
+ * The request object that will be sent.
392
+ * @param {string} request.name
393
+ * Resource name for the location.
394
+ * @param {object} [options]
395
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
396
+ * @returns {Promise} - The promise which resolves to an array.
397
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
398
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
399
+ * for more details and examples.
400
+ * @example
401
+ * ```
402
+ * const [response] = await client.getLocation(request);
403
+ * ```
404
+ */
514
405
  getLocation(request, options, callback) {
515
406
  return this.locationsClient.getLocation(request, options, callback);
516
407
  }
517
408
  /**
518
- * Lists information about the supported locations for this service. Returns an iterable object.
519
- *
520
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
521
- * @param {Object} request
522
- * The request object that will be sent.
523
- * @param {string} request.name
524
- * The resource that owns the locations collection, if applicable.
525
- * @param {string} request.filter
526
- * The standard list filter.
527
- * @param {number} request.pageSize
528
- * The standard list page size.
529
- * @param {string} request.pageToken
530
- * The standard list page token.
531
- * @param {object} [options]
532
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
533
- * @returns {Object}
534
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
535
- * When you iterate the returned iterable, each element will be an object representing
536
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
537
- * so you can stop the iteration when you don't need more results.
538
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
539
- * for more details and examples.
540
- * @example
541
- * ```
542
- * const iterable = client.listLocationsAsync(request);
543
- * for await (const response of iterable) {
544
- * // process response
545
- * }
546
- * ```
547
- */
409
+ * Lists information about the supported locations for this service. Returns an iterable object.
410
+ *
411
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
412
+ * @param {Object} request
413
+ * The request object that will be sent.
414
+ * @param {string} request.name
415
+ * The resource that owns the locations collection, if applicable.
416
+ * @param {string} request.filter
417
+ * The standard list filter.
418
+ * @param {number} request.pageSize
419
+ * The standard list page size.
420
+ * @param {string} request.pageToken
421
+ * The standard list page token.
422
+ * @param {object} [options]
423
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
424
+ * @returns {Object}
425
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
426
+ * When you iterate the returned iterable, each element will be an object representing
427
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
428
+ * so you can stop the iteration when you don't need more results.
429
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
430
+ * for more details and examples.
431
+ * @example
432
+ * ```
433
+ * const iterable = client.listLocationsAsync(request);
434
+ * for await (const response of iterable) {
435
+ * // process response
436
+ * }
437
+ * ```
438
+ */
548
439
  listLocationsAsync(request, options) {
549
440
  return this.locationsClient.listLocationsAsync(request, options);
550
441
  }
551
442
  /**
552
- * Gets the latest state of a long-running operation. Clients can use this
553
- * method to poll the operation result at intervals as recommended by the API
554
- * service.
555
- *
556
- * @param {Object} request - The request object that will be sent.
557
- * @param {string} request.name - The name of the operation resource.
558
- * @param {Object=} options
559
- * Optional parameters. You can override the default settings for this call,
560
- * e.g, timeout, retries, paginations, etc. See {@link
561
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
562
- * for the details.
563
- * @param {function(?Error, ?Object)=} callback
564
- * The function which will be called with the result of the API call.
565
- *
566
- * The second parameter to the callback is an object representing
567
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
568
- * @return {Promise} - The promise which resolves to an array.
569
- * The first element of the array is an object representing
570
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
571
- * The promise has a method named "cancel" which cancels the ongoing API call.
572
- *
573
- * @example
574
- * ```
575
- * const client = longrunning.operationsClient();
576
- * const name = '';
577
- * const [response] = await client.getOperation({name});
578
- * // doThingsWith(response)
579
- * ```
580
- */
443
+ * Gets the latest state of a long-running operation. Clients can use this
444
+ * method to poll the operation result at intervals as recommended by the API
445
+ * service.
446
+ *
447
+ * @param {Object} request - The request object that will be sent.
448
+ * @param {string} request.name - The name of the operation resource.
449
+ * @param {Object=} options
450
+ * Optional parameters. You can override the default settings for this call,
451
+ * e.g, timeout, retries, paginations, etc. See {@link
452
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
453
+ * for the details.
454
+ * @param {function(?Error, ?Object)=} callback
455
+ * The function which will be called with the result of the API call.
456
+ *
457
+ * The second parameter to the callback is an object representing
458
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
459
+ * @return {Promise} - The promise which resolves to an array.
460
+ * The first element of the array is an object representing
461
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
462
+ * The promise has a method named "cancel" which cancels the ongoing API call.
463
+ *
464
+ * @example
465
+ * ```
466
+ * const client = longrunning.operationsClient();
467
+ * const name = '';
468
+ * const [response] = await client.getOperation({name});
469
+ * // doThingsWith(response)
470
+ * ```
471
+ */
581
472
  getOperation(request, optionsOrCallback, callback) {
582
473
  let options;
583
474
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -811,8 +702,7 @@ class ProjectServiceClient {
811
702
  * @returns {string} A string representing the project.
812
703
  */
813
704
  matchProjectFromEvaluationName(evaluationName) {
814
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
815
- .project;
705
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
816
706
  }
817
707
  /**
818
708
  * Parse the location from Evaluation resource.
@@ -822,8 +712,7 @@ class ProjectServiceClient {
822
712
  * @returns {string} A string representing the location.
823
713
  */
824
714
  matchLocationFromEvaluationName(evaluationName) {
825
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
826
- .location;
715
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
827
716
  }
828
717
  /**
829
718
  * Parse the evaluation from Evaluation resource.
@@ -833,8 +722,7 @@ class ProjectServiceClient {
833
722
  * @returns {string} A string representing the evaluation.
834
723
  */
835
724
  matchEvaluationFromEvaluationName(evaluationName) {
836
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
837
- .evaluation;
725
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
838
726
  }
839
727
  /**
840
728
  * Return a fully-qualified groundingConfig resource name string.
@@ -3072,8 +2960,7 @@ class ProjectServiceClient {
3072
2960
  * @returns {string} A string representing the project.
3073
2961
  */
3074
2962
  matchProjectFromSampleQueryName(sampleQueryName) {
3075
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3076
- .project;
2963
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3077
2964
  }
3078
2965
  /**
3079
2966
  * Parse the location from SampleQuery resource.
@@ -3083,8 +2970,7 @@ class ProjectServiceClient {
3083
2970
  * @returns {string} A string representing the location.
3084
2971
  */
3085
2972
  matchLocationFromSampleQueryName(sampleQueryName) {
3086
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3087
- .location;
2973
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3088
2974
  }
3089
2975
  /**
3090
2976
  * Parse the sample_query_set from SampleQuery resource.
@@ -3094,8 +2980,7 @@ class ProjectServiceClient {
3094
2980
  * @returns {string} A string representing the sample_query_set.
3095
2981
  */
3096
2982
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3097
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3098
- .sample_query_set;
2983
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3099
2984
  }
3100
2985
  /**
3101
2986
  * Parse the sample_query from SampleQuery resource.
@@ -3105,8 +2990,7 @@ class ProjectServiceClient {
3105
2990
  * @returns {string} A string representing the sample_query.
3106
2991
  */
3107
2992
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3108
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3109
- .sample_query;
2993
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3110
2994
  }
3111
2995
  /**
3112
2996
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3165,8 +3049,8 @@ class ProjectServiceClient {
3165
3049
  this._log.info('ending gRPC channel');
3166
3050
  this._terminated = true;
3167
3051
  stub.close();
3168
- this.locationsClient.close();
3169
- this.operationsClient.close();
3052
+ this.locationsClient.close().catch(err => { throw err; });
3053
+ void this.operationsClient.close();
3170
3054
  });
3171
3055
  }
3172
3056
  return Promise.resolve();
@@ -175,55 +175,55 @@ export declare class RankServiceClient {
175
175
  rank(request: protos.google.cloud.discoveryengine.v1beta.IRankRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IRankResponse, protos.google.cloud.discoveryengine.v1beta.IRankRequest | null | undefined, {} | null | undefined>): void;
176
176
  rank(request: protos.google.cloud.discoveryengine.v1beta.IRankRequest, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IRankResponse, protos.google.cloud.discoveryengine.v1beta.IRankRequest | null | undefined, {} | null | undefined>): void;
177
177
  /**
178
- * Gets information about a location.
179
- *
180
- * @param {Object} request
181
- * The request object that will be sent.
182
- * @param {string} request.name
183
- * Resource name for the location.
184
- * @param {object} [options]
185
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
186
- * @returns {Promise} - The promise which resolves to an array.
187
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
188
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
189
- * for more details and examples.
190
- * @example
191
- * ```
192
- * const [response] = await client.getLocation(request);
193
- * ```
194
- */
178
+ * Gets information about a location.
179
+ *
180
+ * @param {Object} request
181
+ * The request object that will be sent.
182
+ * @param {string} request.name
183
+ * Resource name for the location.
184
+ * @param {object} [options]
185
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
186
+ * @returns {Promise} - The promise which resolves to an array.
187
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
188
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
189
+ * for more details and examples.
190
+ * @example
191
+ * ```
192
+ * const [response] = await client.getLocation(request);
193
+ * ```
194
+ */
195
195
  getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;
196
196
  /**
197
- * Lists information about the supported locations for this service. Returns an iterable object.
198
- *
199
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
200
- * @param {Object} request
201
- * The request object that will be sent.
202
- * @param {string} request.name
203
- * The resource that owns the locations collection, if applicable.
204
- * @param {string} request.filter
205
- * The standard list filter.
206
- * @param {number} request.pageSize
207
- * The standard list page size.
208
- * @param {string} request.pageToken
209
- * The standard list page token.
210
- * @param {object} [options]
211
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
212
- * @returns {Object}
213
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
214
- * When you iterate the returned iterable, each element will be an object representing
215
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
216
- * so you can stop the iteration when you don't need more results.
217
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
218
- * for more details and examples.
219
- * @example
220
- * ```
221
- * const iterable = client.listLocationsAsync(request);
222
- * for await (const response of iterable) {
223
- * // process response
224
- * }
225
- * ```
226
- */
197
+ * Lists information about the supported locations for this service. Returns an iterable object.
198
+ *
199
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
200
+ * @param {Object} request
201
+ * The request object that will be sent.
202
+ * @param {string} request.name
203
+ * The resource that owns the locations collection, if applicable.
204
+ * @param {string} request.filter
205
+ * The standard list filter.
206
+ * @param {number} request.pageSize
207
+ * The standard list page size.
208
+ * @param {string} request.pageToken
209
+ * The standard list page token.
210
+ * @param {object} [options]
211
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
212
+ * @returns {Object}
213
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
214
+ * When you iterate the returned iterable, each element will be an object representing
215
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
216
+ * so you can stop the iteration when you don't need more results.
217
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
218
+ * for more details and examples.
219
+ * @example
220
+ * ```
221
+ * const iterable = client.listLocationsAsync(request);
222
+ * for await (const response of iterable) {
223
+ * // process response
224
+ * }
225
+ * ```
226
+ */
227
227
  listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
228
228
  /**
229
229
  * Return a fully-qualified engine resource name string.