@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
  }
@@ -213,7 +206,7 @@ class SampleQuerySetServiceClient {
213
206
  // (e.g. 50 results at a time, with tokens to get subsequent
214
207
  // pages). Denote the keys used for pagination and results.
215
208
  this.descriptors.page = {
216
- listSampleQuerySets: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sampleQuerySets'),
209
+ listSampleQuerySets: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sampleQuerySets')
217
210
  };
218
211
  // Put together the default options sent with requests.
219
212
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1alpha.SampleQuerySetService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -242,20 +235,13 @@ class SampleQuerySetServiceClient {
242
235
  }
243
236
  // Put together the "service stub" for
244
237
  // google.cloud.discoveryengine.v1alpha.SampleQuerySetService.
245
- this.sampleQuerySetServiceStub = this._gaxGrpc.createStub(this._opts.fallback
246
- ? this._protos.lookupService('google.cloud.discoveryengine.v1alpha.SampleQuerySetService')
247
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
248
- this._protos.google.cloud.discoveryengine.v1alpha
249
- .SampleQuerySetService, this._opts, this._providedCustomServicePath);
238
+ this.sampleQuerySetServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
239
+ this._protos.lookupService('google.cloud.discoveryengine.v1alpha.SampleQuerySetService') :
240
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
241
+ this._protos.google.cloud.discoveryengine.v1alpha.SampleQuerySetService, this._opts, this._providedCustomServicePath);
250
242
  // Iterate over each of the methods that the service provides
251
243
  // and create an API call method for each.
252
- const sampleQuerySetServiceStubMethods = [
253
- 'getSampleQuerySet',
254
- 'listSampleQuerySets',
255
- 'createSampleQuerySet',
256
- 'updateSampleQuerySet',
257
- 'deleteSampleQuerySet',
258
- ];
244
+ const sampleQuerySetServiceStubMethods = ['getSampleQuerySet', 'listSampleQuerySets', 'createSampleQuerySet', 'updateSampleQuerySet', 'deleteSampleQuerySet'];
259
245
  for (const methodName of sampleQuerySetServiceStubMethods) {
260
246
  const callPromise = this.sampleQuerySetServiceStub.then(stub => (...args) => {
261
247
  if (this._terminated) {
@@ -266,7 +252,8 @@ class SampleQuerySetServiceClient {
266
252
  }, (err) => () => {
267
253
  throw err;
268
254
  });
269
- const descriptor = this.descriptors.page[methodName] || undefined;
255
+ const descriptor = this.descriptors.page[methodName] ||
256
+ undefined;
270
257
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
271
258
  this.innerApiCalls[methodName] = apiCall;
272
259
  }
@@ -278,8 +265,7 @@ class SampleQuerySetServiceClient {
278
265
  * @returns {string} The DNS address for this service.
279
266
  */
280
267
  static get servicePath() {
281
- if (typeof process === 'object' &&
282
- typeof process.emitWarning === 'function') {
268
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
283
269
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
284
270
  }
285
271
  return 'discoveryengine.googleapis.com';
@@ -290,8 +276,7 @@ class SampleQuerySetServiceClient {
290
276
  * @returns {string} The DNS address for this service.
291
277
  */
292
278
  static get apiEndpoint() {
293
- if (typeof process === 'object' &&
294
- typeof process.emitWarning === 'function') {
279
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
295
280
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
296
281
  }
297
282
  return 'discoveryengine.googleapis.com';
@@ -319,7 +304,9 @@ class SampleQuerySetServiceClient {
319
304
  * @returns {string[]} List of default scopes.
320
305
  */
321
306
  static get scopes() {
322
- return ['https://www.googleapis.com/auth/cloud-platform'];
307
+ return [
308
+ 'https://www.googleapis.com/auth/cloud-platform'
309
+ ];
323
310
  }
324
311
  /**
325
312
  * Return the project ID used by this class.
@@ -345,13 +332,10 @@ class SampleQuerySetServiceClient {
345
332
  options = options || {};
346
333
  options.otherArgs = options.otherArgs || {};
347
334
  options.otherArgs.headers = options.otherArgs.headers || {};
348
- options.otherArgs.headers['x-goog-request-params'] =
349
- this._gaxModule.routingHeader.fromParams({
350
- name: request.name ?? '',
351
- });
352
- this.initialize().catch(err => {
353
- throw err;
335
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
336
+ 'name': request.name ?? '',
354
337
  });
338
+ this.initialize().catch(err => { throw err; });
355
339
  this._log.info('getSampleQuerySet request %j', request);
356
340
  const wrappedCallback = callback
357
341
  ? (error, response, options, rawResponse) => {
@@ -359,11 +343,16 @@ class SampleQuerySetServiceClient {
359
343
  callback(error, response, options, rawResponse); // We verified callback above.
360
344
  }
361
345
  : undefined;
362
- return this.innerApiCalls
363
- .getSampleQuerySet(request, options, wrappedCallback)
346
+ return this.innerApiCalls.getSampleQuerySet(request, options, wrappedCallback)
364
347
  ?.then(([response, options, rawResponse]) => {
365
348
  this._log.info('getSampleQuerySet response %j', response);
366
349
  return [response, options, rawResponse];
350
+ }).catch((error) => {
351
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
352
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
353
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
354
+ }
355
+ throw error;
367
356
  });
368
357
  }
369
358
  createSampleQuerySet(request, optionsOrCallback, callback) {
@@ -379,13 +368,10 @@ class SampleQuerySetServiceClient {
379
368
  options = options || {};
380
369
  options.otherArgs = options.otherArgs || {};
381
370
  options.otherArgs.headers = options.otherArgs.headers || {};
382
- options.otherArgs.headers['x-goog-request-params'] =
383
- this._gaxModule.routingHeader.fromParams({
384
- parent: request.parent ?? '',
385
- });
386
- this.initialize().catch(err => {
387
- throw err;
371
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
372
+ 'parent': request.parent ?? '',
388
373
  });
374
+ this.initialize().catch(err => { throw err; });
389
375
  this._log.info('createSampleQuerySet request %j', request);
390
376
  const wrappedCallback = callback
391
377
  ? (error, response, options, rawResponse) => {
@@ -393,11 +379,16 @@ class SampleQuerySetServiceClient {
393
379
  callback(error, response, options, rawResponse); // We verified callback above.
394
380
  }
395
381
  : undefined;
396
- return this.innerApiCalls
397
- .createSampleQuerySet(request, options, wrappedCallback)
382
+ return this.innerApiCalls.createSampleQuerySet(request, options, wrappedCallback)
398
383
  ?.then(([response, options, rawResponse]) => {
399
384
  this._log.info('createSampleQuerySet response %j', response);
400
385
  return [response, options, rawResponse];
386
+ }).catch((error) => {
387
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
388
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
389
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
390
+ }
391
+ throw error;
401
392
  });
402
393
  }
403
394
  updateSampleQuerySet(request, optionsOrCallback, callback) {
@@ -413,13 +404,10 @@ class SampleQuerySetServiceClient {
413
404
  options = options || {};
414
405
  options.otherArgs = options.otherArgs || {};
415
406
  options.otherArgs.headers = options.otherArgs.headers || {};
416
- options.otherArgs.headers['x-goog-request-params'] =
417
- this._gaxModule.routingHeader.fromParams({
418
- 'sample_query_set.name': request.sampleQuerySet.name ?? '',
419
- });
420
- this.initialize().catch(err => {
421
- throw err;
407
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
408
+ 'sample_query_set.name': request.sampleQuerySet.name ?? '',
422
409
  });
410
+ this.initialize().catch(err => { throw err; });
423
411
  this._log.info('updateSampleQuerySet request %j', request);
424
412
  const wrappedCallback = callback
425
413
  ? (error, response, options, rawResponse) => {
@@ -427,11 +415,16 @@ class SampleQuerySetServiceClient {
427
415
  callback(error, response, options, rawResponse); // We verified callback above.
428
416
  }
429
417
  : undefined;
430
- return this.innerApiCalls
431
- .updateSampleQuerySet(request, options, wrappedCallback)
418
+ return this.innerApiCalls.updateSampleQuerySet(request, options, wrappedCallback)
432
419
  ?.then(([response, options, rawResponse]) => {
433
420
  this._log.info('updateSampleQuerySet response %j', response);
434
421
  return [response, options, rawResponse];
422
+ }).catch((error) => {
423
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
424
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
425
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
426
+ }
427
+ throw error;
435
428
  });
436
429
  }
437
430
  deleteSampleQuerySet(request, optionsOrCallback, callback) {
@@ -447,13 +440,10 @@ class SampleQuerySetServiceClient {
447
440
  options = options || {};
448
441
  options.otherArgs = options.otherArgs || {};
449
442
  options.otherArgs.headers = options.otherArgs.headers || {};
450
- options.otherArgs.headers['x-goog-request-params'] =
451
- this._gaxModule.routingHeader.fromParams({
452
- name: request.name ?? '',
453
- });
454
- this.initialize().catch(err => {
455
- throw err;
443
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
444
+ 'name': request.name ?? '',
456
445
  });
446
+ this.initialize().catch(err => { throw err; });
457
447
  this._log.info('deleteSampleQuerySet request %j', request);
458
448
  const wrappedCallback = callback
459
449
  ? (error, response, options, rawResponse) => {
@@ -461,11 +451,16 @@ class SampleQuerySetServiceClient {
461
451
  callback(error, response, options, rawResponse); // We verified callback above.
462
452
  }
463
453
  : undefined;
464
- return this.innerApiCalls
465
- .deleteSampleQuerySet(request, options, wrappedCallback)
454
+ return this.innerApiCalls.deleteSampleQuerySet(request, options, wrappedCallback)
466
455
  ?.then(([response, options, rawResponse]) => {
467
456
  this._log.info('deleteSampleQuerySet response %j', response);
468
457
  return [response, options, rawResponse];
458
+ }).catch((error) => {
459
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
460
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
461
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
462
+ }
463
+ throw error;
469
464
  });
470
465
  }
471
466
  listSampleQuerySets(request, optionsOrCallback, callback) {
@@ -481,13 +476,10 @@ class SampleQuerySetServiceClient {
481
476
  options = options || {};
482
477
  options.otherArgs = options.otherArgs || {};
483
478
  options.otherArgs.headers = options.otherArgs.headers || {};
484
- options.otherArgs.headers['x-goog-request-params'] =
485
- this._gaxModule.routingHeader.fromParams({
486
- parent: request.parent ?? '',
487
- });
488
- this.initialize().catch(err => {
489
- throw err;
479
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
480
+ 'parent': request.parent ?? '',
490
481
  });
482
+ this.initialize().catch(err => { throw err; });
491
483
  const wrappedCallback = callback
492
484
  ? (error, values, nextPageRequest, rawResponse) => {
493
485
  this._log.info('listSampleQuerySets values %j', values);
@@ -548,15 +540,12 @@ class SampleQuerySetServiceClient {
548
540
  options = options || {};
549
541
  options.otherArgs = options.otherArgs || {};
550
542
  options.otherArgs.headers = options.otherArgs.headers || {};
551
- options.otherArgs.headers['x-goog-request-params'] =
552
- this._gaxModule.routingHeader.fromParams({
553
- parent: request.parent ?? '',
554
- });
543
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
544
+ 'parent': request.parent ?? '',
545
+ });
555
546
  const defaultCallSettings = this._defaults['listSampleQuerySets'];
556
547
  const callSettings = defaultCallSettings.merge(options);
557
- this.initialize().catch(err => {
558
- throw err;
559
- });
548
+ this.initialize().catch(err => { throw err; });
560
549
  this._log.info('listSampleQuerySets stream %j', request);
561
550
  return this.descriptors.page.listSampleQuerySets.createStream(this.innerApiCalls.listSampleQuerySets, request, callSettings);
562
551
  }
@@ -609,70 +598,67 @@ class SampleQuerySetServiceClient {
609
598
  options = options || {};
610
599
  options.otherArgs = options.otherArgs || {};
611
600
  options.otherArgs.headers = options.otherArgs.headers || {};
612
- options.otherArgs.headers['x-goog-request-params'] =
613
- this._gaxModule.routingHeader.fromParams({
614
- parent: request.parent ?? '',
615
- });
601
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
602
+ 'parent': request.parent ?? '',
603
+ });
616
604
  const defaultCallSettings = this._defaults['listSampleQuerySets'];
617
605
  const callSettings = defaultCallSettings.merge(options);
618
- this.initialize().catch(err => {
619
- throw err;
620
- });
606
+ this.initialize().catch(err => { throw err; });
621
607
  this._log.info('listSampleQuerySets iterate %j', request);
622
608
  return this.descriptors.page.listSampleQuerySets.asyncIterate(this.innerApiCalls['listSampleQuerySets'], request, callSettings);
623
609
  }
624
610
  /**
625
- * Gets information about a location.
626
- *
627
- * @param {Object} request
628
- * The request object that will be sent.
629
- * @param {string} request.name
630
- * Resource name for the location.
631
- * @param {object} [options]
632
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
633
- * @returns {Promise} - The promise which resolves to an array.
634
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
635
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
636
- * for more details and examples.
637
- * @example
638
- * ```
639
- * const [response] = await client.getLocation(request);
640
- * ```
641
- */
611
+ * Gets information about a location.
612
+ *
613
+ * @param {Object} request
614
+ * The request object that will be sent.
615
+ * @param {string} request.name
616
+ * Resource name for the location.
617
+ * @param {object} [options]
618
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
619
+ * @returns {Promise} - The promise which resolves to an array.
620
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
621
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
622
+ * for more details and examples.
623
+ * @example
624
+ * ```
625
+ * const [response] = await client.getLocation(request);
626
+ * ```
627
+ */
642
628
  getLocation(request, options, callback) {
643
629
  return this.locationsClient.getLocation(request, options, callback);
644
630
  }
645
631
  /**
646
- * Lists information about the supported locations for this service. Returns an iterable object.
647
- *
648
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
649
- * @param {Object} request
650
- * The request object that will be sent.
651
- * @param {string} request.name
652
- * The resource that owns the locations collection, if applicable.
653
- * @param {string} request.filter
654
- * The standard list filter.
655
- * @param {number} request.pageSize
656
- * The standard list page size.
657
- * @param {string} request.pageToken
658
- * The standard list page token.
659
- * @param {object} [options]
660
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
661
- * @returns {Object}
662
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
663
- * When you iterate the returned iterable, each element will be an object representing
664
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
665
- * so you can stop the iteration when you don't need more results.
666
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
667
- * for more details and examples.
668
- * @example
669
- * ```
670
- * const iterable = client.listLocationsAsync(request);
671
- * for await (const response of iterable) {
672
- * // process response
673
- * }
674
- * ```
675
- */
632
+ * Lists information about the supported locations for this service. Returns an iterable object.
633
+ *
634
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
635
+ * @param {Object} request
636
+ * The request object that will be sent.
637
+ * @param {string} request.name
638
+ * The resource that owns the locations collection, if applicable.
639
+ * @param {string} request.filter
640
+ * The standard list filter.
641
+ * @param {number} request.pageSize
642
+ * The standard list page size.
643
+ * @param {string} request.pageToken
644
+ * The standard list page token.
645
+ * @param {object} [options]
646
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
647
+ * @returns {Object}
648
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
649
+ * When you iterate the returned iterable, each element will be an object representing
650
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
651
+ * so you can stop the iteration when you don't need more results.
652
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
653
+ * for more details and examples.
654
+ * @example
655
+ * ```
656
+ * const iterable = client.listLocationsAsync(request);
657
+ * for await (const response of iterable) {
658
+ * // process response
659
+ * }
660
+ * ```
661
+ */
676
662
  listLocationsAsync(request, options) {
677
663
  return this.locationsClient.listLocationsAsync(request, options);
678
664
  }
@@ -700,8 +686,7 @@ class SampleQuerySetServiceClient {
700
686
  * @returns {string} A string representing the project.
701
687
  */
702
688
  matchProjectFromAclConfigName(aclConfigName) {
703
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
704
- .project;
689
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
705
690
  }
706
691
  /**
707
692
  * Parse the location from AclConfig resource.
@@ -711,8 +696,7 @@ class SampleQuerySetServiceClient {
711
696
  * @returns {string} A string representing the location.
712
697
  */
713
698
  matchLocationFromAclConfigName(aclConfigName) {
714
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
715
- .location;
699
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
716
700
  }
717
701
  /**
718
702
  * Return a fully-qualified engine resource name string.
@@ -794,8 +778,7 @@ class SampleQuerySetServiceClient {
794
778
  * @returns {string} A string representing the project.
795
779
  */
796
780
  matchProjectFromEvaluationName(evaluationName) {
797
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
798
- .project;
781
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
799
782
  }
800
783
  /**
801
784
  * Parse the location from Evaluation resource.
@@ -805,8 +788,7 @@ class SampleQuerySetServiceClient {
805
788
  * @returns {string} A string representing the location.
806
789
  */
807
790
  matchLocationFromEvaluationName(evaluationName) {
808
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
809
- .location;
791
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
810
792
  }
811
793
  /**
812
794
  * Parse the evaluation from Evaluation resource.
@@ -816,8 +798,7 @@ class SampleQuerySetServiceClient {
816
798
  * @returns {string} A string representing the evaluation.
817
799
  */
818
800
  matchEvaluationFromEvaluationName(evaluationName) {
819
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
820
- .evaluation;
801
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
821
802
  }
822
803
  /**
823
804
  * Return a fully-qualified location resource name string.
@@ -2917,8 +2898,7 @@ class SampleQuerySetServiceClient {
2917
2898
  * @returns {string} A string representing the project.
2918
2899
  */
2919
2900
  matchProjectFromSampleQueryName(sampleQueryName) {
2920
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2921
- .project;
2901
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
2922
2902
  }
2923
2903
  /**
2924
2904
  * Parse the location from SampleQuery resource.
@@ -2928,8 +2908,7 @@ class SampleQuerySetServiceClient {
2928
2908
  * @returns {string} A string representing the location.
2929
2909
  */
2930
2910
  matchLocationFromSampleQueryName(sampleQueryName) {
2931
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2932
- .location;
2911
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
2933
2912
  }
2934
2913
  /**
2935
2914
  * Parse the sample_query_set from SampleQuery resource.
@@ -2939,8 +2918,7 @@ class SampleQuerySetServiceClient {
2939
2918
  * @returns {string} A string representing the sample_query_set.
2940
2919
  */
2941
2920
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
2942
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2943
- .sample_query_set;
2921
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
2944
2922
  }
2945
2923
  /**
2946
2924
  * Parse the sample_query from SampleQuery resource.
@@ -2950,8 +2928,7 @@ class SampleQuerySetServiceClient {
2950
2928
  * @returns {string} A string representing the sample_query.
2951
2929
  */
2952
2930
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
2953
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2954
- .sample_query;
2931
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
2955
2932
  }
2956
2933
  /**
2957
2934
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3010,7 +2987,7 @@ class SampleQuerySetServiceClient {
3010
2987
  this._log.info('ending gRPC channel');
3011
2988
  this._terminated = true;
3012
2989
  stub.close();
3013
- this.locationsClient.close();
2990
+ this.locationsClient.close().catch(err => { throw err; });
3014
2991
  });
3015
2992
  }
3016
2993
  return Promise.resolve();