@google-cloud/discoveryengine 2.0.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +7 -2
  3. package/build/protos/google/cloud/discoveryengine/v1/answer.proto +54 -2
  4. package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +2 -1
  5. package/build/protos/google/cloud/discoveryengine/v1/common.proto +35 -6
  6. package/build/protos/google/cloud/discoveryengine/v1/control.proto +113 -2
  7. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +168 -2
  8. package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +23 -4
  9. package/build/protos/google/cloud/discoveryengine/v1/document.proto +7 -2
  10. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +1 -1
  11. package/build/protos/google/cloud/discoveryengine/v1/engine.proto +16 -3
  12. package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +70 -9
  13. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +20 -1
  14. package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +9 -5
  15. package/build/protos/google/cloud/discoveryengine/v1/rank_service.proto +3 -1
  16. package/build/protos/google/cloud/discoveryengine/v1/recommendation_service.proto +2 -2
  17. package/build/protos/google/cloud/discoveryengine/v1/safety.proto +107 -0
  18. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +96 -8
  19. package/build/protos/google/cloud/discoveryengine/v1/serving_config.proto +271 -0
  20. package/build/protos/google/cloud/discoveryengine/v1/serving_config_service.proto +75 -0
  21. package/build/protos/google/cloud/discoveryengine/v1/session.proto +19 -0
  22. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +27 -3
  23. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine_service.proto +184 -5
  24. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +34 -0
  25. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +16 -4
  26. package/build/protos/protos.d.ts +4390 -300
  27. package/build/protos/protos.js +13785 -2922
  28. package/build/protos/protos.json +1355 -14
  29. package/build/src/index.d.ts +4 -1
  30. package/build/src/index.js +4 -21
  31. package/build/src/v1/completion_service_client.d.ts +313 -76
  32. package/build/src/v1/completion_service_client.js +451 -262
  33. package/build/src/v1/completion_service_proto_list.json +3 -0
  34. package/build/src/v1/control_service_client.d.ts +318 -81
  35. package/build/src/v1/control_service_client.js +422 -132
  36. package/build/src/v1/control_service_proto_list.json +3 -0
  37. package/build/src/v1/conversational_search_service_client.d.ts +341 -134
  38. package/build/src/v1/conversational_search_service_client.js +395 -223
  39. package/build/src/v1/conversational_search_service_client_config.json +5 -0
  40. package/build/src/v1/conversational_search_service_proto_list.json +3 -0
  41. package/build/src/v1/data_store_service_client.d.ts +359 -122
  42. package/build/src/v1/data_store_service_client.js +460 -280
  43. package/build/src/v1/data_store_service_proto_list.json +3 -0
  44. package/build/src/v1/document_service_client.d.ts +364 -121
  45. package/build/src/v1/document_service_client.js +469 -300
  46. package/build/src/v1/document_service_proto_list.json +3 -0
  47. package/build/src/v1/engine_service_client.d.ts +340 -103
  48. package/build/src/v1/engine_service_client.js +460 -279
  49. package/build/src/v1/engine_service_proto_list.json +3 -0
  50. package/build/src/v1/gapic_metadata.json +59 -0
  51. package/build/src/v1/grounded_generation_service_client.d.ts +286 -51
  52. package/build/src/v1/grounded_generation_service_client.js +405 -100
  53. package/build/src/v1/grounded_generation_service_proto_list.json +3 -0
  54. package/build/src/v1/index.d.ts +1 -0
  55. package/build/src/v1/index.js +3 -1
  56. package/build/src/v1/project_service_client.d.ts +313 -76
  57. package/build/src/v1/project_service_client.js +434 -222
  58. package/build/src/v1/project_service_proto_list.json +3 -0
  59. package/build/src/v1/rank_service_client.d.ts +285 -48
  60. package/build/src/v1/rank_service_client.js +398 -85
  61. package/build/src/v1/rank_service_proto_list.json +3 -0
  62. package/build/src/v1/recommendation_service_client.d.ts +142 -49
  63. package/build/src/v1/recommendation_service_client.js +198 -82
  64. package/build/src/v1/recommendation_service_proto_list.json +3 -0
  65. package/build/src/v1/schema_service_client.d.ts +348 -111
  66. package/build/src/v1/schema_service_client.js +457 -273
  67. package/build/src/v1/schema_service_proto_list.json +3 -0
  68. package/build/src/v1/search_service_client.d.ts +748 -559
  69. package/build/src/v1/search_service_client.js +302 -133
  70. package/build/src/v1/search_service_proto_list.json +3 -0
  71. package/build/src/v1/search_tuning_service_client.d.ts +314 -77
  72. package/build/src/v1/search_tuning_service_client.js +439 -235
  73. package/build/src/v1/search_tuning_service_proto_list.json +3 -0
  74. package/build/src/v1/serving_config_service_client.d.ts +1851 -0
  75. package/build/src/v1/serving_config_service_client.js +2642 -0
  76. package/build/src/v1/serving_config_service_client_config.json +30 -0
  77. package/build/src/v1/serving_config_service_proto_list.json +39 -0
  78. package/build/src/v1/site_search_engine_service_client.d.ts +504 -151
  79. package/build/src/v1/site_search_engine_service_client.js +625 -351
  80. package/build/src/v1/site_search_engine_service_client_config.json +12 -0
  81. package/build/src/v1/site_search_engine_service_proto_list.json +3 -0
  82. package/build/src/v1/user_event_service_client.d.ts +335 -86
  83. package/build/src/v1/user_event_service_client.js +447 -253
  84. package/build/src/v1/user_event_service_proto_list.json +3 -0
  85. package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
  86. package/build/src/v1alpha/acl_config_service_client.js +82 -106
  87. package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
  88. package/build/src/v1alpha/chunk_service_client.js +92 -120
  89. package/build/src/v1alpha/completion_service_client.d.ts +77 -77
  90. package/build/src/v1alpha/completion_service_client.js +134 -280
  91. package/build/src/v1alpha/control_service_client.d.ts +85 -85
  92. package/build/src/v1alpha/control_service_client.js +105 -151
  93. package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
  94. package/build/src/v1alpha/conversational_search_service_client.js +145 -237
  95. package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
  96. package/build/src/v1alpha/data_store_service_client.js +151 -316
  97. package/build/src/v1alpha/document_service_client.d.ts +126 -126
  98. package/build/src/v1alpha/document_service_client.js +156 -328
  99. package/build/src/v1alpha/engine_service_client.d.ts +106 -106
  100. package/build/src/v1alpha/engine_service_client.js +155 -325
  101. package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
  102. package/build/src/v1alpha/estimate_billing_service_client.js +118 -243
  103. package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
  104. package/build/src/v1alpha/evaluation_service_client.js +143 -295
  105. package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
  106. package/build/src/v1alpha/grounded_generation_service_client.js +79 -100
  107. package/build/src/v1alpha/project_service_client.d.ts +78 -78
  108. package/build/src/v1alpha/project_service_client.js +126 -262
  109. package/build/src/v1alpha/rank_service_client.d.ts +47 -47
  110. package/build/src/v1alpha/rank_service_client.js +81 -104
  111. package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
  112. package/build/src/v1alpha/recommendation_service_client.js +79 -100
  113. package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
  114. package/build/src/v1alpha/sample_query_service_client.js +144 -301
  115. package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
  116. package/build/src/v1alpha/sample_query_set_service_client.js +106 -153
  117. package/build/src/v1alpha/schema_service_client.d.ts +112 -112
  118. package/build/src/v1alpha/schema_service_client.js +140 -292
  119. package/build/src/v1alpha/search_service_client.d.ts +327 -327
  120. package/build/src/v1alpha/search_service_client.js +88 -112
  121. package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
  122. package/build/src/v1alpha/search_tuning_service_client.js +122 -253
  123. package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
  124. package/build/src/v1alpha/serving_config_service_client.js +97 -133
  125. package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
  126. package/build/src/v1alpha/site_search_engine_service_client.js +184 -387
  127. package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
  128. package/build/src/v1alpha/user_event_service_client.js +130 -271
  129. package/build/src/v1beta/completion_service_client.d.ts +78 -78
  130. package/build/src/v1beta/completion_service_client.js +136 -279
  131. package/build/src/v1beta/control_service_client.d.ts +84 -84
  132. package/build/src/v1beta/control_service_client.js +103 -147
  133. package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
  134. package/build/src/v1beta/conversational_search_service_client.js +143 -233
  135. package/build/src/v1beta/data_store_service_client.d.ts +124 -124
  136. package/build/src/v1beta/data_store_service_client.js +141 -288
  137. package/build/src/v1beta/document_service_client.d.ts +124 -124
  138. package/build/src/v1beta/document_service_client.js +150 -309
  139. package/build/src/v1beta/engine_service_client.d.ts +106 -106
  140. package/build/src/v1beta/engine_service_client.js +153 -315
  141. package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
  142. package/build/src/v1beta/evaluation_service_client.js +141 -285
  143. package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
  144. package/build/src/v1beta/grounded_generation_service_client.js +86 -114
  145. package/build/src/v1beta/project_service_client.d.ts +76 -76
  146. package/build/src/v1beta/project_service_client.js +115 -231
  147. package/build/src/v1beta/rank_service_client.d.ts +47 -47
  148. package/build/src/v1beta/rank_service_client.js +79 -99
  149. package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
  150. package/build/src/v1beta/recommendation_service_client.js +77 -96
  151. package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
  152. package/build/src/v1beta/sample_query_service_client.js +142 -291
  153. package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
  154. package/build/src/v1beta/sample_query_set_service_client.js +104 -149
  155. package/build/src/v1beta/schema_service_client.d.ts +111 -111
  156. package/build/src/v1beta/schema_service_client.js +138 -282
  157. package/build/src/v1beta/search_service_client.d.ts +665 -665
  158. package/build/src/v1beta/search_service_client.js +97 -128
  159. package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
  160. package/build/src/v1beta/search_tuning_service_client.js +120 -243
  161. package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
  162. package/build/src/v1beta/serving_config_service_client.js +95 -129
  163. package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
  164. package/build/src/v1beta/site_search_engine_service_client.js +186 -386
  165. package/build/src/v1beta/user_event_service_client.d.ts +78 -78
  166. package/build/src/v1beta/user_event_service_client.js +128 -261
  167. package/package.json +4 -4
@@ -100,26 +100,17 @@ class DocumentServiceClient {
100
100
  constructor(opts, gaxInstance) {
101
101
  // Ensure that options include all the required fields.
102
102
  const staticMembers = this.constructor;
103
- if (opts?.universe_domain &&
104
- opts?.universeDomain &&
105
- opts?.universe_domain !== opts?.universeDomain) {
103
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
106
104
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
107
105
  }
108
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
109
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
110
- : undefined;
111
- this._universeDomain =
112
- opts?.universeDomain ??
113
- opts?.universe_domain ??
114
- universeDomainEnvVar ??
115
- 'googleapis.com';
106
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
107
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
116
108
  this._servicePath = 'discoveryengine.' + this._universeDomain;
117
109
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
118
110
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
119
111
  const port = opts?.port || staticMembers.port;
120
112
  const clientConfig = opts?.clientConfig ?? {};
121
- const fallback = opts?.fallback ??
122
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
113
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
123
114
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
124
115
  // Request numeric enum values if REST transport is used.
125
116
  opts.numericEnums = true;
@@ -149,7 +140,10 @@ class DocumentServiceClient {
149
140
  }
150
141
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
151
142
  // Determine the client header string.
152
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
143
+ const clientHeader = [
144
+ `gax/${this._gaxModule.version}`,
145
+ `gapic/${version}`,
146
+ ];
153
147
  if (typeof process === 'object' && 'versions' in process) {
154
148
  clientHeader.push(`gl-node/${process.versions.node}`);
155
149
  }
@@ -217,7 +211,7 @@ class DocumentServiceClient {
217
211
  // (e.g. 50 results at a time, with tokens to get subsequent
218
212
  // pages). Denote the keys used for pagination and results.
219
213
  this.descriptors.page = {
220
- listDocuments: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documents'),
214
+ listDocuments: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documents')
221
215
  };
222
216
  const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
223
217
  // This API contains "long-running operations", which return a
@@ -225,122 +219,23 @@ class DocumentServiceClient {
225
219
  // rather than holding a request open.
226
220
  const lroOptions = {
227
221
  auth: this.auth,
228
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
222
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
229
223
  };
230
224
  if (opts.fallback) {
231
225
  lroOptions.protoJson = protoFilesRoot;
232
- lroOptions.httpRules = [
233
- {
234
- selector: 'google.longrunning.Operations.CancelOperation',
235
- post: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
236
- body: '*',
237
- additional_bindings: [
238
- {
239
- post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
240
- body: '*',
241
- },
242
- ],
243
- },
244
- {
245
- selector: 'google.longrunning.Operations.GetOperation',
246
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
247
- additional_bindings: [
248
- {
249
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
250
- },
251
- {
252
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
253
- },
254
- {
255
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
256
- },
257
- {
258
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
259
- },
260
- {
261
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
262
- },
263
- {
264
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
265
- },
266
- {
267
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
268
- },
269
- {
270
- get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}',
271
- },
272
- {
273
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
274
- },
275
- {
276
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
277
- },
278
- {
279
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}',
280
- },
281
- {
282
- get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}',
283
- },
284
- { get: '/v1beta/{name=projects/*/locations/*/operations/*}' },
285
- {
286
- get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
287
- },
288
- { get: '/v1beta/{name=projects/*/operations/*}' },
289
- ],
290
- },
291
- {
292
- selector: 'google.longrunning.Operations.ListOperations',
293
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
294
- additional_bindings: [
295
- {
296
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
297
- },
298
- {
299
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
300
- },
301
- {
302
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
303
- },
304
- {
305
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
306
- },
307
- {
308
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
309
- },
310
- {
311
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
312
- },
313
- {
314
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations',
315
- },
316
- {
317
- get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations',
318
- },
319
- {
320
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
321
- },
322
- {
323
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
324
- },
325
- {
326
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations',
327
- },
328
- { get: '/v1beta/{name=projects/*/locations/*}/operations' },
329
- { get: '/v1beta/{name=projects/*}/operations' },
330
- ],
331
- },
332
- ];
226
+ 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: '*', }],
227
+ }, { 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/*}', }],
228
+ }, { 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', }],
229
+ }];
333
230
  }
334
- this.operationsClient = this._gaxModule
335
- .lro(lroOptions)
336
- .operationsClient(opts);
231
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
337
232
  const importDocumentsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.ImportDocumentsResponse');
338
233
  const importDocumentsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.ImportDocumentsMetadata');
339
234
  const purgeDocumentsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.PurgeDocumentsResponse');
340
235
  const purgeDocumentsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.PurgeDocumentsMetadata');
341
236
  this.descriptors.longrunning = {
342
237
  importDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importDocumentsResponse.decode.bind(importDocumentsResponse), importDocumentsMetadata.decode.bind(importDocumentsMetadata)),
343
- purgeDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeDocumentsResponse.decode.bind(purgeDocumentsResponse), purgeDocumentsMetadata.decode.bind(purgeDocumentsMetadata)),
238
+ purgeDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeDocumentsResponse.decode.bind(purgeDocumentsResponse), purgeDocumentsMetadata.decode.bind(purgeDocumentsMetadata))
344
239
  };
345
240
  // Put together the default options sent with requests.
346
241
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.DocumentService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -369,23 +264,13 @@ class DocumentServiceClient {
369
264
  }
370
265
  // Put together the "service stub" for
371
266
  // google.cloud.discoveryengine.v1beta.DocumentService.
372
- this.documentServiceStub = this._gaxGrpc.createStub(this._opts.fallback
373
- ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.DocumentService')
374
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
375
- this._protos.google.cloud.discoveryengine.v1beta
376
- .DocumentService, this._opts, this._providedCustomServicePath);
267
+ this.documentServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
268
+ this._protos.lookupService('google.cloud.discoveryengine.v1beta.DocumentService') :
269
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
270
+ this._protos.google.cloud.discoveryengine.v1beta.DocumentService, this._opts, this._providedCustomServicePath);
377
271
  // Iterate over each of the methods that the service provides
378
272
  // and create an API call method for each.
379
- const documentServiceStubMethods = [
380
- 'getDocument',
381
- 'listDocuments',
382
- 'createDocument',
383
- 'updateDocument',
384
- 'deleteDocument',
385
- 'importDocuments',
386
- 'purgeDocuments',
387
- 'batchGetDocumentsMetadata',
388
- ];
273
+ const documentServiceStubMethods = ['getDocument', 'listDocuments', 'createDocument', 'updateDocument', 'deleteDocument', 'importDocuments', 'purgeDocuments', 'batchGetDocumentsMetadata'];
389
274
  for (const methodName of documentServiceStubMethods) {
390
275
  const callPromise = this.documentServiceStub.then(stub => (...args) => {
391
276
  if (this._terminated) {
@@ -410,8 +295,7 @@ class DocumentServiceClient {
410
295
  * @returns {string} The DNS address for this service.
411
296
  */
412
297
  static get servicePath() {
413
- if (typeof process === 'object' &&
414
- typeof process.emitWarning === 'function') {
298
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
415
299
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
416
300
  }
417
301
  return 'discoveryengine.googleapis.com';
@@ -422,8 +306,7 @@ class DocumentServiceClient {
422
306
  * @returns {string} The DNS address for this service.
423
307
  */
424
308
  static get apiEndpoint() {
425
- if (typeof process === 'object' &&
426
- typeof process.emitWarning === 'function') {
309
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
427
310
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
428
311
  }
429
312
  return 'discoveryengine.googleapis.com';
@@ -451,7 +334,9 @@ class DocumentServiceClient {
451
334
  * @returns {string[]} List of default scopes.
452
335
  */
453
336
  static get scopes() {
454
- return ['https://www.googleapis.com/auth/cloud-platform'];
337
+ return [
338
+ 'https://www.googleapis.com/auth/cloud-platform'
339
+ ];
455
340
  }
456
341
  /**
457
342
  * Return the project ID used by this class.
@@ -477,13 +362,10 @@ class DocumentServiceClient {
477
362
  options = options || {};
478
363
  options.otherArgs = options.otherArgs || {};
479
364
  options.otherArgs.headers = options.otherArgs.headers || {};
480
- options.otherArgs.headers['x-goog-request-params'] =
481
- this._gaxModule.routingHeader.fromParams({
482
- name: request.name ?? '',
483
- });
484
- this.initialize().catch(err => {
485
- throw err;
365
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
366
+ 'name': request.name ?? '',
486
367
  });
368
+ this.initialize().catch(err => { throw err; });
487
369
  this._log.info('getDocument request %j', request);
488
370
  const wrappedCallback = callback
489
371
  ? (error, response, options, rawResponse) => {
@@ -491,8 +373,7 @@ class DocumentServiceClient {
491
373
  callback(error, response, options, rawResponse); // We verified callback above.
492
374
  }
493
375
  : undefined;
494
- return this.innerApiCalls
495
- .getDocument(request, options, wrappedCallback)
376
+ return this.innerApiCalls.getDocument(request, options, wrappedCallback)
496
377
  ?.then(([response, options, rawResponse]) => {
497
378
  this._log.info('getDocument response %j', response);
498
379
  return [response, options, rawResponse];
@@ -511,13 +392,10 @@ class DocumentServiceClient {
511
392
  options = options || {};
512
393
  options.otherArgs = options.otherArgs || {};
513
394
  options.otherArgs.headers = options.otherArgs.headers || {};
514
- options.otherArgs.headers['x-goog-request-params'] =
515
- this._gaxModule.routingHeader.fromParams({
516
- parent: request.parent ?? '',
517
- });
518
- this.initialize().catch(err => {
519
- throw err;
395
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
396
+ 'parent': request.parent ?? '',
520
397
  });
398
+ this.initialize().catch(err => { throw err; });
521
399
  this._log.info('createDocument request %j', request);
522
400
  const wrappedCallback = callback
523
401
  ? (error, response, options, rawResponse) => {
@@ -525,8 +403,7 @@ class DocumentServiceClient {
525
403
  callback(error, response, options, rawResponse); // We verified callback above.
526
404
  }
527
405
  : undefined;
528
- return this.innerApiCalls
529
- .createDocument(request, options, wrappedCallback)
406
+ return this.innerApiCalls.createDocument(request, options, wrappedCallback)
530
407
  ?.then(([response, options, rawResponse]) => {
531
408
  this._log.info('createDocument response %j', response);
532
409
  return [response, options, rawResponse];
@@ -545,13 +422,10 @@ class DocumentServiceClient {
545
422
  options = options || {};
546
423
  options.otherArgs = options.otherArgs || {};
547
424
  options.otherArgs.headers = options.otherArgs.headers || {};
548
- options.otherArgs.headers['x-goog-request-params'] =
549
- this._gaxModule.routingHeader.fromParams({
550
- 'document.name': request.document.name ?? '',
551
- });
552
- this.initialize().catch(err => {
553
- throw err;
425
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
426
+ 'document.name': request.document.name ?? '',
554
427
  });
428
+ this.initialize().catch(err => { throw err; });
555
429
  this._log.info('updateDocument request %j', request);
556
430
  const wrappedCallback = callback
557
431
  ? (error, response, options, rawResponse) => {
@@ -559,8 +433,7 @@ class DocumentServiceClient {
559
433
  callback(error, response, options, rawResponse); // We verified callback above.
560
434
  }
561
435
  : undefined;
562
- return this.innerApiCalls
563
- .updateDocument(request, options, wrappedCallback)
436
+ return this.innerApiCalls.updateDocument(request, options, wrappedCallback)
564
437
  ?.then(([response, options, rawResponse]) => {
565
438
  this._log.info('updateDocument response %j', response);
566
439
  return [response, options, rawResponse];
@@ -579,13 +452,10 @@ class DocumentServiceClient {
579
452
  options = options || {};
580
453
  options.otherArgs = options.otherArgs || {};
581
454
  options.otherArgs.headers = options.otherArgs.headers || {};
582
- options.otherArgs.headers['x-goog-request-params'] =
583
- this._gaxModule.routingHeader.fromParams({
584
- name: request.name ?? '',
585
- });
586
- this.initialize().catch(err => {
587
- throw err;
455
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
456
+ 'name': request.name ?? '',
588
457
  });
458
+ this.initialize().catch(err => { throw err; });
589
459
  this._log.info('deleteDocument request %j', request);
590
460
  const wrappedCallback = callback
591
461
  ? (error, response, options, rawResponse) => {
@@ -593,8 +463,7 @@ class DocumentServiceClient {
593
463
  callback(error, response, options, rawResponse); // We verified callback above.
594
464
  }
595
465
  : undefined;
596
- return this.innerApiCalls
597
- .deleteDocument(request, options, wrappedCallback)
466
+ return this.innerApiCalls.deleteDocument(request, options, wrappedCallback)
598
467
  ?.then(([response, options, rawResponse]) => {
599
468
  this._log.info('deleteDocument response %j', response);
600
469
  return [response, options, rawResponse];
@@ -613,13 +482,10 @@ class DocumentServiceClient {
613
482
  options = options || {};
614
483
  options.otherArgs = options.otherArgs || {};
615
484
  options.otherArgs.headers = options.otherArgs.headers || {};
616
- options.otherArgs.headers['x-goog-request-params'] =
617
- this._gaxModule.routingHeader.fromParams({
618
- parent: request.parent ?? '',
619
- });
620
- this.initialize().catch(err => {
621
- throw err;
485
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
486
+ 'parent': request.parent ?? '',
622
487
  });
488
+ this.initialize().catch(err => { throw err; });
623
489
  this._log.info('batchGetDocumentsMetadata request %j', request);
624
490
  const wrappedCallback = callback
625
491
  ? (error, response, options, rawResponse) => {
@@ -627,8 +493,7 @@ class DocumentServiceClient {
627
493
  callback(error, response, options, rawResponse); // We verified callback above.
628
494
  }
629
495
  : undefined;
630
- return this.innerApiCalls
631
- .batchGetDocumentsMetadata(request, options, wrappedCallback)
496
+ return this.innerApiCalls.batchGetDocumentsMetadata(request, options, wrappedCallback)
632
497
  ?.then(([response, options, rawResponse]) => {
633
498
  this._log.info('batchGetDocumentsMetadata response %j', response);
634
499
  return [response, options, rawResponse];
@@ -647,13 +512,10 @@ class DocumentServiceClient {
647
512
  options = options || {};
648
513
  options.otherArgs = options.otherArgs || {};
649
514
  options.otherArgs.headers = options.otherArgs.headers || {};
650
- options.otherArgs.headers['x-goog-request-params'] =
651
- this._gaxModule.routingHeader.fromParams({
652
- parent: request.parent ?? '',
653
- });
654
- this.initialize().catch(err => {
655
- throw err;
515
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
516
+ 'parent': request.parent ?? '',
656
517
  });
518
+ this.initialize().catch(err => { throw err; });
657
519
  const wrappedCallback = callback
658
520
  ? (error, response, rawResponse, _) => {
659
521
  this._log.info('importDocuments response %j', rawResponse);
@@ -661,8 +523,7 @@ class DocumentServiceClient {
661
523
  }
662
524
  : undefined;
663
525
  this._log.info('importDocuments request %j', request);
664
- return this.innerApiCalls
665
- .importDocuments(request, options, wrappedCallback)
526
+ return this.innerApiCalls.importDocuments(request, options, wrappedCallback)
666
527
  ?.then(([response, rawResponse, _]) => {
667
528
  this._log.info('importDocuments response %j', rawResponse);
668
529
  return [response, rawResponse, _];
@@ -699,13 +560,10 @@ class DocumentServiceClient {
699
560
  options = options || {};
700
561
  options.otherArgs = options.otherArgs || {};
701
562
  options.otherArgs.headers = options.otherArgs.headers || {};
702
- options.otherArgs.headers['x-goog-request-params'] =
703
- this._gaxModule.routingHeader.fromParams({
704
- parent: request.parent ?? '',
705
- });
706
- this.initialize().catch(err => {
707
- throw err;
563
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
564
+ 'parent': request.parent ?? '',
708
565
  });
566
+ this.initialize().catch(err => { throw err; });
709
567
  const wrappedCallback = callback
710
568
  ? (error, response, rawResponse, _) => {
711
569
  this._log.info('purgeDocuments response %j', rawResponse);
@@ -713,8 +571,7 @@ class DocumentServiceClient {
713
571
  }
714
572
  : undefined;
715
573
  this._log.info('purgeDocuments request %j', request);
716
- return this.innerApiCalls
717
- .purgeDocuments(request, options, wrappedCallback)
574
+ return this.innerApiCalls.purgeDocuments(request, options, wrappedCallback)
718
575
  ?.then(([response, rawResponse, _]) => {
719
576
  this._log.info('purgeDocuments response %j', rawResponse);
720
577
  return [response, rawResponse, _];
@@ -751,13 +608,10 @@ class DocumentServiceClient {
751
608
  options = options || {};
752
609
  options.otherArgs = options.otherArgs || {};
753
610
  options.otherArgs.headers = options.otherArgs.headers || {};
754
- options.otherArgs.headers['x-goog-request-params'] =
755
- this._gaxModule.routingHeader.fromParams({
756
- parent: request.parent ?? '',
757
- });
758
- this.initialize().catch(err => {
759
- throw err;
611
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
612
+ 'parent': request.parent ?? '',
760
613
  });
614
+ this.initialize().catch(err => { throw err; });
761
615
  const wrappedCallback = callback
762
616
  ? (error, values, nextPageRequest, rawResponse) => {
763
617
  this._log.info('listDocuments values %j', values);
@@ -819,15 +673,12 @@ class DocumentServiceClient {
819
673
  options = options || {};
820
674
  options.otherArgs = options.otherArgs || {};
821
675
  options.otherArgs.headers = options.otherArgs.headers || {};
822
- options.otherArgs.headers['x-goog-request-params'] =
823
- this._gaxModule.routingHeader.fromParams({
824
- parent: request.parent ?? '',
825
- });
676
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
677
+ 'parent': request.parent ?? '',
678
+ });
826
679
  const defaultCallSettings = this._defaults['listDocuments'];
827
680
  const callSettings = defaultCallSettings.merge(options);
828
- this.initialize().catch(err => {
829
- throw err;
830
- });
681
+ this.initialize().catch(err => { throw err; });
831
682
  this._log.info('listDocuments stream %j', request);
832
683
  return this.descriptors.page.listDocuments.createStream(this.innerApiCalls.listDocuments, request, callSettings);
833
684
  }
@@ -881,103 +732,100 @@ class DocumentServiceClient {
881
732
  options = options || {};
882
733
  options.otherArgs = options.otherArgs || {};
883
734
  options.otherArgs.headers = options.otherArgs.headers || {};
884
- options.otherArgs.headers['x-goog-request-params'] =
885
- this._gaxModule.routingHeader.fromParams({
886
- parent: request.parent ?? '',
887
- });
735
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
736
+ 'parent': request.parent ?? '',
737
+ });
888
738
  const defaultCallSettings = this._defaults['listDocuments'];
889
739
  const callSettings = defaultCallSettings.merge(options);
890
- this.initialize().catch(err => {
891
- throw err;
892
- });
740
+ this.initialize().catch(err => { throw err; });
893
741
  this._log.info('listDocuments iterate %j', request);
894
742
  return this.descriptors.page.listDocuments.asyncIterate(this.innerApiCalls['listDocuments'], request, callSettings);
895
743
  }
896
744
  /**
897
- * Gets information about a location.
898
- *
899
- * @param {Object} request
900
- * The request object that will be sent.
901
- * @param {string} request.name
902
- * Resource name for the location.
903
- * @param {object} [options]
904
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
905
- * @returns {Promise} - The promise which resolves to an array.
906
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
907
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
908
- * for more details and examples.
909
- * @example
910
- * ```
911
- * const [response] = await client.getLocation(request);
912
- * ```
913
- */
745
+ * Gets information about a location.
746
+ *
747
+ * @param {Object} request
748
+ * The request object that will be sent.
749
+ * @param {string} request.name
750
+ * Resource name for the location.
751
+ * @param {object} [options]
752
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
753
+ * @returns {Promise} - The promise which resolves to an array.
754
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
755
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
756
+ * for more details and examples.
757
+ * @example
758
+ * ```
759
+ * const [response] = await client.getLocation(request);
760
+ * ```
761
+ */
914
762
  getLocation(request, options, callback) {
915
763
  return this.locationsClient.getLocation(request, options, callback);
916
764
  }
917
765
  /**
918
- * Lists information about the supported locations for this service. Returns an iterable object.
919
- *
920
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
921
- * @param {Object} request
922
- * The request object that will be sent.
923
- * @param {string} request.name
924
- * The resource that owns the locations collection, if applicable.
925
- * @param {string} request.filter
926
- * The standard list filter.
927
- * @param {number} request.pageSize
928
- * The standard list page size.
929
- * @param {string} request.pageToken
930
- * The standard list page token.
931
- * @param {object} [options]
932
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
933
- * @returns {Object}
934
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
935
- * When you iterate the returned iterable, each element will be an object representing
936
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
937
- * so you can stop the iteration when you don't need more results.
938
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
939
- * for more details and examples.
940
- * @example
941
- * ```
942
- * const iterable = client.listLocationsAsync(request);
943
- * for await (const response of iterable) {
944
- * // process response
945
- * }
946
- * ```
947
- */
766
+ * Lists information about the supported locations for this service. Returns an iterable object.
767
+ *
768
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
769
+ * @param {Object} request
770
+ * The request object that will be sent.
771
+ * @param {string} request.name
772
+ * The resource that owns the locations collection, if applicable.
773
+ * @param {string} request.filter
774
+ * The standard list filter.
775
+ * @param {number} request.pageSize
776
+ * The standard list page size.
777
+ * @param {string} request.pageToken
778
+ * The standard list page token.
779
+ * @param {object} [options]
780
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
781
+ * @returns {Object}
782
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
783
+ * When you iterate the returned iterable, each element will be an object representing
784
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
785
+ * so you can stop the iteration when you don't need more results.
786
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
787
+ * for more details and examples.
788
+ * @example
789
+ * ```
790
+ * const iterable = client.listLocationsAsync(request);
791
+ * for await (const response of iterable) {
792
+ * // process response
793
+ * }
794
+ * ```
795
+ */
948
796
  listLocationsAsync(request, options) {
949
797
  return this.locationsClient.listLocationsAsync(request, options);
950
798
  }
951
799
  /**
952
- * Gets the latest state of a long-running operation. Clients can use this
953
- * method to poll the operation result at intervals as recommended by the API
954
- * service.
955
- *
956
- * @param {Object} request - The request object that will be sent.
957
- * @param {string} request.name - The name of the operation resource.
958
- * @param {Object=} options
959
- * Optional parameters. You can override the default settings for this call,
960
- * e.g, timeout, retries, paginations, etc. See {@link
961
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
962
- * for the details.
963
- * @param {function(?Error, ?Object)=} callback
964
- * The function which will be called with the result of the API call.
965
- *
966
- * The second parameter to the callback is an object representing
967
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
968
- * @return {Promise} - The promise which resolves to an array.
969
- * The first element of the array is an object representing
970
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
971
- * The promise has a method named "cancel" which cancels the ongoing API call.
972
- *
973
- * @example
974
- * ```
975
- * const client = longrunning.operationsClient();
976
- * const name = '';
977
- * const [response] = await client.getOperation({name});
978
- * // doThingsWith(response)
979
- * ```
980
- */
800
+ * Gets the latest state of a long-running operation. Clients can use this
801
+ * method to poll the operation result at intervals as recommended by the API
802
+ * service.
803
+ *
804
+ * @param {Object} request - The request object that will be sent.
805
+ * @param {string} request.name - The name of the operation resource.
806
+ * @param {Object=} options
807
+ * Optional parameters. You can override the default settings for this call,
808
+ * e.g, timeout, retries, paginations, etc. See {@link
809
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
810
+ * for the details.
811
+ * @param {function(?Error, ?Object)=} callback
812
+ * The function which will be called with the result of the API call.
813
+ *
814
+ * The second parameter to the callback is an object representing
815
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
816
+ * @return {Promise} - The promise which resolves to an array.
817
+ * The first element of the array is an object representing
818
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
819
+ * The promise has a method named "cancel" which cancels the ongoing API call.
820
+ *
821
+ * @example
822
+ * ```
823
+ * const client = longrunning.operationsClient();
824
+ * const name = '';
825
+ * const [response] = await client.getOperation({name});
826
+ * // doThingsWith(response)
827
+ * ```
828
+ */
981
829
  getOperation(request, optionsOrCallback, callback) {
982
830
  let options;
983
831
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1211,8 +1059,7 @@ class DocumentServiceClient {
1211
1059
  * @returns {string} A string representing the project.
1212
1060
  */
1213
1061
  matchProjectFromEvaluationName(evaluationName) {
1214
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1215
- .project;
1062
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
1216
1063
  }
1217
1064
  /**
1218
1065
  * Parse the location from Evaluation resource.
@@ -1222,8 +1069,7 @@ class DocumentServiceClient {
1222
1069
  * @returns {string} A string representing the location.
1223
1070
  */
1224
1071
  matchLocationFromEvaluationName(evaluationName) {
1225
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1226
- .location;
1072
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
1227
1073
  }
1228
1074
  /**
1229
1075
  * Parse the evaluation from Evaluation resource.
@@ -1233,8 +1079,7 @@ class DocumentServiceClient {
1233
1079
  * @returns {string} A string representing the evaluation.
1234
1080
  */
1235
1081
  matchEvaluationFromEvaluationName(evaluationName) {
1236
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1237
- .evaluation;
1082
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
1238
1083
  }
1239
1084
  /**
1240
1085
  * Return a fully-qualified groundingConfig resource name string.
@@ -3598,8 +3443,7 @@ class DocumentServiceClient {
3598
3443
  * @returns {string} A string representing the project.
3599
3444
  */
3600
3445
  matchProjectFromSampleQueryName(sampleQueryName) {
3601
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3602
- .project;
3446
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3603
3447
  }
3604
3448
  /**
3605
3449
  * Parse the location from SampleQuery resource.
@@ -3609,8 +3453,7 @@ class DocumentServiceClient {
3609
3453
  * @returns {string} A string representing the location.
3610
3454
  */
3611
3455
  matchLocationFromSampleQueryName(sampleQueryName) {
3612
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3613
- .location;
3456
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3614
3457
  }
3615
3458
  /**
3616
3459
  * Parse the sample_query_set from SampleQuery resource.
@@ -3620,8 +3463,7 @@ class DocumentServiceClient {
3620
3463
  * @returns {string} A string representing the sample_query_set.
3621
3464
  */
3622
3465
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3623
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3624
- .sample_query_set;
3466
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3625
3467
  }
3626
3468
  /**
3627
3469
  * Parse the sample_query from SampleQuery resource.
@@ -3631,8 +3473,7 @@ class DocumentServiceClient {
3631
3473
  * @returns {string} A string representing the sample_query.
3632
3474
  */
3633
3475
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3634
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3635
- .sample_query;
3476
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3636
3477
  }
3637
3478
  /**
3638
3479
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3691,8 +3532,8 @@ class DocumentServiceClient {
3691
3532
  this._log.info('ending gRPC channel');
3692
3533
  this._terminated = true;
3693
3534
  stub.close();
3694
- this.locationsClient.close();
3695
- this.operationsClient.close();
3535
+ this.locationsClient.close().catch(err => { throw err; });
3536
+ void this.operationsClient.close();
3696
3537
  });
3697
3538
  }
3698
3539
  return Promise.resolve();