@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
@@ -97,28 +97,18 @@ class SampleQuerySetServiceClient {
97
97
  */
98
98
  constructor(opts, gaxInstance) {
99
99
  // Ensure that options include all the required fields.
100
- const staticMembers = this
101
- .constructor;
102
- if (opts?.universe_domain &&
103
- opts?.universeDomain &&
104
- opts?.universe_domain !== opts?.universeDomain) {
100
+ const staticMembers = this.constructor;
101
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
105
102
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
106
103
  }
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';
104
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
105
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
115
106
  this._servicePath = 'discoveryengine.' + this._universeDomain;
116
107
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
117
108
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
118
109
  const port = opts?.port || staticMembers.port;
119
110
  const clientConfig = opts?.clientConfig ?? {};
120
- const fallback = opts?.fallback ??
121
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
111
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
122
112
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
123
113
  // Request numeric enum values if REST transport is used.
124
114
  opts.numericEnums = true;
@@ -148,7 +138,10 @@ class SampleQuerySetServiceClient {
148
138
  }
149
139
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
150
140
  // Determine the client header string.
151
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
141
+ const clientHeader = [
142
+ `gax/${this._gaxModule.version}`,
143
+ `gapic/${version}`,
144
+ ];
152
145
  if (typeof process === 'object' && 'versions' in process) {
153
146
  clientHeader.push(`gl-node/${process.versions.node}`);
154
147
  }
@@ -215,7 +208,7 @@ class SampleQuerySetServiceClient {
215
208
  // (e.g. 50 results at a time, with tokens to get subsequent
216
209
  // pages). Denote the keys used for pagination and results.
217
210
  this.descriptors.page = {
218
- listSampleQuerySets: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sampleQuerySets'),
211
+ listSampleQuerySets: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sampleQuerySets')
219
212
  };
220
213
  // Put together the default options sent with requests.
221
214
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.SampleQuerySetService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -244,20 +237,13 @@ class SampleQuerySetServiceClient {
244
237
  }
245
238
  // Put together the "service stub" for
246
239
  // google.cloud.discoveryengine.v1beta.SampleQuerySetService.
247
- this.sampleQuerySetServiceStub = this._gaxGrpc.createStub(this._opts.fallback
248
- ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.SampleQuerySetService')
249
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
250
- this._protos.google.cloud.discoveryengine.v1beta
251
- .SampleQuerySetService, this._opts, this._providedCustomServicePath);
240
+ this.sampleQuerySetServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
241
+ this._protos.lookupService('google.cloud.discoveryengine.v1beta.SampleQuerySetService') :
242
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
243
+ this._protos.google.cloud.discoveryengine.v1beta.SampleQuerySetService, this._opts, this._providedCustomServicePath);
252
244
  // Iterate over each of the methods that the service provides
253
245
  // and create an API call method for each.
254
- const sampleQuerySetServiceStubMethods = [
255
- 'getSampleQuerySet',
256
- 'listSampleQuerySets',
257
- 'createSampleQuerySet',
258
- 'updateSampleQuerySet',
259
- 'deleteSampleQuerySet',
260
- ];
246
+ const sampleQuerySetServiceStubMethods = ['getSampleQuerySet', 'listSampleQuerySets', 'createSampleQuerySet', 'updateSampleQuerySet', 'deleteSampleQuerySet'];
261
247
  for (const methodName of sampleQuerySetServiceStubMethods) {
262
248
  const callPromise = this.sampleQuerySetServiceStub.then(stub => (...args) => {
263
249
  if (this._terminated) {
@@ -268,7 +254,8 @@ class SampleQuerySetServiceClient {
268
254
  }, (err) => () => {
269
255
  throw err;
270
256
  });
271
- const descriptor = this.descriptors.page[methodName] || undefined;
257
+ const descriptor = this.descriptors.page[methodName] ||
258
+ undefined;
272
259
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
273
260
  this.innerApiCalls[methodName] = apiCall;
274
261
  }
@@ -280,8 +267,7 @@ class SampleQuerySetServiceClient {
280
267
  * @returns {string} The DNS address for this service.
281
268
  */
282
269
  static get servicePath() {
283
- if (typeof process === 'object' &&
284
- typeof process.emitWarning === 'function') {
270
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
285
271
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
286
272
  }
287
273
  return 'discoveryengine.googleapis.com';
@@ -292,8 +278,7 @@ class SampleQuerySetServiceClient {
292
278
  * @returns {string} The DNS address for this service.
293
279
  */
294
280
  static get apiEndpoint() {
295
- if (typeof process === 'object' &&
296
- typeof process.emitWarning === 'function') {
281
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
297
282
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
298
283
  }
299
284
  return 'discoveryengine.googleapis.com';
@@ -321,7 +306,9 @@ class SampleQuerySetServiceClient {
321
306
  * @returns {string[]} List of default scopes.
322
307
  */
323
308
  static get scopes() {
324
- return ['https://www.googleapis.com/auth/cloud-platform'];
309
+ return [
310
+ 'https://www.googleapis.com/auth/cloud-platform'
311
+ ];
325
312
  }
326
313
  /**
327
314
  * Return the project ID used by this class.
@@ -347,13 +334,10 @@ class SampleQuerySetServiceClient {
347
334
  options = options || {};
348
335
  options.otherArgs = options.otherArgs || {};
349
336
  options.otherArgs.headers = options.otherArgs.headers || {};
350
- options.otherArgs.headers['x-goog-request-params'] =
351
- this._gaxModule.routingHeader.fromParams({
352
- name: request.name ?? '',
353
- });
354
- this.initialize().catch(err => {
355
- throw err;
337
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
338
+ 'name': request.name ?? '',
356
339
  });
340
+ this.initialize().catch(err => { throw err; });
357
341
  this._log.info('getSampleQuerySet request %j', request);
358
342
  const wrappedCallback = callback
359
343
  ? (error, response, options, rawResponse) => {
@@ -361,11 +345,16 @@ class SampleQuerySetServiceClient {
361
345
  callback(error, response, options, rawResponse); // We verified callback above.
362
346
  }
363
347
  : undefined;
364
- return this.innerApiCalls
365
- .getSampleQuerySet(request, options, wrappedCallback)
348
+ return this.innerApiCalls.getSampleQuerySet(request, options, wrappedCallback)
366
349
  ?.then(([response, options, rawResponse]) => {
367
350
  this._log.info('getSampleQuerySet response %j', response);
368
351
  return [response, options, rawResponse];
352
+ }).catch((error) => {
353
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
354
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
355
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
356
+ }
357
+ throw error;
369
358
  });
370
359
  }
371
360
  createSampleQuerySet(request, optionsOrCallback, callback) {
@@ -381,13 +370,10 @@ class SampleQuerySetServiceClient {
381
370
  options = options || {};
382
371
  options.otherArgs = options.otherArgs || {};
383
372
  options.otherArgs.headers = options.otherArgs.headers || {};
384
- options.otherArgs.headers['x-goog-request-params'] =
385
- this._gaxModule.routingHeader.fromParams({
386
- parent: request.parent ?? '',
387
- });
388
- this.initialize().catch(err => {
389
- throw err;
373
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
374
+ 'parent': request.parent ?? '',
390
375
  });
376
+ this.initialize().catch(err => { throw err; });
391
377
  this._log.info('createSampleQuerySet request %j', request);
392
378
  const wrappedCallback = callback
393
379
  ? (error, response, options, rawResponse) => {
@@ -395,11 +381,16 @@ class SampleQuerySetServiceClient {
395
381
  callback(error, response, options, rawResponse); // We verified callback above.
396
382
  }
397
383
  : undefined;
398
- return this.innerApiCalls
399
- .createSampleQuerySet(request, options, wrappedCallback)
384
+ return this.innerApiCalls.createSampleQuerySet(request, options, wrappedCallback)
400
385
  ?.then(([response, options, rawResponse]) => {
401
386
  this._log.info('createSampleQuerySet response %j', response);
402
387
  return [response, options, rawResponse];
388
+ }).catch((error) => {
389
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
390
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
391
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
392
+ }
393
+ throw error;
403
394
  });
404
395
  }
405
396
  updateSampleQuerySet(request, optionsOrCallback, callback) {
@@ -415,13 +406,10 @@ class SampleQuerySetServiceClient {
415
406
  options = options || {};
416
407
  options.otherArgs = options.otherArgs || {};
417
408
  options.otherArgs.headers = options.otherArgs.headers || {};
418
- options.otherArgs.headers['x-goog-request-params'] =
419
- this._gaxModule.routingHeader.fromParams({
420
- 'sample_query_set.name': request.sampleQuerySet.name ?? '',
421
- });
422
- this.initialize().catch(err => {
423
- throw err;
409
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
410
+ 'sample_query_set.name': request.sampleQuerySet.name ?? '',
424
411
  });
412
+ this.initialize().catch(err => { throw err; });
425
413
  this._log.info('updateSampleQuerySet request %j', request);
426
414
  const wrappedCallback = callback
427
415
  ? (error, response, options, rawResponse) => {
@@ -429,11 +417,16 @@ class SampleQuerySetServiceClient {
429
417
  callback(error, response, options, rawResponse); // We verified callback above.
430
418
  }
431
419
  : undefined;
432
- return this.innerApiCalls
433
- .updateSampleQuerySet(request, options, wrappedCallback)
420
+ return this.innerApiCalls.updateSampleQuerySet(request, options, wrappedCallback)
434
421
  ?.then(([response, options, rawResponse]) => {
435
422
  this._log.info('updateSampleQuerySet response %j', response);
436
423
  return [response, options, rawResponse];
424
+ }).catch((error) => {
425
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
426
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
427
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
428
+ }
429
+ throw error;
437
430
  });
438
431
  }
439
432
  deleteSampleQuerySet(request, optionsOrCallback, callback) {
@@ -449,13 +442,10 @@ class SampleQuerySetServiceClient {
449
442
  options = options || {};
450
443
  options.otherArgs = options.otherArgs || {};
451
444
  options.otherArgs.headers = options.otherArgs.headers || {};
452
- options.otherArgs.headers['x-goog-request-params'] =
453
- this._gaxModule.routingHeader.fromParams({
454
- name: request.name ?? '',
455
- });
456
- this.initialize().catch(err => {
457
- throw err;
445
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
446
+ 'name': request.name ?? '',
458
447
  });
448
+ this.initialize().catch(err => { throw err; });
459
449
  this._log.info('deleteSampleQuerySet request %j', request);
460
450
  const wrappedCallback = callback
461
451
  ? (error, response, options, rawResponse) => {
@@ -463,11 +453,16 @@ class SampleQuerySetServiceClient {
463
453
  callback(error, response, options, rawResponse); // We verified callback above.
464
454
  }
465
455
  : undefined;
466
- return this.innerApiCalls
467
- .deleteSampleQuerySet(request, options, wrappedCallback)
456
+ return this.innerApiCalls.deleteSampleQuerySet(request, options, wrappedCallback)
468
457
  ?.then(([response, options, rawResponse]) => {
469
458
  this._log.info('deleteSampleQuerySet response %j', response);
470
459
  return [response, options, rawResponse];
460
+ }).catch((error) => {
461
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
462
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
463
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
464
+ }
465
+ throw error;
471
466
  });
472
467
  }
473
468
  listSampleQuerySets(request, optionsOrCallback, callback) {
@@ -483,13 +478,10 @@ class SampleQuerySetServiceClient {
483
478
  options = options || {};
484
479
  options.otherArgs = options.otherArgs || {};
485
480
  options.otherArgs.headers = options.otherArgs.headers || {};
486
- options.otherArgs.headers['x-goog-request-params'] =
487
- this._gaxModule.routingHeader.fromParams({
488
- parent: request.parent ?? '',
489
- });
490
- this.initialize().catch(err => {
491
- throw err;
481
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
482
+ 'parent': request.parent ?? '',
492
483
  });
484
+ this.initialize().catch(err => { throw err; });
493
485
  const wrappedCallback = callback
494
486
  ? (error, values, nextPageRequest, rawResponse) => {
495
487
  this._log.info('listSampleQuerySets values %j', values);
@@ -550,15 +542,12 @@ class SampleQuerySetServiceClient {
550
542
  options = options || {};
551
543
  options.otherArgs = options.otherArgs || {};
552
544
  options.otherArgs.headers = options.otherArgs.headers || {};
553
- options.otherArgs.headers['x-goog-request-params'] =
554
- this._gaxModule.routingHeader.fromParams({
555
- parent: request.parent ?? '',
556
- });
545
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
546
+ 'parent': request.parent ?? '',
547
+ });
557
548
  const defaultCallSettings = this._defaults['listSampleQuerySets'];
558
549
  const callSettings = defaultCallSettings.merge(options);
559
- this.initialize().catch(err => {
560
- throw err;
561
- });
550
+ this.initialize().catch(err => { throw err; });
562
551
  this._log.info('listSampleQuerySets stream %j', request);
563
552
  return this.descriptors.page.listSampleQuerySets.createStream(this.innerApiCalls.listSampleQuerySets, request, callSettings);
564
553
  }
@@ -611,70 +600,67 @@ class SampleQuerySetServiceClient {
611
600
  options = options || {};
612
601
  options.otherArgs = options.otherArgs || {};
613
602
  options.otherArgs.headers = options.otherArgs.headers || {};
614
- options.otherArgs.headers['x-goog-request-params'] =
615
- this._gaxModule.routingHeader.fromParams({
616
- parent: request.parent ?? '',
617
- });
603
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
604
+ 'parent': request.parent ?? '',
605
+ });
618
606
  const defaultCallSettings = this._defaults['listSampleQuerySets'];
619
607
  const callSettings = defaultCallSettings.merge(options);
620
- this.initialize().catch(err => {
621
- throw err;
622
- });
608
+ this.initialize().catch(err => { throw err; });
623
609
  this._log.info('listSampleQuerySets iterate %j', request);
624
610
  return this.descriptors.page.listSampleQuerySets.asyncIterate(this.innerApiCalls['listSampleQuerySets'], request, callSettings);
625
611
  }
626
612
  /**
627
- * Gets information about a location.
628
- *
629
- * @param {Object} request
630
- * The request object that will be sent.
631
- * @param {string} request.name
632
- * Resource name for the location.
633
- * @param {object} [options]
634
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
635
- * @returns {Promise} - The promise which resolves to an array.
636
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
637
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
638
- * for more details and examples.
639
- * @example
640
- * ```
641
- * const [response] = await client.getLocation(request);
642
- * ```
643
- */
613
+ * Gets information about a location.
614
+ *
615
+ * @param {Object} request
616
+ * The request object that will be sent.
617
+ * @param {string} request.name
618
+ * Resource name for the location.
619
+ * @param {object} [options]
620
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
621
+ * @returns {Promise} - The promise which resolves to an array.
622
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
623
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
624
+ * for more details and examples.
625
+ * @example
626
+ * ```
627
+ * const [response] = await client.getLocation(request);
628
+ * ```
629
+ */
644
630
  getLocation(request, options, callback) {
645
631
  return this.locationsClient.getLocation(request, options, callback);
646
632
  }
647
633
  /**
648
- * Lists information about the supported locations for this service. Returns an iterable object.
649
- *
650
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
651
- * @param {Object} request
652
- * The request object that will be sent.
653
- * @param {string} request.name
654
- * The resource that owns the locations collection, if applicable.
655
- * @param {string} request.filter
656
- * The standard list filter.
657
- * @param {number} request.pageSize
658
- * The standard list page size.
659
- * @param {string} request.pageToken
660
- * The standard list page token.
661
- * @param {object} [options]
662
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
663
- * @returns {Object}
664
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
665
- * When you iterate the returned iterable, each element will be an object representing
666
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
667
- * so you can stop the iteration when you don't need more results.
668
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
669
- * for more details and examples.
670
- * @example
671
- * ```
672
- * const iterable = client.listLocationsAsync(request);
673
- * for await (const response of iterable) {
674
- * // process response
675
- * }
676
- * ```
677
- */
634
+ * Lists information about the supported locations for this service. Returns an iterable object.
635
+ *
636
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
637
+ * @param {Object} request
638
+ * The request object that will be sent.
639
+ * @param {string} request.name
640
+ * The resource that owns the locations collection, if applicable.
641
+ * @param {string} request.filter
642
+ * The standard list filter.
643
+ * @param {number} request.pageSize
644
+ * The standard list page size.
645
+ * @param {string} request.pageToken
646
+ * The standard list page token.
647
+ * @param {object} [options]
648
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
649
+ * @returns {Object}
650
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
651
+ * When you iterate the returned iterable, each element will be an object representing
652
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
653
+ * so you can stop the iteration when you don't need more results.
654
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
655
+ * for more details and examples.
656
+ * @example
657
+ * ```
658
+ * const iterable = client.listLocationsAsync(request);
659
+ * for await (const response of iterable) {
660
+ * // process response
661
+ * }
662
+ * ```
663
+ */
678
664
  listLocationsAsync(request, options) {
679
665
  return this.locationsClient.listLocationsAsync(request, options);
680
666
  }
@@ -761,8 +747,7 @@ class SampleQuerySetServiceClient {
761
747
  * @returns {string} A string representing the project.
762
748
  */
763
749
  matchProjectFromEvaluationName(evaluationName) {
764
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
765
- .project;
750
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
766
751
  }
767
752
  /**
768
753
  * Parse the location from Evaluation resource.
@@ -772,8 +757,7 @@ class SampleQuerySetServiceClient {
772
757
  * @returns {string} A string representing the location.
773
758
  */
774
759
  matchLocationFromEvaluationName(evaluationName) {
775
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
776
- .location;
760
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
777
761
  }
778
762
  /**
779
763
  * Parse the evaluation from Evaluation resource.
@@ -783,8 +767,7 @@ class SampleQuerySetServiceClient {
783
767
  * @returns {string} A string representing the evaluation.
784
768
  */
785
769
  matchEvaluationFromEvaluationName(evaluationName) {
786
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
787
- .evaluation;
770
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
788
771
  }
789
772
  /**
790
773
  * Return a fully-qualified groundingConfig resource name string.
@@ -3055,8 +3038,7 @@ class SampleQuerySetServiceClient {
3055
3038
  * @returns {string} A string representing the project.
3056
3039
  */
3057
3040
  matchProjectFromSampleQueryName(sampleQueryName) {
3058
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3059
- .project;
3041
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3060
3042
  }
3061
3043
  /**
3062
3044
  * Parse the location from SampleQuery resource.
@@ -3066,8 +3048,7 @@ class SampleQuerySetServiceClient {
3066
3048
  * @returns {string} A string representing the location.
3067
3049
  */
3068
3050
  matchLocationFromSampleQueryName(sampleQueryName) {
3069
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3070
- .location;
3051
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3071
3052
  }
3072
3053
  /**
3073
3054
  * Parse the sample_query_set from SampleQuery resource.
@@ -3077,8 +3058,7 @@ class SampleQuerySetServiceClient {
3077
3058
  * @returns {string} A string representing the sample_query_set.
3078
3059
  */
3079
3060
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3080
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3081
- .sample_query_set;
3061
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3082
3062
  }
3083
3063
  /**
3084
3064
  * Parse the sample_query from SampleQuery resource.
@@ -3088,8 +3068,7 @@ class SampleQuerySetServiceClient {
3088
3068
  * @returns {string} A string representing the sample_query.
3089
3069
  */
3090
3070
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3091
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3092
- .sample_query;
3071
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3093
3072
  }
3094
3073
  /**
3095
3074
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3148,7 +3127,7 @@ class SampleQuerySetServiceClient {
3148
3127
  this._log.info('ending gRPC channel');
3149
3128
  this._terminated = true;
3150
3129
  stub.close();
3151
- this.locationsClient.close();
3130
+ this.locationsClient.close().catch(err => { throw err; });
3152
3131
  });
3153
3132
  }
3154
3133
  return Promise.resolve();