@google-cloud/discoveryengine 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/README.md +13 -0
  2. package/build/protos/google/cloud/discoveryengine/v1/answer.proto +17 -0
  3. package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +52 -0
  4. package/build/protos/google/cloud/discoveryengine/v1/cmek_config_service.proto +300 -0
  5. package/build/protos/google/cloud/discoveryengine/v1/common.proto +67 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/control.proto +1 -3
  7. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +3 -0
  8. package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +54 -2
  9. package/build/protos/google/cloud/discoveryengine/v1/data_store_service.proto +14 -0
  10. package/build/protos/google/cloud/discoveryengine/v1/document.proto +95 -4
  11. package/build/protos/google/cloud/discoveryengine/v1/document_processing_config.proto +28 -1
  12. package/build/protos/google/cloud/discoveryengine/v1/engine.proto +131 -6
  13. package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +8 -0
  14. package/build/protos/google/cloud/discoveryengine/v1/grounding.proto +9 -0
  15. package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store.proto +84 -0
  16. package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store_service.proto +375 -0
  17. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +6 -0
  18. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +6 -0
  19. package/build/protos/google/cloud/discoveryengine/v1/user_license.proto +98 -0
  20. package/build/protos/google/cloud/discoveryengine/v1/user_license_service.proto +191 -0
  21. package/build/protos/protos.d.ts +5415 -578
  22. package/build/protos/protos.js +77830 -63391
  23. package/build/protos/protos.json +1537 -92
  24. package/build/src/index.d.ts +10 -1
  25. package/build/src/index.js +8 -22
  26. package/build/src/v1/cmek_config_service_client.d.ts +2287 -0
  27. package/build/src/v1/cmek_config_service_client.js +3274 -0
  28. package/build/src/v1/cmek_config_service_client_config.json +42 -0
  29. package/build/src/v1/cmek_config_service_proto_list.json +44 -0
  30. package/build/src/v1/completion_service_client.d.ts +166 -76
  31. package/build/src/v1/completion_service_client.js +258 -263
  32. package/build/src/v1/completion_service_proto_list.json +6 -1
  33. package/build/src/v1/control_service_client.d.ts +171 -81
  34. package/build/src/v1/control_service_client.js +246 -132
  35. package/build/src/v1/control_service_proto_list.json +6 -1
  36. package/build/src/v1/conversational_search_service_client.d.ts +233 -143
  37. package/build/src/v1/conversational_search_service_client.js +330 -226
  38. package/build/src/v1/conversational_search_service_proto_list.json +6 -1
  39. package/build/src/v1/data_store_service_client.d.ts +218 -122
  40. package/build/src/v1/data_store_service_client.js +273 -281
  41. package/build/src/v1/data_store_service_proto_list.json +6 -1
  42. package/build/src/v1/document_service_client.d.ts +210 -120
  43. package/build/src/v1/document_service_client.js +300 -301
  44. package/build/src/v1/document_service_proto_list.json +6 -1
  45. package/build/src/v1/engine_service_client.d.ts +193 -103
  46. package/build/src/v1/engine_service_client.js +273 -280
  47. package/build/src/v1/engine_service_proto_list.json +6 -1
  48. package/build/src/v1/gapic_metadata.json +184 -0
  49. package/build/src/v1/grounded_generation_service_client.d.ts +138 -48
  50. package/build/src/v1/grounded_generation_service_client.js +217 -100
  51. package/build/src/v1/grounded_generation_service_proto_list.json +6 -1
  52. package/build/src/v1/identity_mapping_store_service_client.d.ts +2470 -0
  53. package/build/src/v1/identity_mapping_store_service_client.js +3449 -0
  54. package/build/src/v1/identity_mapping_store_service_client_config.json +54 -0
  55. package/build/src/v1/identity_mapping_store_service_proto_list.json +44 -0
  56. package/build/src/v1/index.d.ts +3 -0
  57. package/build/src/v1/index.js +7 -1
  58. package/build/src/v1/project_service_client.d.ts +166 -76
  59. package/build/src/v1/project_service_client.js +235 -223
  60. package/build/src/v1/project_service_proto_list.json +6 -1
  61. package/build/src/v1/rank_service_client.d.ts +137 -47
  62. package/build/src/v1/rank_service_client.js +204 -85
  63. package/build/src/v1/rank_service_proto_list.json +6 -1
  64. package/build/src/v1/recommendation_service_client.d.ts +137 -47
  65. package/build/src/v1/recommendation_service_client.js +202 -82
  66. package/build/src/v1/recommendation_service_proto_list.json +6 -1
  67. package/build/src/v1/schema_service_client.d.ts +201 -111
  68. package/build/src/v1/schema_service_client.js +264 -274
  69. package/build/src/v1/schema_service_proto_list.json +6 -1
  70. package/build/src/v1/search_service_client.d.ts +661 -571
  71. package/build/src/v1/search_service_client.js +216 -113
  72. package/build/src/v1/search_service_proto_list.json +6 -1
  73. package/build/src/v1/search_tuning_service_client.d.ts +167 -77
  74. package/build/src/v1/search_tuning_service_client.js +246 -236
  75. package/build/src/v1/search_tuning_service_proto_list.json +6 -1
  76. package/build/src/v1/serving_config_service_client.d.ts +138 -48
  77. package/build/src/v1/serving_config_service_client.js +201 -80
  78. package/build/src/v1/serving_config_service_proto_list.json +6 -1
  79. package/build/src/v1/site_search_engine_service_client.d.ts +238 -148
  80. package/build/src/v1/site_search_engine_service_client.js +324 -379
  81. package/build/src/v1/site_search_engine_service_proto_list.json +6 -1
  82. package/build/src/v1/user_event_service_client.d.ts +167 -77
  83. package/build/src/v1/user_event_service_client.js +260 -254
  84. package/build/src/v1/user_event_service_proto_list.json +6 -1
  85. package/build/src/v1/user_license_service_client.d.ts +2256 -0
  86. package/build/src/v1/user_license_service_client.js +3194 -0
  87. package/build/src/v1/user_license_service_client_config.json +34 -0
  88. package/build/src/v1/user_license_service_proto_list.json +44 -0
  89. package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
  90. package/build/src/v1alpha/acl_config_service_client.js +94 -106
  91. package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
  92. package/build/src/v1alpha/chunk_service_client.js +98 -120
  93. package/build/src/v1alpha/completion_service_client.d.ts +77 -77
  94. package/build/src/v1alpha/completion_service_client.js +141 -281
  95. package/build/src/v1alpha/control_service_client.d.ts +85 -85
  96. package/build/src/v1alpha/control_service_client.js +129 -151
  97. package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
  98. package/build/src/v1alpha/conversational_search_service_client.js +211 -237
  99. package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
  100. package/build/src/v1alpha/data_store_service_client.js +176 -317
  101. package/build/src/v1alpha/document_service_client.d.ts +126 -126
  102. package/build/src/v1alpha/document_service_client.js +193 -329
  103. package/build/src/v1alpha/engine_service_client.d.ts +106 -106
  104. package/build/src/v1alpha/engine_service_client.js +180 -326
  105. package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
  106. package/build/src/v1alpha/estimate_billing_service_client.js +119 -244
  107. package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
  108. package/build/src/v1alpha/evaluation_service_client.js +150 -296
  109. package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
  110. package/build/src/v1alpha/grounded_generation_service_client.js +85 -100
  111. package/build/src/v1alpha/project_service_client.d.ts +78 -78
  112. package/build/src/v1alpha/project_service_client.js +139 -263
  113. package/build/src/v1alpha/rank_service_client.d.ts +47 -47
  114. package/build/src/v1alpha/rank_service_client.js +87 -104
  115. package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
  116. package/build/src/v1alpha/recommendation_service_client.js +85 -100
  117. package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
  118. package/build/src/v1alpha/sample_query_service_client.js +169 -302
  119. package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
  120. package/build/src/v1alpha/sample_query_set_service_client.js +130 -153
  121. package/build/src/v1alpha/schema_service_client.d.ts +112 -112
  122. package/build/src/v1alpha/schema_service_client.js +147 -293
  123. package/build/src/v1alpha/search_service_client.d.ts +327 -327
  124. package/build/src/v1alpha/search_service_client.js +88 -112
  125. package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
  126. package/build/src/v1alpha/search_tuning_service_client.js +129 -254
  127. package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
  128. package/build/src/v1alpha/serving_config_service_client.js +109 -133
  129. package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
  130. package/build/src/v1alpha/site_search_engine_service_client.js +203 -388
  131. package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
  132. package/build/src/v1alpha/user_event_service_client.js +143 -272
  133. package/build/src/v1beta/completion_service_client.d.ts +78 -78
  134. package/build/src/v1beta/completion_service_client.js +149 -280
  135. package/build/src/v1beta/control_service_client.d.ts +84 -84
  136. package/build/src/v1beta/control_service_client.js +127 -147
  137. package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
  138. package/build/src/v1beta/conversational_search_service_client.js +209 -233
  139. package/build/src/v1beta/data_store_service_client.d.ts +124 -124
  140. package/build/src/v1beta/data_store_service_client.js +154 -289
  141. package/build/src/v1beta/document_service_client.d.ts +124 -124
  142. package/build/src/v1beta/document_service_client.js +181 -310
  143. package/build/src/v1beta/engine_service_client.d.ts +106 -106
  144. package/build/src/v1beta/engine_service_client.js +178 -316
  145. package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
  146. package/build/src/v1beta/evaluation_service_client.js +148 -286
  147. package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
  148. package/build/src/v1beta/grounded_generation_service_client.js +98 -114
  149. package/build/src/v1beta/project_service_client.d.ts +76 -76
  150. package/build/src/v1beta/project_service_client.js +116 -232
  151. package/build/src/v1beta/rank_service_client.d.ts +47 -47
  152. package/build/src/v1beta/rank_service_client.js +85 -99
  153. package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
  154. package/build/src/v1beta/recommendation_service_client.js +83 -96
  155. package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
  156. package/build/src/v1beta/sample_query_service_client.js +167 -292
  157. package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
  158. package/build/src/v1beta/sample_query_set_service_client.js +128 -149
  159. package/build/src/v1beta/schema_service_client.d.ts +111 -111
  160. package/build/src/v1beta/schema_service_client.js +145 -283
  161. package/build/src/v1beta/search_service_client.d.ts +665 -665
  162. package/build/src/v1beta/search_service_client.js +97 -128
  163. package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
  164. package/build/src/v1beta/search_tuning_service_client.js +127 -244
  165. package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
  166. package/build/src/v1beta/serving_config_service_client.js +107 -129
  167. package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
  168. package/build/src/v1beta/site_search_engine_service_client.js +205 -387
  169. package/build/src/v1beta/user_event_service_client.d.ts +78 -78
  170. package/build/src/v1beta/user_event_service_client.js +141 -262
  171. package/package.json +7 -7
  172. package/CHANGELOG.md +0 -267
@@ -99,26 +99,17 @@ class EngineServiceClient {
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 EngineServiceClient {
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
  }
@@ -215,123 +209,24 @@ class EngineServiceClient {
215
209
  // (e.g. 50 results at a time, with tokens to get subsequent
216
210
  // pages). Denote the keys used for pagination and results.
217
211
  this.descriptors.page = {
218
- listEngines: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'engines'),
212
+ listEngines: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'engines')
219
213
  };
220
- const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
214
+ const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
221
215
  // This API contains "long-running operations", which return a
222
216
  // an Operation object that allows for tracking of the operation,
223
217
  // rather than holding a request open.
224
218
  const lroOptions = {
225
219
  auth: this.auth,
226
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
220
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
227
221
  };
228
222
  if (opts.fallback) {
229
223
  lroOptions.protoJson = protoFilesRoot;
230
- lroOptions.httpRules = [
231
- {
232
- selector: 'google.longrunning.Operations.CancelOperation',
233
- post: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
234
- body: '*',
235
- additional_bindings: [
236
- {
237
- post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
238
- body: '*',
239
- },
240
- ],
241
- },
242
- {
243
- selector: 'google.longrunning.Operations.GetOperation',
244
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
245
- additional_bindings: [
246
- {
247
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
248
- },
249
- {
250
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
251
- },
252
- {
253
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
254
- },
255
- {
256
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
257
- },
258
- {
259
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
260
- },
261
- {
262
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
263
- },
264
- {
265
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
266
- },
267
- {
268
- get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}',
269
- },
270
- {
271
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
272
- },
273
- {
274
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
275
- },
276
- {
277
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}',
278
- },
279
- {
280
- get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}',
281
- },
282
- { get: '/v1beta/{name=projects/*/locations/*/operations/*}' },
283
- {
284
- get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
285
- },
286
- { get: '/v1beta/{name=projects/*/operations/*}' },
287
- ],
288
- },
289
- {
290
- selector: 'google.longrunning.Operations.ListOperations',
291
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
292
- additional_bindings: [
293
- {
294
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
295
- },
296
- {
297
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
298
- },
299
- {
300
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
301
- },
302
- {
303
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
304
- },
305
- {
306
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
307
- },
308
- {
309
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
310
- },
311
- {
312
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations',
313
- },
314
- {
315
- get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations',
316
- },
317
- {
318
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
319
- },
320
- {
321
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
322
- },
323
- {
324
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations',
325
- },
326
- { get: '/v1beta/{name=projects/*/locations/*}/operations' },
327
- { get: '/v1beta/{name=projects/*}/operations' },
328
- ],
329
- },
330
- ];
224
+ 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: '*', }],
225
+ }, { 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/*}', }],
226
+ }, { 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', }],
227
+ }];
331
228
  }
332
- this.operationsClient = this._gaxModule
333
- .lro(lroOptions)
334
- .operationsClient(opts);
229
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
335
230
  const createEngineResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.Engine');
336
231
  const createEngineMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.CreateEngineMetadata');
337
232
  const deleteEngineResponse = protoFilesRoot.lookup('.google.protobuf.Empty');
@@ -341,7 +236,7 @@ class EngineServiceClient {
341
236
  this.descriptors.longrunning = {
342
237
  createEngine: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createEngineResponse.decode.bind(createEngineResponse), createEngineMetadata.decode.bind(createEngineMetadata)),
343
238
  deleteEngine: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteEngineResponse.decode.bind(deleteEngineResponse), deleteEngineMetadata.decode.bind(deleteEngineMetadata)),
344
- tuneEngine: new this._gaxModule.LongrunningDescriptor(this.operationsClient, tuneEngineResponse.decode.bind(tuneEngineResponse), tuneEngineMetadata.decode.bind(tuneEngineMetadata)),
239
+ tuneEngine: new this._gaxModule.LongrunningDescriptor(this.operationsClient, tuneEngineResponse.decode.bind(tuneEngineResponse), tuneEngineMetadata.decode.bind(tuneEngineMetadata))
345
240
  };
346
241
  // Put together the default options sent with requests.
347
242
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.EngineService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -370,23 +265,13 @@ class EngineServiceClient {
370
265
  }
371
266
  // Put together the "service stub" for
372
267
  // google.cloud.discoveryengine.v1beta.EngineService.
373
- this.engineServiceStub = this._gaxGrpc.createStub(this._opts.fallback
374
- ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.EngineService')
375
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
376
- this._protos.google.cloud.discoveryengine.v1beta
377
- .EngineService, this._opts, this._providedCustomServicePath);
268
+ this.engineServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
269
+ this._protos.lookupService('google.cloud.discoveryengine.v1beta.EngineService') :
270
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
271
+ this._protos.google.cloud.discoveryengine.v1beta.EngineService, this._opts, this._providedCustomServicePath);
378
272
  // Iterate over each of the methods that the service provides
379
273
  // and create an API call method for each.
380
- const engineServiceStubMethods = [
381
- 'createEngine',
382
- 'deleteEngine',
383
- 'updateEngine',
384
- 'getEngine',
385
- 'listEngines',
386
- 'pauseEngine',
387
- 'resumeEngine',
388
- 'tuneEngine',
389
- ];
274
+ const engineServiceStubMethods = ['createEngine', 'deleteEngine', 'updateEngine', 'getEngine', 'listEngines', 'pauseEngine', 'resumeEngine', 'tuneEngine'];
390
275
  for (const methodName of engineServiceStubMethods) {
391
276
  const callPromise = this.engineServiceStub.then(stub => (...args) => {
392
277
  if (this._terminated) {
@@ -411,8 +296,7 @@ class EngineServiceClient {
411
296
  * @returns {string} The DNS address for this service.
412
297
  */
413
298
  static get servicePath() {
414
- if (typeof process === 'object' &&
415
- typeof process.emitWarning === 'function') {
299
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
416
300
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
417
301
  }
418
302
  return 'discoveryengine.googleapis.com';
@@ -423,8 +307,7 @@ class EngineServiceClient {
423
307
  * @returns {string} The DNS address for this service.
424
308
  */
425
309
  static get apiEndpoint() {
426
- if (typeof process === 'object' &&
427
- typeof process.emitWarning === 'function') {
310
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
428
311
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
429
312
  }
430
313
  return 'discoveryengine.googleapis.com';
@@ -452,7 +335,9 @@ class EngineServiceClient {
452
335
  * @returns {string[]} List of default scopes.
453
336
  */
454
337
  static get scopes() {
455
- return ['https://www.googleapis.com/auth/cloud-platform'];
338
+ return [
339
+ 'https://www.googleapis.com/auth/cloud-platform'
340
+ ];
456
341
  }
457
342
  /**
458
343
  * Return the project ID used by this class.
@@ -478,13 +363,10 @@ class EngineServiceClient {
478
363
  options = options || {};
479
364
  options.otherArgs = options.otherArgs || {};
480
365
  options.otherArgs.headers = options.otherArgs.headers || {};
481
- options.otherArgs.headers['x-goog-request-params'] =
482
- this._gaxModule.routingHeader.fromParams({
483
- 'engine.name': request.engine.name ?? '',
484
- });
485
- this.initialize().catch(err => {
486
- throw err;
366
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
367
+ 'engine.name': request.engine.name ?? '',
487
368
  });
369
+ this.initialize().catch(err => { throw err; });
488
370
  this._log.info('updateEngine request %j', request);
489
371
  const wrappedCallback = callback
490
372
  ? (error, response, options, rawResponse) => {
@@ -492,11 +374,16 @@ class EngineServiceClient {
492
374
  callback(error, response, options, rawResponse); // We verified callback above.
493
375
  }
494
376
  : undefined;
495
- return this.innerApiCalls
496
- .updateEngine(request, options, wrappedCallback)
377
+ return this.innerApiCalls.updateEngine(request, options, wrappedCallback)
497
378
  ?.then(([response, options, rawResponse]) => {
498
379
  this._log.info('updateEngine response %j', response);
499
380
  return [response, options, rawResponse];
381
+ }).catch((error) => {
382
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
383
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
384
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
385
+ }
386
+ throw error;
500
387
  });
501
388
  }
502
389
  getEngine(request, optionsOrCallback, callback) {
@@ -512,13 +399,10 @@ class EngineServiceClient {
512
399
  options = options || {};
513
400
  options.otherArgs = options.otherArgs || {};
514
401
  options.otherArgs.headers = options.otherArgs.headers || {};
515
- options.otherArgs.headers['x-goog-request-params'] =
516
- this._gaxModule.routingHeader.fromParams({
517
- name: request.name ?? '',
518
- });
519
- this.initialize().catch(err => {
520
- throw err;
402
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
403
+ 'name': request.name ?? '',
521
404
  });
405
+ this.initialize().catch(err => { throw err; });
522
406
  this._log.info('getEngine request %j', request);
523
407
  const wrappedCallback = callback
524
408
  ? (error, response, options, rawResponse) => {
@@ -526,11 +410,16 @@ class EngineServiceClient {
526
410
  callback(error, response, options, rawResponse); // We verified callback above.
527
411
  }
528
412
  : undefined;
529
- return this.innerApiCalls
530
- .getEngine(request, options, wrappedCallback)
413
+ return this.innerApiCalls.getEngine(request, options, wrappedCallback)
531
414
  ?.then(([response, options, rawResponse]) => {
532
415
  this._log.info('getEngine response %j', response);
533
416
  return [response, options, rawResponse];
417
+ }).catch((error) => {
418
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
419
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
420
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
421
+ }
422
+ throw error;
534
423
  });
535
424
  }
536
425
  pauseEngine(request, optionsOrCallback, callback) {
@@ -546,13 +435,10 @@ class EngineServiceClient {
546
435
  options = options || {};
547
436
  options.otherArgs = options.otherArgs || {};
548
437
  options.otherArgs.headers = options.otherArgs.headers || {};
549
- options.otherArgs.headers['x-goog-request-params'] =
550
- this._gaxModule.routingHeader.fromParams({
551
- name: request.name ?? '',
552
- });
553
- this.initialize().catch(err => {
554
- throw err;
438
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
439
+ 'name': request.name ?? '',
555
440
  });
441
+ this.initialize().catch(err => { throw err; });
556
442
  this._log.info('pauseEngine request %j', request);
557
443
  const wrappedCallback = callback
558
444
  ? (error, response, options, rawResponse) => {
@@ -560,11 +446,16 @@ class EngineServiceClient {
560
446
  callback(error, response, options, rawResponse); // We verified callback above.
561
447
  }
562
448
  : undefined;
563
- return this.innerApiCalls
564
- .pauseEngine(request, options, wrappedCallback)
449
+ return this.innerApiCalls.pauseEngine(request, options, wrappedCallback)
565
450
  ?.then(([response, options, rawResponse]) => {
566
451
  this._log.info('pauseEngine response %j', response);
567
452
  return [response, options, rawResponse];
453
+ }).catch((error) => {
454
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
455
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
456
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
457
+ }
458
+ throw error;
568
459
  });
569
460
  }
570
461
  resumeEngine(request, optionsOrCallback, callback) {
@@ -580,13 +471,10 @@ class EngineServiceClient {
580
471
  options = options || {};
581
472
  options.otherArgs = options.otherArgs || {};
582
473
  options.otherArgs.headers = options.otherArgs.headers || {};
583
- options.otherArgs.headers['x-goog-request-params'] =
584
- this._gaxModule.routingHeader.fromParams({
585
- name: request.name ?? '',
586
- });
587
- this.initialize().catch(err => {
588
- throw err;
474
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
475
+ 'name': request.name ?? '',
589
476
  });
477
+ this.initialize().catch(err => { throw err; });
590
478
  this._log.info('resumeEngine request %j', request);
591
479
  const wrappedCallback = callback
592
480
  ? (error, response, options, rawResponse) => {
@@ -594,11 +482,16 @@ class EngineServiceClient {
594
482
  callback(error, response, options, rawResponse); // We verified callback above.
595
483
  }
596
484
  : undefined;
597
- return this.innerApiCalls
598
- .resumeEngine(request, options, wrappedCallback)
485
+ return this.innerApiCalls.resumeEngine(request, options, wrappedCallback)
599
486
  ?.then(([response, options, rawResponse]) => {
600
487
  this._log.info('resumeEngine response %j', response);
601
488
  return [response, options, rawResponse];
489
+ }).catch((error) => {
490
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
491
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
492
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
493
+ }
494
+ throw error;
602
495
  });
603
496
  }
604
497
  createEngine(request, optionsOrCallback, callback) {
@@ -614,13 +507,10 @@ class EngineServiceClient {
614
507
  options = options || {};
615
508
  options.otherArgs = options.otherArgs || {};
616
509
  options.otherArgs.headers = options.otherArgs.headers || {};
617
- options.otherArgs.headers['x-goog-request-params'] =
618
- this._gaxModule.routingHeader.fromParams({
619
- parent: request.parent ?? '',
620
- });
621
- this.initialize().catch(err => {
622
- throw err;
510
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
511
+ 'parent': request.parent ?? '',
623
512
  });
513
+ this.initialize().catch(err => { throw err; });
624
514
  const wrappedCallback = callback
625
515
  ? (error, response, rawResponse, _) => {
626
516
  this._log.info('createEngine response %j', rawResponse);
@@ -628,8 +518,7 @@ class EngineServiceClient {
628
518
  }
629
519
  : undefined;
630
520
  this._log.info('createEngine request %j', request);
631
- return this.innerApiCalls
632
- .createEngine(request, options, wrappedCallback)
521
+ return this.innerApiCalls.createEngine(request, options, wrappedCallback)
633
522
  ?.then(([response, rawResponse, _]) => {
634
523
  this._log.info('createEngine response %j', rawResponse);
635
524
  return [response, rawResponse, _];
@@ -666,13 +555,10 @@ class EngineServiceClient {
666
555
  options = options || {};
667
556
  options.otherArgs = options.otherArgs || {};
668
557
  options.otherArgs.headers = options.otherArgs.headers || {};
669
- options.otherArgs.headers['x-goog-request-params'] =
670
- this._gaxModule.routingHeader.fromParams({
671
- name: request.name ?? '',
672
- });
673
- this.initialize().catch(err => {
674
- throw err;
558
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
559
+ 'name': request.name ?? '',
675
560
  });
561
+ this.initialize().catch(err => { throw err; });
676
562
  const wrappedCallback = callback
677
563
  ? (error, response, rawResponse, _) => {
678
564
  this._log.info('deleteEngine response %j', rawResponse);
@@ -680,8 +566,7 @@ class EngineServiceClient {
680
566
  }
681
567
  : undefined;
682
568
  this._log.info('deleteEngine request %j', request);
683
- return this.innerApiCalls
684
- .deleteEngine(request, options, wrappedCallback)
569
+ return this.innerApiCalls.deleteEngine(request, options, wrappedCallback)
685
570
  ?.then(([response, rawResponse, _]) => {
686
571
  this._log.info('deleteEngine response %j', rawResponse);
687
572
  return [response, rawResponse, _];
@@ -718,13 +603,10 @@ class EngineServiceClient {
718
603
  options = options || {};
719
604
  options.otherArgs = options.otherArgs || {};
720
605
  options.otherArgs.headers = options.otherArgs.headers || {};
721
- options.otherArgs.headers['x-goog-request-params'] =
722
- this._gaxModule.routingHeader.fromParams({
723
- name: request.name ?? '',
724
- });
725
- this.initialize().catch(err => {
726
- throw err;
606
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
607
+ 'name': request.name ?? '',
727
608
  });
609
+ this.initialize().catch(err => { throw err; });
728
610
  const wrappedCallback = callback
729
611
  ? (error, response, rawResponse, _) => {
730
612
  this._log.info('tuneEngine response %j', rawResponse);
@@ -732,8 +614,7 @@ class EngineServiceClient {
732
614
  }
733
615
  : undefined;
734
616
  this._log.info('tuneEngine request %j', request);
735
- return this.innerApiCalls
736
- .tuneEngine(request, options, wrappedCallback)
617
+ return this.innerApiCalls.tuneEngine(request, options, wrappedCallback)
737
618
  ?.then(([response, rawResponse, _]) => {
738
619
  this._log.info('tuneEngine response %j', rawResponse);
739
620
  return [response, rawResponse, _];
@@ -770,13 +651,10 @@ class EngineServiceClient {
770
651
  options = options || {};
771
652
  options.otherArgs = options.otherArgs || {};
772
653
  options.otherArgs.headers = options.otherArgs.headers || {};
773
- options.otherArgs.headers['x-goog-request-params'] =
774
- this._gaxModule.routingHeader.fromParams({
775
- parent: request.parent ?? '',
776
- });
777
- this.initialize().catch(err => {
778
- throw err;
654
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
655
+ 'parent': request.parent ?? '',
779
656
  });
657
+ this.initialize().catch(err => { throw err; });
780
658
  const wrappedCallback = callback
781
659
  ? (error, values, nextPageRequest, rawResponse) => {
782
660
  this._log.info('listEngines values %j', values);
@@ -821,15 +699,12 @@ class EngineServiceClient {
821
699
  options = options || {};
822
700
  options.otherArgs = options.otherArgs || {};
823
701
  options.otherArgs.headers = options.otherArgs.headers || {};
824
- options.otherArgs.headers['x-goog-request-params'] =
825
- this._gaxModule.routingHeader.fromParams({
826
- parent: request.parent ?? '',
827
- });
702
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
703
+ 'parent': request.parent ?? '',
704
+ });
828
705
  const defaultCallSettings = this._defaults['listEngines'];
829
706
  const callSettings = defaultCallSettings.merge(options);
830
- this.initialize().catch(err => {
831
- throw err;
832
- });
707
+ this.initialize().catch(err => { throw err; });
833
708
  this._log.info('listEngines stream %j', request);
834
709
  return this.descriptors.page.listEngines.createStream(this.innerApiCalls.listEngines, request, callSettings);
835
710
  }
@@ -866,103 +741,100 @@ class EngineServiceClient {
866
741
  options = options || {};
867
742
  options.otherArgs = options.otherArgs || {};
868
743
  options.otherArgs.headers = options.otherArgs.headers || {};
869
- options.otherArgs.headers['x-goog-request-params'] =
870
- this._gaxModule.routingHeader.fromParams({
871
- parent: request.parent ?? '',
872
- });
744
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
745
+ 'parent': request.parent ?? '',
746
+ });
873
747
  const defaultCallSettings = this._defaults['listEngines'];
874
748
  const callSettings = defaultCallSettings.merge(options);
875
- this.initialize().catch(err => {
876
- throw err;
877
- });
749
+ this.initialize().catch(err => { throw err; });
878
750
  this._log.info('listEngines iterate %j', request);
879
751
  return this.descriptors.page.listEngines.asyncIterate(this.innerApiCalls['listEngines'], request, callSettings);
880
752
  }
881
753
  /**
882
- * Gets information about a location.
883
- *
884
- * @param {Object} request
885
- * The request object that will be sent.
886
- * @param {string} request.name
887
- * Resource name for the location.
888
- * @param {object} [options]
889
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
890
- * @returns {Promise} - The promise which resolves to an array.
891
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
892
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
893
- * for more details and examples.
894
- * @example
895
- * ```
896
- * const [response] = await client.getLocation(request);
897
- * ```
898
- */
754
+ * Gets information about a location.
755
+ *
756
+ * @param {Object} request
757
+ * The request object that will be sent.
758
+ * @param {string} request.name
759
+ * Resource name for the location.
760
+ * @param {object} [options]
761
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
762
+ * @returns {Promise} - The promise which resolves to an array.
763
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
764
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
765
+ * for more details and examples.
766
+ * @example
767
+ * ```
768
+ * const [response] = await client.getLocation(request);
769
+ * ```
770
+ */
899
771
  getLocation(request, options, callback) {
900
772
  return this.locationsClient.getLocation(request, options, callback);
901
773
  }
902
774
  /**
903
- * Lists information about the supported locations for this service. Returns an iterable object.
904
- *
905
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
906
- * @param {Object} request
907
- * The request object that will be sent.
908
- * @param {string} request.name
909
- * The resource that owns the locations collection, if applicable.
910
- * @param {string} request.filter
911
- * The standard list filter.
912
- * @param {number} request.pageSize
913
- * The standard list page size.
914
- * @param {string} request.pageToken
915
- * The standard list page token.
916
- * @param {object} [options]
917
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
918
- * @returns {Object}
919
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
920
- * When you iterate the returned iterable, each element will be an object representing
921
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
922
- * so you can stop the iteration when you don't need more results.
923
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
924
- * for more details and examples.
925
- * @example
926
- * ```
927
- * const iterable = client.listLocationsAsync(request);
928
- * for await (const response of iterable) {
929
- * // process response
930
- * }
931
- * ```
932
- */
775
+ * Lists information about the supported locations for this service. Returns an iterable object.
776
+ *
777
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
778
+ * @param {Object} request
779
+ * The request object that will be sent.
780
+ * @param {string} request.name
781
+ * The resource that owns the locations collection, if applicable.
782
+ * @param {string} request.filter
783
+ * The standard list filter.
784
+ * @param {number} request.pageSize
785
+ * The standard list page size.
786
+ * @param {string} request.pageToken
787
+ * The standard list page token.
788
+ * @param {object} [options]
789
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
790
+ * @returns {Object}
791
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
792
+ * When you iterate the returned iterable, each element will be an object representing
793
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
794
+ * so you can stop the iteration when you don't need more results.
795
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
796
+ * for more details and examples.
797
+ * @example
798
+ * ```
799
+ * const iterable = client.listLocationsAsync(request);
800
+ * for await (const response of iterable) {
801
+ * // process response
802
+ * }
803
+ * ```
804
+ */
933
805
  listLocationsAsync(request, options) {
934
806
  return this.locationsClient.listLocationsAsync(request, options);
935
807
  }
936
808
  /**
937
- * Gets the latest state of a long-running operation. Clients can use this
938
- * method to poll the operation result at intervals as recommended by the API
939
- * service.
940
- *
941
- * @param {Object} request - The request object that will be sent.
942
- * @param {string} request.name - The name of the operation resource.
943
- * @param {Object=} options
944
- * Optional parameters. You can override the default settings for this call,
945
- * e.g, timeout, retries, paginations, etc. See {@link
946
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
947
- * for the details.
948
- * @param {function(?Error, ?Object)=} callback
949
- * The function which will be called with the result of the API call.
950
- *
951
- * The second parameter to the callback is an object representing
952
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
953
- * @return {Promise} - The promise which resolves to an array.
954
- * The first element of the array is an object representing
955
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
956
- * The promise has a method named "cancel" which cancels the ongoing API call.
957
- *
958
- * @example
959
- * ```
960
- * const client = longrunning.operationsClient();
961
- * const name = '';
962
- * const [response] = await client.getOperation({name});
963
- * // doThingsWith(response)
964
- * ```
965
- */
809
+ * Gets the latest state of a long-running operation. Clients can use this
810
+ * method to poll the operation result at intervals as recommended by the API
811
+ * service.
812
+ *
813
+ * @param {Object} request - The request object that will be sent.
814
+ * @param {string} request.name - The name of the operation resource.
815
+ * @param {Object=} options
816
+ * Optional parameters. You can override the default settings for this call,
817
+ * e.g, timeout, retries, paginations, etc. See {@link
818
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
819
+ * for the details.
820
+ * @param {function(?Error, ?Object)=} callback
821
+ * The function which will be called with the result of the API call.
822
+ *
823
+ * The second parameter to the callback is an object representing
824
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
825
+ * @return {Promise} - The promise which resolves to an array.
826
+ * The first element of the array is an object representing
827
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
828
+ * The promise has a method named "cancel" which cancels the ongoing API call.
829
+ *
830
+ * @example
831
+ * ```
832
+ * const client = longrunning.operationsClient();
833
+ * const name = '';
834
+ * const [response] = await client.getOperation({name});
835
+ * // doThingsWith(response)
836
+ * ```
837
+ */
966
838
  getOperation(request, optionsOrCallback, callback) {
967
839
  let options;
968
840
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1139,8 +1011,7 @@ class EngineServiceClient {
1139
1011
  * @returns {string} A string representing the project.
1140
1012
  */
1141
1013
  matchProjectFromCollectionName(collectionName) {
1142
- return this.pathTemplates.collectionPathTemplate.match(collectionName)
1143
- .project;
1014
+ return this.pathTemplates.collectionPathTemplate.match(collectionName).project;
1144
1015
  }
1145
1016
  /**
1146
1017
  * Parse the location from Collection resource.
@@ -1150,8 +1021,7 @@ class EngineServiceClient {
1150
1021
  * @returns {string} A string representing the location.
1151
1022
  */
1152
1023
  matchLocationFromCollectionName(collectionName) {
1153
- return this.pathTemplates.collectionPathTemplate.match(collectionName)
1154
- .location;
1024
+ return this.pathTemplates.collectionPathTemplate.match(collectionName).location;
1155
1025
  }
1156
1026
  /**
1157
1027
  * Parse the collection from Collection resource.
@@ -1161,8 +1031,7 @@ class EngineServiceClient {
1161
1031
  * @returns {string} A string representing the collection.
1162
1032
  */
1163
1033
  matchCollectionFromCollectionName(collectionName) {
1164
- return this.pathTemplates.collectionPathTemplate.match(collectionName)
1165
- .collection;
1034
+ return this.pathTemplates.collectionPathTemplate.match(collectionName).collection;
1166
1035
  }
1167
1036
  /**
1168
1037
  * Return a fully-qualified engine resource name string.
@@ -1244,8 +1113,7 @@ class EngineServiceClient {
1244
1113
  * @returns {string} A string representing the project.
1245
1114
  */
1246
1115
  matchProjectFromEvaluationName(evaluationName) {
1247
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1248
- .project;
1116
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
1249
1117
  }
1250
1118
  /**
1251
1119
  * Parse the location from Evaluation resource.
@@ -1255,8 +1123,7 @@ class EngineServiceClient {
1255
1123
  * @returns {string} A string representing the location.
1256
1124
  */
1257
1125
  matchLocationFromEvaluationName(evaluationName) {
1258
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1259
- .location;
1126
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
1260
1127
  }
1261
1128
  /**
1262
1129
  * Parse the evaluation from Evaluation resource.
@@ -1266,8 +1133,7 @@ class EngineServiceClient {
1266
1133
  * @returns {string} A string representing the evaluation.
1267
1134
  */
1268
1135
  matchEvaluationFromEvaluationName(evaluationName) {
1269
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1270
- .evaluation;
1136
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
1271
1137
  }
1272
1138
  /**
1273
1139
  * Return a fully-qualified groundingConfig resource name string.
@@ -3505,8 +3371,7 @@ class EngineServiceClient {
3505
3371
  * @returns {string} A string representing the project.
3506
3372
  */
3507
3373
  matchProjectFromSampleQueryName(sampleQueryName) {
3508
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3509
- .project;
3374
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3510
3375
  }
3511
3376
  /**
3512
3377
  * Parse the location from SampleQuery resource.
@@ -3516,8 +3381,7 @@ class EngineServiceClient {
3516
3381
  * @returns {string} A string representing the location.
3517
3382
  */
3518
3383
  matchLocationFromSampleQueryName(sampleQueryName) {
3519
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3520
- .location;
3384
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3521
3385
  }
3522
3386
  /**
3523
3387
  * Parse the sample_query_set from SampleQuery resource.
@@ -3527,8 +3391,7 @@ class EngineServiceClient {
3527
3391
  * @returns {string} A string representing the sample_query_set.
3528
3392
  */
3529
3393
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3530
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3531
- .sample_query_set;
3394
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3532
3395
  }
3533
3396
  /**
3534
3397
  * Parse the sample_query from SampleQuery resource.
@@ -3538,8 +3401,7 @@ class EngineServiceClient {
3538
3401
  * @returns {string} A string representing the sample_query.
3539
3402
  */
3540
3403
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3541
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3542
- .sample_query;
3404
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3543
3405
  }
3544
3406
  /**
3545
3407
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3598,8 +3460,8 @@ class EngineServiceClient {
3598
3460
  this._log.info('ending gRPC channel');
3599
3461
  this._terminated = true;
3600
3462
  stub.close();
3601
- this.locationsClient.close();
3602
- this.operationsClient.close();
3463
+ this.locationsClient.close().catch(err => { throw err; });
3464
+ void this.operationsClient.close();
3603
3465
  });
3604
3466
  }
3605
3467
  return Promise.resolve();