@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
@@ -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
  }
@@ -215,136 +209,31 @@ class DocumentServiceClient {
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
- listDocuments: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documents'),
212
+ listDocuments: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documents')
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: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
234
- body: '*',
235
- additional_bindings: [
236
- {
237
- post: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
238
- body: '*',
239
- },
240
- ],
241
- },
242
- {
243
- selector: 'google.longrunning.Operations.GetOperation',
244
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
245
- additional_bindings: [
246
- {
247
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
248
- },
249
- {
250
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
251
- },
252
- {
253
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
254
- },
255
- {
256
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
257
- },
258
- {
259
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
260
- },
261
- {
262
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
263
- },
264
- {
265
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
266
- },
267
- {
268
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}',
269
- },
270
- {
271
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
272
- },
273
- {
274
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
275
- },
276
- {
277
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}',
278
- },
279
- {
280
- get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}',
281
- },
282
- {
283
- get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}',
284
- },
285
- { get: '/v1alpha/{name=projects/*/locations/*/operations/*}' },
286
- {
287
- get: '/v1alpha/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
288
- },
289
- { get: '/v1alpha/{name=projects/*/operations/*}' },
290
- ],
291
- },
292
- {
293
- selector: 'google.longrunning.Operations.ListOperations',
294
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
295
- additional_bindings: [
296
- {
297
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
298
- },
299
- {
300
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
301
- },
302
- {
303
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
304
- },
305
- {
306
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
307
- },
308
- {
309
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
310
- },
311
- {
312
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
313
- },
314
- {
315
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations',
316
- },
317
- {
318
- get: '/v1alpha/{name=projects/*/locations/*/collections/*}/operations',
319
- },
320
- {
321
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
322
- },
323
- {
324
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
325
- },
326
- {
327
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations',
328
- },
329
- {
330
- get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*}/operations',
331
- },
332
- { get: '/v1alpha/{name=projects/*/locations/*}/operations' },
333
- { get: '/v1alpha/{name=projects/*}/operations' },
334
- ],
335
- },
336
- ];
224
+ lroOptions.httpRules = [{ selector: 'google.longrunning.Operations.CancelOperation', post: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', additional_bindings: [{ post: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }],
225
+ }, { selector: 'google.longrunning.Operations.GetOperation', get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', additional_bindings: [{ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/operations/*}', }],
226
+ }, { selector: 'google.longrunning.Operations.ListOperations', get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}/operations', additional_bindings: [{ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*}/operations', }, { get: '/v1alpha/{name=projects/*}/operations', }],
227
+ }];
337
228
  }
338
- this.operationsClient = this._gaxModule
339
- .lro(lroOptions)
340
- .operationsClient(opts);
229
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
341
230
  const importDocumentsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse');
342
231
  const importDocumentsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata');
343
232
  const purgeDocumentsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse');
344
233
  const purgeDocumentsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata');
345
234
  this.descriptors.longrunning = {
346
235
  importDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importDocumentsResponse.decode.bind(importDocumentsResponse), importDocumentsMetadata.decode.bind(importDocumentsMetadata)),
347
- purgeDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeDocumentsResponse.decode.bind(purgeDocumentsResponse), purgeDocumentsMetadata.decode.bind(purgeDocumentsMetadata)),
236
+ purgeDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeDocumentsResponse.decode.bind(purgeDocumentsResponse), purgeDocumentsMetadata.decode.bind(purgeDocumentsMetadata))
348
237
  };
349
238
  // Put together the default options sent with requests.
350
239
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1alpha.DocumentService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -373,24 +262,13 @@ class DocumentServiceClient {
373
262
  }
374
263
  // Put together the "service stub" for
375
264
  // google.cloud.discoveryengine.v1alpha.DocumentService.
376
- this.documentServiceStub = this._gaxGrpc.createStub(this._opts.fallback
377
- ? this._protos.lookupService('google.cloud.discoveryengine.v1alpha.DocumentService')
378
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
379
- this._protos.google.cloud.discoveryengine.v1alpha
380
- .DocumentService, this._opts, this._providedCustomServicePath);
265
+ this.documentServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
266
+ this._protos.lookupService('google.cloud.discoveryengine.v1alpha.DocumentService') :
267
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
268
+ this._protos.google.cloud.discoveryengine.v1alpha.DocumentService, this._opts, this._providedCustomServicePath);
381
269
  // Iterate over each of the methods that the service provides
382
270
  // and create an API call method for each.
383
- const documentServiceStubMethods = [
384
- 'getDocument',
385
- 'listDocuments',
386
- 'createDocument',
387
- 'updateDocument',
388
- 'deleteDocument',
389
- 'importDocuments',
390
- 'purgeDocuments',
391
- 'getProcessedDocument',
392
- 'batchGetDocumentsMetadata',
393
- ];
271
+ const documentServiceStubMethods = ['getDocument', 'listDocuments', 'createDocument', 'updateDocument', 'deleteDocument', 'importDocuments', 'purgeDocuments', 'getProcessedDocument', 'batchGetDocumentsMetadata'];
394
272
  for (const methodName of documentServiceStubMethods) {
395
273
  const callPromise = this.documentServiceStub.then(stub => (...args) => {
396
274
  if (this._terminated) {
@@ -415,8 +293,7 @@ class DocumentServiceClient {
415
293
  * @returns {string} The DNS address for this service.
416
294
  */
417
295
  static get servicePath() {
418
- if (typeof process === 'object' &&
419
- typeof process.emitWarning === 'function') {
296
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
420
297
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
421
298
  }
422
299
  return 'discoveryengine.googleapis.com';
@@ -427,8 +304,7 @@ class DocumentServiceClient {
427
304
  * @returns {string} The DNS address for this service.
428
305
  */
429
306
  static get apiEndpoint() {
430
- if (typeof process === 'object' &&
431
- typeof process.emitWarning === 'function') {
307
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
432
308
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
433
309
  }
434
310
  return 'discoveryengine.googleapis.com';
@@ -456,7 +332,9 @@ class DocumentServiceClient {
456
332
  * @returns {string[]} List of default scopes.
457
333
  */
458
334
  static get scopes() {
459
- return ['https://www.googleapis.com/auth/cloud-platform'];
335
+ return [
336
+ 'https://www.googleapis.com/auth/cloud-platform'
337
+ ];
460
338
  }
461
339
  /**
462
340
  * Return the project ID used by this class.
@@ -482,13 +360,10 @@ class DocumentServiceClient {
482
360
  options = options || {};
483
361
  options.otherArgs = options.otherArgs || {};
484
362
  options.otherArgs.headers = options.otherArgs.headers || {};
485
- options.otherArgs.headers['x-goog-request-params'] =
486
- this._gaxModule.routingHeader.fromParams({
487
- name: request.name ?? '',
488
- });
489
- this.initialize().catch(err => {
490
- throw err;
363
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
364
+ 'name': request.name ?? '',
491
365
  });
366
+ this.initialize().catch(err => { throw err; });
492
367
  this._log.info('getDocument request %j', request);
493
368
  const wrappedCallback = callback
494
369
  ? (error, response, options, rawResponse) => {
@@ -496,11 +371,16 @@ class DocumentServiceClient {
496
371
  callback(error, response, options, rawResponse); // We verified callback above.
497
372
  }
498
373
  : undefined;
499
- return this.innerApiCalls
500
- .getDocument(request, options, wrappedCallback)
374
+ return this.innerApiCalls.getDocument(request, options, wrappedCallback)
501
375
  ?.then(([response, options, rawResponse]) => {
502
376
  this._log.info('getDocument response %j', response);
503
377
  return [response, options, rawResponse];
378
+ }).catch((error) => {
379
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
380
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
381
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
382
+ }
383
+ throw error;
504
384
  });
505
385
  }
506
386
  createDocument(request, optionsOrCallback, callback) {
@@ -516,13 +396,10 @@ class DocumentServiceClient {
516
396
  options = options || {};
517
397
  options.otherArgs = options.otherArgs || {};
518
398
  options.otherArgs.headers = options.otherArgs.headers || {};
519
- options.otherArgs.headers['x-goog-request-params'] =
520
- this._gaxModule.routingHeader.fromParams({
521
- parent: request.parent ?? '',
522
- });
523
- this.initialize().catch(err => {
524
- throw err;
399
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
400
+ 'parent': request.parent ?? '',
525
401
  });
402
+ this.initialize().catch(err => { throw err; });
526
403
  this._log.info('createDocument request %j', request);
527
404
  const wrappedCallback = callback
528
405
  ? (error, response, options, rawResponse) => {
@@ -530,11 +407,16 @@ class DocumentServiceClient {
530
407
  callback(error, response, options, rawResponse); // We verified callback above.
531
408
  }
532
409
  : undefined;
533
- return this.innerApiCalls
534
- .createDocument(request, options, wrappedCallback)
410
+ return this.innerApiCalls.createDocument(request, options, wrappedCallback)
535
411
  ?.then(([response, options, rawResponse]) => {
536
412
  this._log.info('createDocument response %j', response);
537
413
  return [response, options, rawResponse];
414
+ }).catch((error) => {
415
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
416
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
417
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
418
+ }
419
+ throw error;
538
420
  });
539
421
  }
540
422
  updateDocument(request, optionsOrCallback, callback) {
@@ -550,13 +432,10 @@ class DocumentServiceClient {
550
432
  options = options || {};
551
433
  options.otherArgs = options.otherArgs || {};
552
434
  options.otherArgs.headers = options.otherArgs.headers || {};
553
- options.otherArgs.headers['x-goog-request-params'] =
554
- this._gaxModule.routingHeader.fromParams({
555
- 'document.name': request.document.name ?? '',
556
- });
557
- this.initialize().catch(err => {
558
- throw err;
435
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
436
+ 'document.name': request.document.name ?? '',
559
437
  });
438
+ this.initialize().catch(err => { throw err; });
560
439
  this._log.info('updateDocument request %j', request);
561
440
  const wrappedCallback = callback
562
441
  ? (error, response, options, rawResponse) => {
@@ -564,11 +443,16 @@ class DocumentServiceClient {
564
443
  callback(error, response, options, rawResponse); // We verified callback above.
565
444
  }
566
445
  : undefined;
567
- return this.innerApiCalls
568
- .updateDocument(request, options, wrappedCallback)
446
+ return this.innerApiCalls.updateDocument(request, options, wrappedCallback)
569
447
  ?.then(([response, options, rawResponse]) => {
570
448
  this._log.info('updateDocument response %j', response);
571
449
  return [response, options, rawResponse];
450
+ }).catch((error) => {
451
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
452
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
453
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
454
+ }
455
+ throw error;
572
456
  });
573
457
  }
574
458
  deleteDocument(request, optionsOrCallback, callback) {
@@ -584,13 +468,10 @@ class DocumentServiceClient {
584
468
  options = options || {};
585
469
  options.otherArgs = options.otherArgs || {};
586
470
  options.otherArgs.headers = options.otherArgs.headers || {};
587
- options.otherArgs.headers['x-goog-request-params'] =
588
- this._gaxModule.routingHeader.fromParams({
589
- name: request.name ?? '',
590
- });
591
- this.initialize().catch(err => {
592
- throw err;
471
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
472
+ 'name': request.name ?? '',
593
473
  });
474
+ this.initialize().catch(err => { throw err; });
594
475
  this._log.info('deleteDocument request %j', request);
595
476
  const wrappedCallback = callback
596
477
  ? (error, response, options, rawResponse) => {
@@ -598,11 +479,16 @@ class DocumentServiceClient {
598
479
  callback(error, response, options, rawResponse); // We verified callback above.
599
480
  }
600
481
  : undefined;
601
- return this.innerApiCalls
602
- .deleteDocument(request, options, wrappedCallback)
482
+ return this.innerApiCalls.deleteDocument(request, options, wrappedCallback)
603
483
  ?.then(([response, options, rawResponse]) => {
604
484
  this._log.info('deleteDocument response %j', response);
605
485
  return [response, options, rawResponse];
486
+ }).catch((error) => {
487
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
488
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
489
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
490
+ }
491
+ throw error;
606
492
  });
607
493
  }
608
494
  getProcessedDocument(request, optionsOrCallback, callback) {
@@ -618,13 +504,10 @@ class DocumentServiceClient {
618
504
  options = options || {};
619
505
  options.otherArgs = options.otherArgs || {};
620
506
  options.otherArgs.headers = options.otherArgs.headers || {};
621
- options.otherArgs.headers['x-goog-request-params'] =
622
- this._gaxModule.routingHeader.fromParams({
623
- name: request.name ?? '',
624
- });
625
- this.initialize().catch(err => {
626
- throw err;
507
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
508
+ 'name': request.name ?? '',
627
509
  });
510
+ this.initialize().catch(err => { throw err; });
628
511
  this._log.info('getProcessedDocument request %j', request);
629
512
  const wrappedCallback = callback
630
513
  ? (error, response, options, rawResponse) => {
@@ -632,11 +515,16 @@ class DocumentServiceClient {
632
515
  callback(error, response, options, rawResponse); // We verified callback above.
633
516
  }
634
517
  : undefined;
635
- return this.innerApiCalls
636
- .getProcessedDocument(request, options, wrappedCallback)
518
+ return this.innerApiCalls.getProcessedDocument(request, options, wrappedCallback)
637
519
  ?.then(([response, options, rawResponse]) => {
638
520
  this._log.info('getProcessedDocument response %j', response);
639
521
  return [response, options, rawResponse];
522
+ }).catch((error) => {
523
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
524
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
525
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
526
+ }
527
+ throw error;
640
528
  });
641
529
  }
642
530
  batchGetDocumentsMetadata(request, optionsOrCallback, callback) {
@@ -652,13 +540,10 @@ class DocumentServiceClient {
652
540
  options = options || {};
653
541
  options.otherArgs = options.otherArgs || {};
654
542
  options.otherArgs.headers = options.otherArgs.headers || {};
655
- options.otherArgs.headers['x-goog-request-params'] =
656
- this._gaxModule.routingHeader.fromParams({
657
- parent: request.parent ?? '',
658
- });
659
- this.initialize().catch(err => {
660
- throw err;
543
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
544
+ 'parent': request.parent ?? '',
661
545
  });
546
+ this.initialize().catch(err => { throw err; });
662
547
  this._log.info('batchGetDocumentsMetadata request %j', request);
663
548
  const wrappedCallback = callback
664
549
  ? (error, response, options, rawResponse) => {
@@ -666,11 +551,16 @@ class DocumentServiceClient {
666
551
  callback(error, response, options, rawResponse); // We verified callback above.
667
552
  }
668
553
  : undefined;
669
- return this.innerApiCalls
670
- .batchGetDocumentsMetadata(request, options, wrappedCallback)
554
+ return this.innerApiCalls.batchGetDocumentsMetadata(request, options, wrappedCallback)
671
555
  ?.then(([response, options, rawResponse]) => {
672
556
  this._log.info('batchGetDocumentsMetadata response %j', response);
673
557
  return [response, options, rawResponse];
558
+ }).catch((error) => {
559
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
560
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
561
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
562
+ }
563
+ throw error;
674
564
  });
675
565
  }
676
566
  importDocuments(request, optionsOrCallback, callback) {
@@ -686,13 +576,10 @@ class DocumentServiceClient {
686
576
  options = options || {};
687
577
  options.otherArgs = options.otherArgs || {};
688
578
  options.otherArgs.headers = options.otherArgs.headers || {};
689
- options.otherArgs.headers['x-goog-request-params'] =
690
- this._gaxModule.routingHeader.fromParams({
691
- parent: request.parent ?? '',
692
- });
693
- this.initialize().catch(err => {
694
- throw err;
579
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
580
+ 'parent': request.parent ?? '',
695
581
  });
582
+ this.initialize().catch(err => { throw err; });
696
583
  const wrappedCallback = callback
697
584
  ? (error, response, rawResponse, _) => {
698
585
  this._log.info('importDocuments response %j', rawResponse);
@@ -700,8 +587,7 @@ class DocumentServiceClient {
700
587
  }
701
588
  : undefined;
702
589
  this._log.info('importDocuments request %j', request);
703
- return this.innerApiCalls
704
- .importDocuments(request, options, wrappedCallback)
590
+ return this.innerApiCalls.importDocuments(request, options, wrappedCallback)
705
591
  ?.then(([response, rawResponse, _]) => {
706
592
  this._log.info('importDocuments response %j', rawResponse);
707
593
  return [response, rawResponse, _];
@@ -738,13 +624,10 @@ class DocumentServiceClient {
738
624
  options = options || {};
739
625
  options.otherArgs = options.otherArgs || {};
740
626
  options.otherArgs.headers = options.otherArgs.headers || {};
741
- options.otherArgs.headers['x-goog-request-params'] =
742
- this._gaxModule.routingHeader.fromParams({
743
- parent: request.parent ?? '',
744
- });
745
- this.initialize().catch(err => {
746
- throw err;
627
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
628
+ 'parent': request.parent ?? '',
747
629
  });
630
+ this.initialize().catch(err => { throw err; });
748
631
  const wrappedCallback = callback
749
632
  ? (error, response, rawResponse, _) => {
750
633
  this._log.info('purgeDocuments response %j', rawResponse);
@@ -752,8 +635,7 @@ class DocumentServiceClient {
752
635
  }
753
636
  : undefined;
754
637
  this._log.info('purgeDocuments request %j', request);
755
- return this.innerApiCalls
756
- .purgeDocuments(request, options, wrappedCallback)
638
+ return this.innerApiCalls.purgeDocuments(request, options, wrappedCallback)
757
639
  ?.then(([response, rawResponse, _]) => {
758
640
  this._log.info('purgeDocuments response %j', rawResponse);
759
641
  return [response, rawResponse, _];
@@ -790,13 +672,10 @@ class DocumentServiceClient {
790
672
  options = options || {};
791
673
  options.otherArgs = options.otherArgs || {};
792
674
  options.otherArgs.headers = options.otherArgs.headers || {};
793
- options.otherArgs.headers['x-goog-request-params'] =
794
- this._gaxModule.routingHeader.fromParams({
795
- parent: request.parent ?? '',
796
- });
797
- this.initialize().catch(err => {
798
- throw err;
675
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
676
+ 'parent': request.parent ?? '',
799
677
  });
678
+ this.initialize().catch(err => { throw err; });
800
679
  const wrappedCallback = callback
801
680
  ? (error, values, nextPageRequest, rawResponse) => {
802
681
  this._log.info('listDocuments values %j', values);
@@ -859,15 +738,12 @@ class DocumentServiceClient {
859
738
  options = options || {};
860
739
  options.otherArgs = options.otherArgs || {};
861
740
  options.otherArgs.headers = options.otherArgs.headers || {};
862
- options.otherArgs.headers['x-goog-request-params'] =
863
- this._gaxModule.routingHeader.fromParams({
864
- parent: request.parent ?? '',
865
- });
741
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
742
+ 'parent': request.parent ?? '',
743
+ });
866
744
  const defaultCallSettings = this._defaults['listDocuments'];
867
745
  const callSettings = defaultCallSettings.merge(options);
868
- this.initialize().catch(err => {
869
- throw err;
870
- });
746
+ this.initialize().catch(err => { throw err; });
871
747
  this._log.info('listDocuments stream %j', request);
872
748
  return this.descriptors.page.listDocuments.createStream(this.innerApiCalls.listDocuments, request, callSettings);
873
749
  }
@@ -922,103 +798,100 @@ class DocumentServiceClient {
922
798
  options = options || {};
923
799
  options.otherArgs = options.otherArgs || {};
924
800
  options.otherArgs.headers = options.otherArgs.headers || {};
925
- options.otherArgs.headers['x-goog-request-params'] =
926
- this._gaxModule.routingHeader.fromParams({
927
- parent: request.parent ?? '',
928
- });
801
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
802
+ 'parent': request.parent ?? '',
803
+ });
929
804
  const defaultCallSettings = this._defaults['listDocuments'];
930
805
  const callSettings = defaultCallSettings.merge(options);
931
- this.initialize().catch(err => {
932
- throw err;
933
- });
806
+ this.initialize().catch(err => { throw err; });
934
807
  this._log.info('listDocuments iterate %j', request);
935
808
  return this.descriptors.page.listDocuments.asyncIterate(this.innerApiCalls['listDocuments'], request, callSettings);
936
809
  }
937
810
  /**
938
- * Gets information about a location.
939
- *
940
- * @param {Object} request
941
- * The request object that will be sent.
942
- * @param {string} request.name
943
- * Resource name for the location.
944
- * @param {object} [options]
945
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
946
- * @returns {Promise} - The promise which resolves to an array.
947
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
948
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
949
- * for more details and examples.
950
- * @example
951
- * ```
952
- * const [response] = await client.getLocation(request);
953
- * ```
954
- */
811
+ * Gets information about a location.
812
+ *
813
+ * @param {Object} request
814
+ * The request object that will be sent.
815
+ * @param {string} request.name
816
+ * Resource name for the location.
817
+ * @param {object} [options]
818
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
819
+ * @returns {Promise} - The promise which resolves to an array.
820
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
821
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
822
+ * for more details and examples.
823
+ * @example
824
+ * ```
825
+ * const [response] = await client.getLocation(request);
826
+ * ```
827
+ */
955
828
  getLocation(request, options, callback) {
956
829
  return this.locationsClient.getLocation(request, options, callback);
957
830
  }
958
831
  /**
959
- * Lists information about the supported locations for this service. Returns an iterable object.
960
- *
961
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
962
- * @param {Object} request
963
- * The request object that will be sent.
964
- * @param {string} request.name
965
- * The resource that owns the locations collection, if applicable.
966
- * @param {string} request.filter
967
- * The standard list filter.
968
- * @param {number} request.pageSize
969
- * The standard list page size.
970
- * @param {string} request.pageToken
971
- * The standard list page token.
972
- * @param {object} [options]
973
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
974
- * @returns {Object}
975
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
976
- * When you iterate the returned iterable, each element will be an object representing
977
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
978
- * so you can stop the iteration when you don't need more results.
979
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
980
- * for more details and examples.
981
- * @example
982
- * ```
983
- * const iterable = client.listLocationsAsync(request);
984
- * for await (const response of iterable) {
985
- * // process response
986
- * }
987
- * ```
988
- */
832
+ * Lists information about the supported locations for this service. Returns an iterable object.
833
+ *
834
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
835
+ * @param {Object} request
836
+ * The request object that will be sent.
837
+ * @param {string} request.name
838
+ * The resource that owns the locations collection, if applicable.
839
+ * @param {string} request.filter
840
+ * The standard list filter.
841
+ * @param {number} request.pageSize
842
+ * The standard list page size.
843
+ * @param {string} request.pageToken
844
+ * The standard list page token.
845
+ * @param {object} [options]
846
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
847
+ * @returns {Object}
848
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
849
+ * When you iterate the returned iterable, each element will be an object representing
850
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
851
+ * so you can stop the iteration when you don't need more results.
852
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
853
+ * for more details and examples.
854
+ * @example
855
+ * ```
856
+ * const iterable = client.listLocationsAsync(request);
857
+ * for await (const response of iterable) {
858
+ * // process response
859
+ * }
860
+ * ```
861
+ */
989
862
  listLocationsAsync(request, options) {
990
863
  return this.locationsClient.listLocationsAsync(request, options);
991
864
  }
992
865
  /**
993
- * Gets the latest state of a long-running operation. Clients can use this
994
- * method to poll the operation result at intervals as recommended by the API
995
- * service.
996
- *
997
- * @param {Object} request - The request object that will be sent.
998
- * @param {string} request.name - The name of the operation resource.
999
- * @param {Object=} options
1000
- * Optional parameters. You can override the default settings for this call,
1001
- * e.g, timeout, retries, paginations, etc. See {@link
1002
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
1003
- * for the details.
1004
- * @param {function(?Error, ?Object)=} callback
1005
- * The function which will be called with the result of the API call.
1006
- *
1007
- * The second parameter to the callback is an object representing
1008
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
1009
- * @return {Promise} - The promise which resolves to an array.
1010
- * The first element of the array is an object representing
1011
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
1012
- * The promise has a method named "cancel" which cancels the ongoing API call.
1013
- *
1014
- * @example
1015
- * ```
1016
- * const client = longrunning.operationsClient();
1017
- * const name = '';
1018
- * const [response] = await client.getOperation({name});
1019
- * // doThingsWith(response)
1020
- * ```
1021
- */
866
+ * Gets the latest state of a long-running operation. Clients can use this
867
+ * method to poll the operation result at intervals as recommended by the API
868
+ * service.
869
+ *
870
+ * @param {Object} request - The request object that will be sent.
871
+ * @param {string} request.name - The name of the operation resource.
872
+ * @param {Object=} options
873
+ * Optional parameters. You can override the default settings for this call,
874
+ * e.g, timeout, retries, paginations, etc. See {@link
875
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
876
+ * for the details.
877
+ * @param {function(?Error, ?Object)=} callback
878
+ * The function which will be called with the result of the API call.
879
+ *
880
+ * The second parameter to the callback is an object representing
881
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
882
+ * @return {Promise} - The promise which resolves to an array.
883
+ * The first element of the array is an object representing
884
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
885
+ * The promise has a method named "cancel" which cancels the ongoing API call.
886
+ *
887
+ * @example
888
+ * ```
889
+ * const client = longrunning.operationsClient();
890
+ * const name = '';
891
+ * const [response] = await client.getOperation({name});
892
+ * // doThingsWith(response)
893
+ * ```
894
+ */
1022
895
  getOperation(request, optionsOrCallback, callback) {
1023
896
  let options;
1024
897
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1193,8 +1066,7 @@ class DocumentServiceClient {
1193
1066
  * @returns {string} A string representing the project.
1194
1067
  */
1195
1068
  matchProjectFromAclConfigName(aclConfigName) {
1196
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
1197
- .project;
1069
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
1198
1070
  }
1199
1071
  /**
1200
1072
  * Parse the location from AclConfig resource.
@@ -1204,8 +1076,7 @@ class DocumentServiceClient {
1204
1076
  * @returns {string} A string representing the location.
1205
1077
  */
1206
1078
  matchLocationFromAclConfigName(aclConfigName) {
1207
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
1208
- .location;
1079
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
1209
1080
  }
1210
1081
  /**
1211
1082
  * Return a fully-qualified engine resource name string.
@@ -1287,8 +1158,7 @@ class DocumentServiceClient {
1287
1158
  * @returns {string} A string representing the project.
1288
1159
  */
1289
1160
  matchProjectFromEvaluationName(evaluationName) {
1290
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1291
- .project;
1161
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
1292
1162
  }
1293
1163
  /**
1294
1164
  * Parse the location from Evaluation resource.
@@ -1298,8 +1168,7 @@ class DocumentServiceClient {
1298
1168
  * @returns {string} A string representing the location.
1299
1169
  */
1300
1170
  matchLocationFromEvaluationName(evaluationName) {
1301
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1302
- .location;
1171
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
1303
1172
  }
1304
1173
  /**
1305
1174
  * Parse the evaluation from Evaluation resource.
@@ -1309,8 +1178,7 @@ class DocumentServiceClient {
1309
1178
  * @returns {string} A string representing the evaluation.
1310
1179
  */
1311
1180
  matchEvaluationFromEvaluationName(evaluationName) {
1312
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1313
- .evaluation;
1181
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
1314
1182
  }
1315
1183
  /**
1316
1184
  * Return a fully-qualified project resource name string.
@@ -3503,8 +3371,7 @@ class DocumentServiceClient {
3503
3371
  * @returns {string} A string representing the project.
3504
3372
  */
3505
3373
  matchProjectFromSampleQueryName(sampleQueryName) {
3506
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3507
- .project;
3374
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3508
3375
  }
3509
3376
  /**
3510
3377
  * Parse the location from SampleQuery resource.
@@ -3514,8 +3381,7 @@ class DocumentServiceClient {
3514
3381
  * @returns {string} A string representing the location.
3515
3382
  */
3516
3383
  matchLocationFromSampleQueryName(sampleQueryName) {
3517
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3518
- .location;
3384
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3519
3385
  }
3520
3386
  /**
3521
3387
  * Parse the sample_query_set from SampleQuery resource.
@@ -3525,8 +3391,7 @@ class DocumentServiceClient {
3525
3391
  * @returns {string} A string representing the sample_query_set.
3526
3392
  */
3527
3393
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3528
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3529
- .sample_query_set;
3394
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3530
3395
  }
3531
3396
  /**
3532
3397
  * Parse the sample_query from SampleQuery resource.
@@ -3536,8 +3401,7 @@ class DocumentServiceClient {
3536
3401
  * @returns {string} A string representing the sample_query.
3537
3402
  */
3538
3403
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3539
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3540
- .sample_query;
3404
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3541
3405
  }
3542
3406
  /**
3543
3407
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3596,8 +3460,8 @@ class DocumentServiceClient {
3596
3460
  this._log.info('ending gRPC channel');
3597
3461
  this._terminated = true;
3598
3462
  stub.close();
3599
- this.locationsClient.close();
3600
- this.operationsClient.close();
3463
+ this.locationsClient.close().catch(err => { throw err; });
3464
+ void this.operationsClient.close();
3601
3465
  });
3602
3466
  }
3603
3467
  return Promise.resolve();