@google-cloud/discoveryengine 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/protos/protos.d.ts +31 -316
  3. package/build/protos/protos.js +146 -593
  4. package/build/protos/protos.json +25 -1
  5. package/build/src/index.d.ts +1 -1
  6. package/build/src/index.js +1 -21
  7. package/build/src/v1/completion_service_client.d.ts +76 -76
  8. package/build/src/v1/completion_service_client.js +125 -262
  9. package/build/src/v1/control_service_client.d.ts +81 -81
  10. package/build/src/v1/control_service_client.js +96 -132
  11. package/build/src/v1/conversational_search_service_client.d.ts +143 -143
  12. package/build/src/v1/conversational_search_service_client.js +138 -226
  13. package/build/src/v1/data_store_service_client.d.ts +122 -122
  14. package/build/src/v1/data_store_service_client.js +134 -280
  15. package/build/src/v1/document_service_client.d.ts +120 -120
  16. package/build/src/v1/document_service_client.js +143 -300
  17. package/build/src/v1/engine_service_client.d.ts +103 -103
  18. package/build/src/v1/engine_service_client.js +134 -279
  19. package/build/src/v1/grounded_generation_service_client.d.ts +48 -48
  20. package/build/src/v1/grounded_generation_service_client.js +79 -100
  21. package/build/src/v1/project_service_client.d.ts +76 -76
  22. package/build/src/v1/project_service_client.js +108 -222
  23. package/build/src/v1/rank_service_client.d.ts +47 -47
  24. package/build/src/v1/rank_service_client.js +72 -85
  25. package/build/src/v1/recommendation_service_client.d.ts +47 -47
  26. package/build/src/v1/recommendation_service_client.js +70 -82
  27. package/build/src/v1/schema_service_client.d.ts +111 -111
  28. package/build/src/v1/schema_service_client.js +131 -273
  29. package/build/src/v1/search_service_client.d.ts +545 -545
  30. package/build/src/v1/search_service_client.js +90 -113
  31. package/build/src/v1/search_tuning_service_client.d.ts +77 -77
  32. package/build/src/v1/search_tuning_service_client.js +113 -235
  33. package/build/src/v1/serving_config_service_client.d.ts +48 -48
  34. package/build/src/v1/serving_config_service_client.js +69 -80
  35. package/build/src/v1/site_search_engine_service_client.d.ts +148 -148
  36. package/build/src/v1/site_search_engine_service_client.js +179 -378
  37. package/build/src/v1/user_event_service_client.d.ts +77 -77
  38. package/build/src/v1/user_event_service_client.js +121 -253
  39. package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
  40. package/build/src/v1alpha/acl_config_service_client.js +82 -106
  41. package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
  42. package/build/src/v1alpha/chunk_service_client.js +92 -120
  43. package/build/src/v1alpha/completion_service_client.d.ts +77 -77
  44. package/build/src/v1alpha/completion_service_client.js +134 -280
  45. package/build/src/v1alpha/control_service_client.d.ts +85 -85
  46. package/build/src/v1alpha/control_service_client.js +105 -151
  47. package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
  48. package/build/src/v1alpha/conversational_search_service_client.js +145 -237
  49. package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
  50. package/build/src/v1alpha/data_store_service_client.js +151 -316
  51. package/build/src/v1alpha/document_service_client.d.ts +126 -126
  52. package/build/src/v1alpha/document_service_client.js +156 -328
  53. package/build/src/v1alpha/engine_service_client.d.ts +106 -106
  54. package/build/src/v1alpha/engine_service_client.js +155 -325
  55. package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
  56. package/build/src/v1alpha/estimate_billing_service_client.js +118 -243
  57. package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
  58. package/build/src/v1alpha/evaluation_service_client.js +143 -295
  59. package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
  60. package/build/src/v1alpha/grounded_generation_service_client.js +79 -100
  61. package/build/src/v1alpha/project_service_client.d.ts +78 -78
  62. package/build/src/v1alpha/project_service_client.js +126 -262
  63. package/build/src/v1alpha/rank_service_client.d.ts +47 -47
  64. package/build/src/v1alpha/rank_service_client.js +81 -104
  65. package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
  66. package/build/src/v1alpha/recommendation_service_client.js +79 -100
  67. package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
  68. package/build/src/v1alpha/sample_query_service_client.js +144 -301
  69. package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
  70. package/build/src/v1alpha/sample_query_set_service_client.js +106 -153
  71. package/build/src/v1alpha/schema_service_client.d.ts +112 -112
  72. package/build/src/v1alpha/schema_service_client.js +140 -292
  73. package/build/src/v1alpha/search_service_client.d.ts +327 -327
  74. package/build/src/v1alpha/search_service_client.js +88 -112
  75. package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
  76. package/build/src/v1alpha/search_tuning_service_client.js +122 -253
  77. package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
  78. package/build/src/v1alpha/serving_config_service_client.js +97 -133
  79. package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
  80. package/build/src/v1alpha/site_search_engine_service_client.js +184 -387
  81. package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
  82. package/build/src/v1alpha/user_event_service_client.js +130 -271
  83. package/build/src/v1beta/completion_service_client.d.ts +78 -78
  84. package/build/src/v1beta/completion_service_client.js +136 -279
  85. package/build/src/v1beta/control_service_client.d.ts +84 -84
  86. package/build/src/v1beta/control_service_client.js +103 -147
  87. package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
  88. package/build/src/v1beta/conversational_search_service_client.js +143 -233
  89. package/build/src/v1beta/data_store_service_client.d.ts +124 -124
  90. package/build/src/v1beta/data_store_service_client.js +141 -288
  91. package/build/src/v1beta/document_service_client.d.ts +124 -124
  92. package/build/src/v1beta/document_service_client.js +150 -309
  93. package/build/src/v1beta/engine_service_client.d.ts +106 -106
  94. package/build/src/v1beta/engine_service_client.js +153 -315
  95. package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
  96. package/build/src/v1beta/evaluation_service_client.js +141 -285
  97. package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
  98. package/build/src/v1beta/grounded_generation_service_client.js +86 -114
  99. package/build/src/v1beta/project_service_client.d.ts +76 -76
  100. package/build/src/v1beta/project_service_client.js +115 -231
  101. package/build/src/v1beta/rank_service_client.d.ts +47 -47
  102. package/build/src/v1beta/rank_service_client.js +79 -99
  103. package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
  104. package/build/src/v1beta/recommendation_service_client.js +77 -96
  105. package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
  106. package/build/src/v1beta/sample_query_service_client.js +142 -291
  107. package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
  108. package/build/src/v1beta/sample_query_set_service_client.js +104 -149
  109. package/build/src/v1beta/schema_service_client.d.ts +111 -111
  110. package/build/src/v1beta/schema_service_client.js +138 -282
  111. package/build/src/v1beta/search_service_client.d.ts +665 -665
  112. package/build/src/v1beta/search_service_client.js +97 -128
  113. package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
  114. package/build/src/v1beta/search_tuning_service_client.js +120 -243
  115. package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
  116. package/build/src/v1beta/serving_config_service_client.js +95 -129
  117. package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
  118. package/build/src/v1beta/site_search_engine_service_client.js +186 -386
  119. package/build/src/v1beta/user_event_service_client.d.ts +78 -78
  120. package/build/src/v1beta/user_event_service_client.js +128 -261
  121. package/package.json +1 -1
@@ -99,26 +99,17 @@ class EvaluationServiceClient {
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 EvaluationServiceClient {
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
  }
@@ -216,7 +210,7 @@ class EvaluationServiceClient {
216
210
  // pages). Denote the keys used for pagination and results.
217
211
  this.descriptors.page = {
218
212
  listEvaluations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'evaluations'),
219
- listEvaluationResults: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'evaluationResults'),
213
+ listEvaluationResults: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'evaluationResults')
220
214
  };
221
215
  const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
222
216
  // This API contains "long-running operations", which return a
@@ -224,119 +218,20 @@ class EvaluationServiceClient {
224
218
  // rather than holding a request open.
225
219
  const lroOptions = {
226
220
  auth: this.auth,
227
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
221
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
228
222
  };
229
223
  if (opts.fallback) {
230
224
  lroOptions.protoJson = protoFilesRoot;
231
- lroOptions.httpRules = [
232
- {
233
- selector: 'google.longrunning.Operations.CancelOperation',
234
- post: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
235
- body: '*',
236
- additional_bindings: [
237
- {
238
- post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
239
- body: '*',
240
- },
241
- ],
242
- },
243
- {
244
- selector: 'google.longrunning.Operations.GetOperation',
245
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
246
- additional_bindings: [
247
- {
248
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
249
- },
250
- {
251
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
252
- },
253
- {
254
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
255
- },
256
- {
257
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
258
- },
259
- {
260
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
261
- },
262
- {
263
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
264
- },
265
- {
266
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
267
- },
268
- {
269
- get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}',
270
- },
271
- {
272
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
273
- },
274
- {
275
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
276
- },
277
- {
278
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}',
279
- },
280
- {
281
- get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}',
282
- },
283
- { get: '/v1beta/{name=projects/*/locations/*/operations/*}' },
284
- {
285
- get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
286
- },
287
- { get: '/v1beta/{name=projects/*/operations/*}' },
288
- ],
289
- },
290
- {
291
- selector: 'google.longrunning.Operations.ListOperations',
292
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
293
- additional_bindings: [
294
- {
295
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
296
- },
297
- {
298
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
299
- },
300
- {
301
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
302
- },
303
- {
304
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
305
- },
306
- {
307
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
308
- },
309
- {
310
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
311
- },
312
- {
313
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations',
314
- },
315
- {
316
- get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations',
317
- },
318
- {
319
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
320
- },
321
- {
322
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
323
- },
324
- {
325
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations',
326
- },
327
- { get: '/v1beta/{name=projects/*/locations/*}/operations' },
328
- { get: '/v1beta/{name=projects/*}/operations' },
329
- ],
330
- },
331
- ];
225
+ 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: '*', }],
226
+ }, { 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/*}', }],
227
+ }, { 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', }],
228
+ }];
332
229
  }
333
- this.operationsClient = this._gaxModule
334
- .lro(lroOptions)
335
- .operationsClient(opts);
230
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
336
231
  const createEvaluationResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.Evaluation');
337
232
  const createEvaluationMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.CreateEvaluationMetadata');
338
233
  this.descriptors.longrunning = {
339
- createEvaluation: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createEvaluationResponse.decode.bind(createEvaluationResponse), createEvaluationMetadata.decode.bind(createEvaluationMetadata)),
234
+ createEvaluation: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createEvaluationResponse.decode.bind(createEvaluationResponse), createEvaluationMetadata.decode.bind(createEvaluationMetadata))
340
235
  };
341
236
  // Put together the default options sent with requests.
342
237
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.EvaluationService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -365,19 +260,13 @@ class EvaluationServiceClient {
365
260
  }
366
261
  // Put together the "service stub" for
367
262
  // google.cloud.discoveryengine.v1beta.EvaluationService.
368
- this.evaluationServiceStub = this._gaxGrpc.createStub(this._opts.fallback
369
- ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.EvaluationService')
370
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
371
- this._protos.google.cloud.discoveryengine.v1beta
372
- .EvaluationService, this._opts, this._providedCustomServicePath);
263
+ this.evaluationServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
264
+ this._protos.lookupService('google.cloud.discoveryengine.v1beta.EvaluationService') :
265
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
266
+ this._protos.google.cloud.discoveryengine.v1beta.EvaluationService, this._opts, this._providedCustomServicePath);
373
267
  // Iterate over each of the methods that the service provides
374
268
  // and create an API call method for each.
375
- const evaluationServiceStubMethods = [
376
- 'getEvaluation',
377
- 'listEvaluations',
378
- 'createEvaluation',
379
- 'listEvaluationResults',
380
- ];
269
+ const evaluationServiceStubMethods = ['getEvaluation', 'listEvaluations', 'createEvaluation', 'listEvaluationResults'];
381
270
  for (const methodName of evaluationServiceStubMethods) {
382
271
  const callPromise = this.evaluationServiceStub.then(stub => (...args) => {
383
272
  if (this._terminated) {
@@ -402,8 +291,7 @@ class EvaluationServiceClient {
402
291
  * @returns {string} The DNS address for this service.
403
292
  */
404
293
  static get servicePath() {
405
- if (typeof process === 'object' &&
406
- typeof process.emitWarning === 'function') {
294
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
407
295
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
408
296
  }
409
297
  return 'discoveryengine.googleapis.com';
@@ -414,8 +302,7 @@ class EvaluationServiceClient {
414
302
  * @returns {string} The DNS address for this service.
415
303
  */
416
304
  static get apiEndpoint() {
417
- if (typeof process === 'object' &&
418
- typeof process.emitWarning === 'function') {
305
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
419
306
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
420
307
  }
421
308
  return 'discoveryengine.googleapis.com';
@@ -443,7 +330,9 @@ class EvaluationServiceClient {
443
330
  * @returns {string[]} List of default scopes.
444
331
  */
445
332
  static get scopes() {
446
- return ['https://www.googleapis.com/auth/cloud-platform'];
333
+ return [
334
+ 'https://www.googleapis.com/auth/cloud-platform'
335
+ ];
447
336
  }
448
337
  /**
449
338
  * Return the project ID used by this class.
@@ -469,13 +358,10 @@ class EvaluationServiceClient {
469
358
  options = options || {};
470
359
  options.otherArgs = options.otherArgs || {};
471
360
  options.otherArgs.headers = options.otherArgs.headers || {};
472
- options.otherArgs.headers['x-goog-request-params'] =
473
- this._gaxModule.routingHeader.fromParams({
474
- name: request.name ?? '',
475
- });
476
- this.initialize().catch(err => {
477
- throw err;
361
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
362
+ 'name': request.name ?? '',
478
363
  });
364
+ this.initialize().catch(err => { throw err; });
479
365
  this._log.info('getEvaluation request %j', request);
480
366
  const wrappedCallback = callback
481
367
  ? (error, response, options, rawResponse) => {
@@ -483,8 +369,7 @@ class EvaluationServiceClient {
483
369
  callback(error, response, options, rawResponse); // We verified callback above.
484
370
  }
485
371
  : undefined;
486
- return this.innerApiCalls
487
- .getEvaluation(request, options, wrappedCallback)
372
+ return this.innerApiCalls.getEvaluation(request, options, wrappedCallback)
488
373
  ?.then(([response, options, rawResponse]) => {
489
374
  this._log.info('getEvaluation response %j', response);
490
375
  return [response, options, rawResponse];
@@ -503,13 +388,10 @@ class EvaluationServiceClient {
503
388
  options = options || {};
504
389
  options.otherArgs = options.otherArgs || {};
505
390
  options.otherArgs.headers = options.otherArgs.headers || {};
506
- options.otherArgs.headers['x-goog-request-params'] =
507
- this._gaxModule.routingHeader.fromParams({
508
- parent: request.parent ?? '',
509
- });
510
- this.initialize().catch(err => {
511
- throw err;
391
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
392
+ 'parent': request.parent ?? '',
512
393
  });
394
+ this.initialize().catch(err => { throw err; });
513
395
  const wrappedCallback = callback
514
396
  ? (error, response, rawResponse, _) => {
515
397
  this._log.info('createEvaluation response %j', rawResponse);
@@ -517,8 +399,7 @@ class EvaluationServiceClient {
517
399
  }
518
400
  : undefined;
519
401
  this._log.info('createEvaluation request %j', request);
520
- return this.innerApiCalls
521
- .createEvaluation(request, options, wrappedCallback)
402
+ return this.innerApiCalls.createEvaluation(request, options, wrappedCallback)
522
403
  ?.then(([response, rawResponse, _]) => {
523
404
  this._log.info('createEvaluation response %j', rawResponse);
524
405
  return [response, rawResponse, _];
@@ -555,13 +436,10 @@ class EvaluationServiceClient {
555
436
  options = options || {};
556
437
  options.otherArgs = options.otherArgs || {};
557
438
  options.otherArgs.headers = options.otherArgs.headers || {};
558
- options.otherArgs.headers['x-goog-request-params'] =
559
- this._gaxModule.routingHeader.fromParams({
560
- parent: request.parent ?? '',
561
- });
562
- this.initialize().catch(err => {
563
- throw err;
439
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
440
+ 'parent': request.parent ?? '',
564
441
  });
442
+ this.initialize().catch(err => { throw err; });
565
443
  const wrappedCallback = callback
566
444
  ? (error, values, nextPageRequest, rawResponse) => {
567
445
  this._log.info('listEvaluations values %j', values);
@@ -622,15 +500,12 @@ class EvaluationServiceClient {
622
500
  options = options || {};
623
501
  options.otherArgs = options.otherArgs || {};
624
502
  options.otherArgs.headers = options.otherArgs.headers || {};
625
- options.otherArgs.headers['x-goog-request-params'] =
626
- this._gaxModule.routingHeader.fromParams({
627
- parent: request.parent ?? '',
628
- });
503
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
504
+ 'parent': request.parent ?? '',
505
+ });
629
506
  const defaultCallSettings = this._defaults['listEvaluations'];
630
507
  const callSettings = defaultCallSettings.merge(options);
631
- this.initialize().catch(err => {
632
- throw err;
633
- });
508
+ this.initialize().catch(err => { throw err; });
634
509
  this._log.info('listEvaluations stream %j', request);
635
510
  return this.descriptors.page.listEvaluations.createStream(this.innerApiCalls.listEvaluations, request, callSettings);
636
511
  }
@@ -683,15 +558,12 @@ class EvaluationServiceClient {
683
558
  options = options || {};
684
559
  options.otherArgs = options.otherArgs || {};
685
560
  options.otherArgs.headers = options.otherArgs.headers || {};
686
- options.otherArgs.headers['x-goog-request-params'] =
687
- this._gaxModule.routingHeader.fromParams({
688
- parent: request.parent ?? '',
689
- });
561
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
562
+ 'parent': request.parent ?? '',
563
+ });
690
564
  const defaultCallSettings = this._defaults['listEvaluations'];
691
565
  const callSettings = defaultCallSettings.merge(options);
692
- this.initialize().catch(err => {
693
- throw err;
694
- });
566
+ this.initialize().catch(err => { throw err; });
695
567
  this._log.info('listEvaluations iterate %j', request);
696
568
  return this.descriptors.page.listEvaluations.asyncIterate(this.innerApiCalls['listEvaluations'], request, callSettings);
697
569
  }
@@ -708,13 +580,10 @@ class EvaluationServiceClient {
708
580
  options = options || {};
709
581
  options.otherArgs = options.otherArgs || {};
710
582
  options.otherArgs.headers = options.otherArgs.headers || {};
711
- options.otherArgs.headers['x-goog-request-params'] =
712
- this._gaxModule.routingHeader.fromParams({
713
- evaluation: request.evaluation ?? '',
714
- });
715
- this.initialize().catch(err => {
716
- throw err;
583
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
584
+ 'evaluation': request.evaluation ?? '',
717
585
  });
586
+ this.initialize().catch(err => { throw err; });
718
587
  const wrappedCallback = callback
719
588
  ? (error, values, nextPageRequest, rawResponse) => {
720
589
  this._log.info('listEvaluationResults values %j', values);
@@ -773,15 +642,12 @@ class EvaluationServiceClient {
773
642
  options = options || {};
774
643
  options.otherArgs = options.otherArgs || {};
775
644
  options.otherArgs.headers = options.otherArgs.headers || {};
776
- options.otherArgs.headers['x-goog-request-params'] =
777
- this._gaxModule.routingHeader.fromParams({
778
- evaluation: request.evaluation ?? '',
779
- });
645
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
646
+ 'evaluation': request.evaluation ?? '',
647
+ });
780
648
  const defaultCallSettings = this._defaults['listEvaluationResults'];
781
649
  const callSettings = defaultCallSettings.merge(options);
782
- this.initialize().catch(err => {
783
- throw err;
784
- });
650
+ this.initialize().catch(err => { throw err; });
785
651
  this._log.info('listEvaluationResults stream %j', request);
786
652
  return this.descriptors.page.listEvaluationResults.createStream(this.innerApiCalls.listEvaluationResults, request, callSettings);
787
653
  }
@@ -832,103 +698,100 @@ class EvaluationServiceClient {
832
698
  options = options || {};
833
699
  options.otherArgs = options.otherArgs || {};
834
700
  options.otherArgs.headers = options.otherArgs.headers || {};
835
- options.otherArgs.headers['x-goog-request-params'] =
836
- this._gaxModule.routingHeader.fromParams({
837
- evaluation: request.evaluation ?? '',
838
- });
701
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
702
+ 'evaluation': request.evaluation ?? '',
703
+ });
839
704
  const defaultCallSettings = this._defaults['listEvaluationResults'];
840
705
  const callSettings = defaultCallSettings.merge(options);
841
- this.initialize().catch(err => {
842
- throw err;
843
- });
706
+ this.initialize().catch(err => { throw err; });
844
707
  this._log.info('listEvaluationResults iterate %j', request);
845
708
  return this.descriptors.page.listEvaluationResults.asyncIterate(this.innerApiCalls['listEvaluationResults'], request, callSettings);
846
709
  }
847
710
  /**
848
- * Gets information about a location.
849
- *
850
- * @param {Object} request
851
- * The request object that will be sent.
852
- * @param {string} request.name
853
- * Resource name for the location.
854
- * @param {object} [options]
855
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
856
- * @returns {Promise} - The promise which resolves to an array.
857
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
858
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
859
- * for more details and examples.
860
- * @example
861
- * ```
862
- * const [response] = await client.getLocation(request);
863
- * ```
864
- */
711
+ * Gets information about a location.
712
+ *
713
+ * @param {Object} request
714
+ * The request object that will be sent.
715
+ * @param {string} request.name
716
+ * Resource name for the location.
717
+ * @param {object} [options]
718
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
719
+ * @returns {Promise} - The promise which resolves to an array.
720
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
721
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
722
+ * for more details and examples.
723
+ * @example
724
+ * ```
725
+ * const [response] = await client.getLocation(request);
726
+ * ```
727
+ */
865
728
  getLocation(request, options, callback) {
866
729
  return this.locationsClient.getLocation(request, options, callback);
867
730
  }
868
731
  /**
869
- * Lists information about the supported locations for this service. Returns an iterable object.
870
- *
871
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
872
- * @param {Object} request
873
- * The request object that will be sent.
874
- * @param {string} request.name
875
- * The resource that owns the locations collection, if applicable.
876
- * @param {string} request.filter
877
- * The standard list filter.
878
- * @param {number} request.pageSize
879
- * The standard list page size.
880
- * @param {string} request.pageToken
881
- * The standard list page token.
882
- * @param {object} [options]
883
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
884
- * @returns {Object}
885
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
886
- * When you iterate the returned iterable, each element will be an object representing
887
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
888
- * so you can stop the iteration when you don't need more results.
889
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
890
- * for more details and examples.
891
- * @example
892
- * ```
893
- * const iterable = client.listLocationsAsync(request);
894
- * for await (const response of iterable) {
895
- * // process response
896
- * }
897
- * ```
898
- */
732
+ * Lists information about the supported locations for this service. Returns an iterable object.
733
+ *
734
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
735
+ * @param {Object} request
736
+ * The request object that will be sent.
737
+ * @param {string} request.name
738
+ * The resource that owns the locations collection, if applicable.
739
+ * @param {string} request.filter
740
+ * The standard list filter.
741
+ * @param {number} request.pageSize
742
+ * The standard list page size.
743
+ * @param {string} request.pageToken
744
+ * The standard list page token.
745
+ * @param {object} [options]
746
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
747
+ * @returns {Object}
748
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
749
+ * When you iterate the returned iterable, each element will be an object representing
750
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
751
+ * so you can stop the iteration when you don't need more results.
752
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
753
+ * for more details and examples.
754
+ * @example
755
+ * ```
756
+ * const iterable = client.listLocationsAsync(request);
757
+ * for await (const response of iterable) {
758
+ * // process response
759
+ * }
760
+ * ```
761
+ */
899
762
  listLocationsAsync(request, options) {
900
763
  return this.locationsClient.listLocationsAsync(request, options);
901
764
  }
902
765
  /**
903
- * Gets the latest state of a long-running operation. Clients can use this
904
- * method to poll the operation result at intervals as recommended by the API
905
- * service.
906
- *
907
- * @param {Object} request - The request object that will be sent.
908
- * @param {string} request.name - The name of the operation resource.
909
- * @param {Object=} options
910
- * Optional parameters. You can override the default settings for this call,
911
- * e.g, timeout, retries, paginations, etc. See {@link
912
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
913
- * for the details.
914
- * @param {function(?Error, ?Object)=} callback
915
- * The function which will be called with the result of the API call.
916
- *
917
- * The second parameter to the callback is an object representing
918
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
919
- * @return {Promise} - The promise which resolves to an array.
920
- * The first element of the array is an object representing
921
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
922
- * The promise has a method named "cancel" which cancels the ongoing API call.
923
- *
924
- * @example
925
- * ```
926
- * const client = longrunning.operationsClient();
927
- * const name = '';
928
- * const [response] = await client.getOperation({name});
929
- * // doThingsWith(response)
930
- * ```
931
- */
766
+ * Gets the latest state of a long-running operation. Clients can use this
767
+ * method to poll the operation result at intervals as recommended by the API
768
+ * service.
769
+ *
770
+ * @param {Object} request - The request object that will be sent.
771
+ * @param {string} request.name - The name of the operation resource.
772
+ * @param {Object=} options
773
+ * Optional parameters. You can override the default settings for this call,
774
+ * e.g, timeout, retries, paginations, etc. See {@link
775
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
776
+ * for the details.
777
+ * @param {function(?Error, ?Object)=} callback
778
+ * The function which will be called with the result of the API call.
779
+ *
780
+ * The second parameter to the callback is an object representing
781
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
782
+ * @return {Promise} - The promise which resolves to an array.
783
+ * The first element of the array is an object representing
784
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
785
+ * The promise has a method named "cancel" which cancels the ongoing API call.
786
+ *
787
+ * @example
788
+ * ```
789
+ * const client = longrunning.operationsClient();
790
+ * const name = '';
791
+ * const [response] = await client.getOperation({name});
792
+ * // doThingsWith(response)
793
+ * ```
794
+ */
932
795
  getOperation(request, optionsOrCallback, callback) {
933
796
  let options;
934
797
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1162,8 +1025,7 @@ class EvaluationServiceClient {
1162
1025
  * @returns {string} A string representing the project.
1163
1026
  */
1164
1027
  matchProjectFromEvaluationName(evaluationName) {
1165
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1166
- .project;
1028
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
1167
1029
  }
1168
1030
  /**
1169
1031
  * Parse the location from Evaluation resource.
@@ -1173,8 +1035,7 @@ class EvaluationServiceClient {
1173
1035
  * @returns {string} A string representing the location.
1174
1036
  */
1175
1037
  matchLocationFromEvaluationName(evaluationName) {
1176
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1177
- .location;
1038
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
1178
1039
  }
1179
1040
  /**
1180
1041
  * Parse the evaluation from Evaluation resource.
@@ -1184,8 +1045,7 @@ class EvaluationServiceClient {
1184
1045
  * @returns {string} A string representing the evaluation.
1185
1046
  */
1186
1047
  matchEvaluationFromEvaluationName(evaluationName) {
1187
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1188
- .evaluation;
1048
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
1189
1049
  }
1190
1050
  /**
1191
1051
  * Return a fully-qualified groundingConfig resource name string.
@@ -3456,8 +3316,7 @@ class EvaluationServiceClient {
3456
3316
  * @returns {string} A string representing the project.
3457
3317
  */
3458
3318
  matchProjectFromSampleQueryName(sampleQueryName) {
3459
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3460
- .project;
3319
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3461
3320
  }
3462
3321
  /**
3463
3322
  * Parse the location from SampleQuery resource.
@@ -3467,8 +3326,7 @@ class EvaluationServiceClient {
3467
3326
  * @returns {string} A string representing the location.
3468
3327
  */
3469
3328
  matchLocationFromSampleQueryName(sampleQueryName) {
3470
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3471
- .location;
3329
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3472
3330
  }
3473
3331
  /**
3474
3332
  * Parse the sample_query_set from SampleQuery resource.
@@ -3478,8 +3336,7 @@ class EvaluationServiceClient {
3478
3336
  * @returns {string} A string representing the sample_query_set.
3479
3337
  */
3480
3338
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3481
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3482
- .sample_query_set;
3339
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3483
3340
  }
3484
3341
  /**
3485
3342
  * Parse the sample_query from SampleQuery resource.
@@ -3489,8 +3346,7 @@ class EvaluationServiceClient {
3489
3346
  * @returns {string} A string representing the sample_query.
3490
3347
  */
3491
3348
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3492
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3493
- .sample_query;
3349
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3494
3350
  }
3495
3351
  /**
3496
3352
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3549,8 +3405,8 @@ class EvaluationServiceClient {
3549
3405
  this._log.info('ending gRPC channel');
3550
3406
  this._terminated = true;
3551
3407
  stub.close();
3552
- this.locationsClient.close();
3553
- this.operationsClient.close();
3408
+ this.locationsClient.close().catch(err => { throw err; });
3409
+ void this.operationsClient.close();
3554
3410
  });
3555
3411
  }
3556
3412
  return Promise.resolve();