@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
@@ -98,26 +98,17 @@ class CompletionServiceClient {
98
98
  constructor(opts, gaxInstance) {
99
99
  // Ensure that options include all the required fields.
100
100
  const staticMembers = this.constructor;
101
- if (opts?.universe_domain &&
102
- opts?.universeDomain &&
103
- opts?.universe_domain !== opts?.universeDomain) {
101
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
104
102
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
105
103
  }
106
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
107
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
108
- : undefined;
109
- this._universeDomain =
110
- opts?.universeDomain ??
111
- opts?.universe_domain ??
112
- universeDomainEnvVar ??
113
- 'googleapis.com';
104
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
105
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
114
106
  this._servicePath = 'discoveryengine.' + this._universeDomain;
115
107
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
116
108
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
117
109
  const port = opts?.port || staticMembers.port;
118
110
  const clientConfig = opts?.clientConfig ?? {};
119
- const fallback = opts?.fallback ??
120
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
111
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
121
112
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
122
113
  // Request numeric enum values if REST transport is used.
123
114
  opts.numericEnums = true;
@@ -147,7 +138,10 @@ class CompletionServiceClient {
147
138
  }
148
139
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
149
140
  // Determine the client header string.
150
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
141
+ const clientHeader = [
142
+ `gax/${this._gaxModule.version}`,
143
+ `gapic/${version}`,
144
+ ];
151
145
  if (typeof process === 'object' && 'versions' in process) {
152
146
  clientHeader.push(`gl-node/${process.versions.node}`);
153
147
  }
@@ -207,127 +201,22 @@ class CompletionServiceClient {
207
201
  sampleQueryPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}'),
208
202
  sampleQuerySetPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}'),
209
203
  };
210
- const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
204
+ const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
211
205
  // This API contains "long-running operations", which return a
212
206
  // an Operation object that allows for tracking of the operation,
213
207
  // rather than holding a request open.
214
208
  const lroOptions = {
215
209
  auth: this.auth,
216
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
210
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
217
211
  };
218
212
  if (opts.fallback) {
219
213
  lroOptions.protoJson = protoFilesRoot;
220
- lroOptions.httpRules = [
221
- {
222
- selector: 'google.longrunning.Operations.CancelOperation',
223
- post: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
224
- body: '*',
225
- additional_bindings: [
226
- {
227
- post: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
228
- body: '*',
229
- },
230
- ],
231
- },
232
- {
233
- selector: 'google.longrunning.Operations.GetOperation',
234
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
235
- additional_bindings: [
236
- {
237
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
238
- },
239
- {
240
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
241
- },
242
- {
243
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
244
- },
245
- {
246
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
247
- },
248
- {
249
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
250
- },
251
- {
252
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
253
- },
254
- {
255
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
256
- },
257
- {
258
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}',
259
- },
260
- {
261
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
262
- },
263
- {
264
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
265
- },
266
- {
267
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}',
268
- },
269
- {
270
- get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}',
271
- },
272
- {
273
- get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}',
274
- },
275
- { get: '/v1alpha/{name=projects/*/locations/*/operations/*}' },
276
- {
277
- get: '/v1alpha/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
278
- },
279
- { get: '/v1alpha/{name=projects/*/operations/*}' },
280
- ],
281
- },
282
- {
283
- selector: 'google.longrunning.Operations.ListOperations',
284
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
285
- additional_bindings: [
286
- {
287
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
288
- },
289
- {
290
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
291
- },
292
- {
293
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
294
- },
295
- {
296
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
297
- },
298
- {
299
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
300
- },
301
- {
302
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
303
- },
304
- {
305
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations',
306
- },
307
- {
308
- get: '/v1alpha/{name=projects/*/locations/*/collections/*}/operations',
309
- },
310
- {
311
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
312
- },
313
- {
314
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
315
- },
316
- {
317
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations',
318
- },
319
- {
320
- get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*}/operations',
321
- },
322
- { get: '/v1alpha/{name=projects/*/locations/*}/operations' },
323
- { get: '/v1alpha/{name=projects/*}/operations' },
324
- ],
325
- },
326
- ];
214
+ 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: '*', }],
215
+ }, { 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/*}', }],
216
+ }, { 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', }],
217
+ }];
327
218
  }
328
- this.operationsClient = this._gaxModule
329
- .lro(lroOptions)
330
- .operationsClient(opts);
219
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
331
220
  const importSuggestionDenyListEntriesResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse');
332
221
  const importSuggestionDenyListEntriesMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata');
333
222
  const purgeSuggestionDenyListEntriesResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.PurgeSuggestionDenyListEntriesResponse');
@@ -340,7 +229,7 @@ class CompletionServiceClient {
340
229
  importSuggestionDenyListEntries: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importSuggestionDenyListEntriesResponse.decode.bind(importSuggestionDenyListEntriesResponse), importSuggestionDenyListEntriesMetadata.decode.bind(importSuggestionDenyListEntriesMetadata)),
341
230
  purgeSuggestionDenyListEntries: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeSuggestionDenyListEntriesResponse.decode.bind(purgeSuggestionDenyListEntriesResponse), purgeSuggestionDenyListEntriesMetadata.decode.bind(purgeSuggestionDenyListEntriesMetadata)),
342
231
  importCompletionSuggestions: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importCompletionSuggestionsResponse.decode.bind(importCompletionSuggestionsResponse), importCompletionSuggestionsMetadata.decode.bind(importCompletionSuggestionsMetadata)),
343
- purgeCompletionSuggestions: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeCompletionSuggestionsResponse.decode.bind(purgeCompletionSuggestionsResponse), purgeCompletionSuggestionsMetadata.decode.bind(purgeCompletionSuggestionsMetadata)),
232
+ purgeCompletionSuggestions: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeCompletionSuggestionsResponse.decode.bind(purgeCompletionSuggestionsResponse), purgeCompletionSuggestionsMetadata.decode.bind(purgeCompletionSuggestionsMetadata))
344
233
  };
345
234
  // Put together the default options sent with requests.
346
235
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1alpha.CompletionService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -369,20 +258,13 @@ class CompletionServiceClient {
369
258
  }
370
259
  // Put together the "service stub" for
371
260
  // google.cloud.discoveryengine.v1alpha.CompletionService.
372
- this.completionServiceStub = this._gaxGrpc.createStub(this._opts.fallback
373
- ? this._protos.lookupService('google.cloud.discoveryengine.v1alpha.CompletionService')
374
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
375
- this._protos.google.cloud.discoveryengine.v1alpha
376
- .CompletionService, this._opts, this._providedCustomServicePath);
261
+ this.completionServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
262
+ this._protos.lookupService('google.cloud.discoveryengine.v1alpha.CompletionService') :
263
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
264
+ this._protos.google.cloud.discoveryengine.v1alpha.CompletionService, this._opts, this._providedCustomServicePath);
377
265
  // Iterate over each of the methods that the service provides
378
266
  // and create an API call method for each.
379
- const completionServiceStubMethods = [
380
- 'completeQuery',
381
- 'importSuggestionDenyListEntries',
382
- 'purgeSuggestionDenyListEntries',
383
- 'importCompletionSuggestions',
384
- 'purgeCompletionSuggestions',
385
- ];
267
+ const completionServiceStubMethods = ['completeQuery', 'importSuggestionDenyListEntries', 'purgeSuggestionDenyListEntries', 'importCompletionSuggestions', 'purgeCompletionSuggestions'];
386
268
  for (const methodName of completionServiceStubMethods) {
387
269
  const callPromise = this.completionServiceStub.then(stub => (...args) => {
388
270
  if (this._terminated) {
@@ -393,7 +275,8 @@ class CompletionServiceClient {
393
275
  }, (err) => () => {
394
276
  throw err;
395
277
  });
396
- const descriptor = this.descriptors.longrunning[methodName] || undefined;
278
+ const descriptor = this.descriptors.longrunning[methodName] ||
279
+ undefined;
397
280
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
398
281
  this.innerApiCalls[methodName] = apiCall;
399
282
  }
@@ -405,8 +288,7 @@ class CompletionServiceClient {
405
288
  * @returns {string} The DNS address for this service.
406
289
  */
407
290
  static get servicePath() {
408
- if (typeof process === 'object' &&
409
- typeof process.emitWarning === 'function') {
291
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
410
292
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
411
293
  }
412
294
  return 'discoveryengine.googleapis.com';
@@ -417,8 +299,7 @@ class CompletionServiceClient {
417
299
  * @returns {string} The DNS address for this service.
418
300
  */
419
301
  static get apiEndpoint() {
420
- if (typeof process === 'object' &&
421
- typeof process.emitWarning === 'function') {
302
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
422
303
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
423
304
  }
424
305
  return 'discoveryengine.googleapis.com';
@@ -446,7 +327,9 @@ class CompletionServiceClient {
446
327
  * @returns {string[]} List of default scopes.
447
328
  */
448
329
  static get scopes() {
449
- return ['https://www.googleapis.com/auth/cloud-platform'];
330
+ return [
331
+ 'https://www.googleapis.com/auth/cloud-platform'
332
+ ];
450
333
  }
451
334
  /**
452
335
  * Return the project ID used by this class.
@@ -472,13 +355,10 @@ class CompletionServiceClient {
472
355
  options = options || {};
473
356
  options.otherArgs = options.otherArgs || {};
474
357
  options.otherArgs.headers = options.otherArgs.headers || {};
475
- options.otherArgs.headers['x-goog-request-params'] =
476
- this._gaxModule.routingHeader.fromParams({
477
- data_store: request.dataStore ?? '',
478
- });
479
- this.initialize().catch(err => {
480
- throw err;
358
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
359
+ 'data_store': request.dataStore ?? '',
481
360
  });
361
+ this.initialize().catch(err => { throw err; });
482
362
  this._log.info('completeQuery request %j', request);
483
363
  const wrappedCallback = callback
484
364
  ? (error, response, options, rawResponse) => {
@@ -486,11 +366,16 @@ class CompletionServiceClient {
486
366
  callback(error, response, options, rawResponse); // We verified callback above.
487
367
  }
488
368
  : undefined;
489
- return this.innerApiCalls
490
- .completeQuery(request, options, wrappedCallback)
369
+ return this.innerApiCalls.completeQuery(request, options, wrappedCallback)
491
370
  ?.then(([response, options, rawResponse]) => {
492
371
  this._log.info('completeQuery response %j', response);
493
372
  return [response, options, rawResponse];
373
+ }).catch((error) => {
374
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
375
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
376
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
377
+ }
378
+ throw error;
494
379
  });
495
380
  }
496
381
  importSuggestionDenyListEntries(request, optionsOrCallback, callback) {
@@ -506,13 +391,10 @@ class CompletionServiceClient {
506
391
  options = options || {};
507
392
  options.otherArgs = options.otherArgs || {};
508
393
  options.otherArgs.headers = options.otherArgs.headers || {};
509
- options.otherArgs.headers['x-goog-request-params'] =
510
- this._gaxModule.routingHeader.fromParams({
511
- parent: request.parent ?? '',
512
- });
513
- this.initialize().catch(err => {
514
- throw err;
394
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
395
+ 'parent': request.parent ?? '',
515
396
  });
397
+ this.initialize().catch(err => { throw err; });
516
398
  const wrappedCallback = callback
517
399
  ? (error, response, rawResponse, _) => {
518
400
  this._log.info('importSuggestionDenyListEntries response %j', rawResponse);
@@ -520,8 +402,7 @@ class CompletionServiceClient {
520
402
  }
521
403
  : undefined;
522
404
  this._log.info('importSuggestionDenyListEntries request %j', request);
523
- return this.innerApiCalls
524
- .importSuggestionDenyListEntries(request, options, wrappedCallback)
405
+ return this.innerApiCalls.importSuggestionDenyListEntries(request, options, wrappedCallback)
525
406
  ?.then(([response, rawResponse, _]) => {
526
407
  this._log.info('importSuggestionDenyListEntries response %j', rawResponse);
527
408
  return [response, rawResponse, _];
@@ -558,13 +439,10 @@ class CompletionServiceClient {
558
439
  options = options || {};
559
440
  options.otherArgs = options.otherArgs || {};
560
441
  options.otherArgs.headers = options.otherArgs.headers || {};
561
- options.otherArgs.headers['x-goog-request-params'] =
562
- this._gaxModule.routingHeader.fromParams({
563
- parent: request.parent ?? '',
564
- });
565
- this.initialize().catch(err => {
566
- throw err;
442
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
443
+ 'parent': request.parent ?? '',
567
444
  });
445
+ this.initialize().catch(err => { throw err; });
568
446
  const wrappedCallback = callback
569
447
  ? (error, response, rawResponse, _) => {
570
448
  this._log.info('purgeSuggestionDenyListEntries response %j', rawResponse);
@@ -572,8 +450,7 @@ class CompletionServiceClient {
572
450
  }
573
451
  : undefined;
574
452
  this._log.info('purgeSuggestionDenyListEntries request %j', request);
575
- return this.innerApiCalls
576
- .purgeSuggestionDenyListEntries(request, options, wrappedCallback)
453
+ return this.innerApiCalls.purgeSuggestionDenyListEntries(request, options, wrappedCallback)
577
454
  ?.then(([response, rawResponse, _]) => {
578
455
  this._log.info('purgeSuggestionDenyListEntries response %j', rawResponse);
579
456
  return [response, rawResponse, _];
@@ -610,13 +487,10 @@ class CompletionServiceClient {
610
487
  options = options || {};
611
488
  options.otherArgs = options.otherArgs || {};
612
489
  options.otherArgs.headers = options.otherArgs.headers || {};
613
- options.otherArgs.headers['x-goog-request-params'] =
614
- this._gaxModule.routingHeader.fromParams({
615
- parent: request.parent ?? '',
616
- });
617
- this.initialize().catch(err => {
618
- throw err;
490
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
491
+ 'parent': request.parent ?? '',
619
492
  });
493
+ this.initialize().catch(err => { throw err; });
620
494
  const wrappedCallback = callback
621
495
  ? (error, response, rawResponse, _) => {
622
496
  this._log.info('importCompletionSuggestions response %j', rawResponse);
@@ -624,8 +498,7 @@ class CompletionServiceClient {
624
498
  }
625
499
  : undefined;
626
500
  this._log.info('importCompletionSuggestions request %j', request);
627
- return this.innerApiCalls
628
- .importCompletionSuggestions(request, options, wrappedCallback)
501
+ return this.innerApiCalls.importCompletionSuggestions(request, options, wrappedCallback)
629
502
  ?.then(([response, rawResponse, _]) => {
630
503
  this._log.info('importCompletionSuggestions response %j', rawResponse);
631
504
  return [response, rawResponse, _];
@@ -662,13 +535,10 @@ class CompletionServiceClient {
662
535
  options = options || {};
663
536
  options.otherArgs = options.otherArgs || {};
664
537
  options.otherArgs.headers = options.otherArgs.headers || {};
665
- options.otherArgs.headers['x-goog-request-params'] =
666
- this._gaxModule.routingHeader.fromParams({
667
- parent: request.parent ?? '',
668
- });
669
- this.initialize().catch(err => {
670
- throw err;
538
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
539
+ 'parent': request.parent ?? '',
671
540
  });
541
+ this.initialize().catch(err => { throw err; });
672
542
  const wrappedCallback = callback
673
543
  ? (error, response, rawResponse, _) => {
674
544
  this._log.info('purgeCompletionSuggestions response %j', rawResponse);
@@ -676,8 +546,7 @@ class CompletionServiceClient {
676
546
  }
677
547
  : undefined;
678
548
  this._log.info('purgeCompletionSuggestions request %j', request);
679
- return this.innerApiCalls
680
- .purgeCompletionSuggestions(request, options, wrappedCallback)
549
+ return this.innerApiCalls.purgeCompletionSuggestions(request, options, wrappedCallback)
681
550
  ?.then(([response, rawResponse, _]) => {
682
551
  this._log.info('purgeCompletionSuggestions response %j', rawResponse);
683
552
  return [response, rawResponse, _];
@@ -702,90 +571,90 @@ class CompletionServiceClient {
702
571
  return decodeOperation;
703
572
  }
704
573
  /**
705
- * Gets information about a location.
706
- *
707
- * @param {Object} request
708
- * The request object that will be sent.
709
- * @param {string} request.name
710
- * Resource name for the location.
711
- * @param {object} [options]
712
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
713
- * @returns {Promise} - The promise which resolves to an array.
714
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
715
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
716
- * for more details and examples.
717
- * @example
718
- * ```
719
- * const [response] = await client.getLocation(request);
720
- * ```
721
- */
574
+ * Gets information about a location.
575
+ *
576
+ * @param {Object} request
577
+ * The request object that will be sent.
578
+ * @param {string} request.name
579
+ * Resource name for the location.
580
+ * @param {object} [options]
581
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
582
+ * @returns {Promise} - The promise which resolves to an array.
583
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
584
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
585
+ * for more details and examples.
586
+ * @example
587
+ * ```
588
+ * const [response] = await client.getLocation(request);
589
+ * ```
590
+ */
722
591
  getLocation(request, options, callback) {
723
592
  return this.locationsClient.getLocation(request, options, callback);
724
593
  }
725
594
  /**
726
- * Lists information about the supported locations for this service. Returns an iterable object.
727
- *
728
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
729
- * @param {Object} request
730
- * The request object that will be sent.
731
- * @param {string} request.name
732
- * The resource that owns the locations collection, if applicable.
733
- * @param {string} request.filter
734
- * The standard list filter.
735
- * @param {number} request.pageSize
736
- * The standard list page size.
737
- * @param {string} request.pageToken
738
- * The standard list page token.
739
- * @param {object} [options]
740
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
741
- * @returns {Object}
742
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
743
- * When you iterate the returned iterable, each element will be an object representing
744
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
745
- * so you can stop the iteration when you don't need more results.
746
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
747
- * for more details and examples.
748
- * @example
749
- * ```
750
- * const iterable = client.listLocationsAsync(request);
751
- * for await (const response of iterable) {
752
- * // process response
753
- * }
754
- * ```
755
- */
595
+ * Lists information about the supported locations for this service. Returns an iterable object.
596
+ *
597
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
598
+ * @param {Object} request
599
+ * The request object that will be sent.
600
+ * @param {string} request.name
601
+ * The resource that owns the locations collection, if applicable.
602
+ * @param {string} request.filter
603
+ * The standard list filter.
604
+ * @param {number} request.pageSize
605
+ * The standard list page size.
606
+ * @param {string} request.pageToken
607
+ * The standard list page token.
608
+ * @param {object} [options]
609
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
610
+ * @returns {Object}
611
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
612
+ * When you iterate the returned iterable, each element will be an object representing
613
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
614
+ * so you can stop the iteration when you don't need more results.
615
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
616
+ * for more details and examples.
617
+ * @example
618
+ * ```
619
+ * const iterable = client.listLocationsAsync(request);
620
+ * for await (const response of iterable) {
621
+ * // process response
622
+ * }
623
+ * ```
624
+ */
756
625
  listLocationsAsync(request, options) {
757
626
  return this.locationsClient.listLocationsAsync(request, options);
758
627
  }
759
628
  /**
760
- * Gets the latest state of a long-running operation. Clients can use this
761
- * method to poll the operation result at intervals as recommended by the API
762
- * service.
763
- *
764
- * @param {Object} request - The request object that will be sent.
765
- * @param {string} request.name - The name of the operation resource.
766
- * @param {Object=} options
767
- * Optional parameters. You can override the default settings for this call,
768
- * e.g, timeout, retries, paginations, etc. See {@link
769
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
770
- * for the details.
771
- * @param {function(?Error, ?Object)=} callback
772
- * The function which will be called with the result of the API call.
773
- *
774
- * The second parameter to the callback is an object representing
775
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
776
- * @return {Promise} - The promise which resolves to an array.
777
- * The first element of the array is an object representing
778
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
779
- * The promise has a method named "cancel" which cancels the ongoing API call.
780
- *
781
- * @example
782
- * ```
783
- * const client = longrunning.operationsClient();
784
- * const name = '';
785
- * const [response] = await client.getOperation({name});
786
- * // doThingsWith(response)
787
- * ```
788
- */
629
+ * Gets the latest state of a long-running operation. Clients can use this
630
+ * method to poll the operation result at intervals as recommended by the API
631
+ * service.
632
+ *
633
+ * @param {Object} request - The request object that will be sent.
634
+ * @param {string} request.name - The name of the operation resource.
635
+ * @param {Object=} options
636
+ * Optional parameters. You can override the default settings for this call,
637
+ * e.g, timeout, retries, paginations, etc. See {@link
638
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
639
+ * for the details.
640
+ * @param {function(?Error, ?Object)=} callback
641
+ * The function which will be called with the result of the API call.
642
+ *
643
+ * The second parameter to the callback is an object representing
644
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
645
+ * @return {Promise} - The promise which resolves to an array.
646
+ * The first element of the array is an object representing
647
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
648
+ * The promise has a method named "cancel" which cancels the ongoing API call.
649
+ *
650
+ * @example
651
+ * ```
652
+ * const client = longrunning.operationsClient();
653
+ * const name = '';
654
+ * const [response] = await client.getOperation({name});
655
+ * // doThingsWith(response)
656
+ * ```
657
+ */
789
658
  getOperation(request, optionsOrCallback, callback) {
790
659
  let options;
791
660
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -960,8 +829,7 @@ class CompletionServiceClient {
960
829
  * @returns {string} A string representing the project.
961
830
  */
962
831
  matchProjectFromAclConfigName(aclConfigName) {
963
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
964
- .project;
832
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
965
833
  }
966
834
  /**
967
835
  * Parse the location from AclConfig resource.
@@ -971,8 +839,7 @@ class CompletionServiceClient {
971
839
  * @returns {string} A string representing the location.
972
840
  */
973
841
  matchLocationFromAclConfigName(aclConfigName) {
974
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
975
- .location;
842
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
976
843
  }
977
844
  /**
978
845
  * Return a fully-qualified engine resource name string.
@@ -1054,8 +921,7 @@ class CompletionServiceClient {
1054
921
  * @returns {string} A string representing the project.
1055
922
  */
1056
923
  matchProjectFromEvaluationName(evaluationName) {
1057
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1058
- .project;
924
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
1059
925
  }
1060
926
  /**
1061
927
  * Parse the location from Evaluation resource.
@@ -1065,8 +931,7 @@ class CompletionServiceClient {
1065
931
  * @returns {string} A string representing the location.
1066
932
  */
1067
933
  matchLocationFromEvaluationName(evaluationName) {
1068
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1069
- .location;
934
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
1070
935
  }
1071
936
  /**
1072
937
  * Parse the evaluation from Evaluation resource.
@@ -1076,8 +941,7 @@ class CompletionServiceClient {
1076
941
  * @returns {string} A string representing the evaluation.
1077
942
  */
1078
943
  matchEvaluationFromEvaluationName(evaluationName) {
1079
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1080
- .evaluation;
944
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
1081
945
  }
1082
946
  /**
1083
947
  * Return a fully-qualified project resource name string.
@@ -3144,8 +3008,7 @@ class CompletionServiceClient {
3144
3008
  * @returns {string} A string representing the project.
3145
3009
  */
3146
3010
  matchProjectFromSampleQueryName(sampleQueryName) {
3147
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3148
- .project;
3011
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3149
3012
  }
3150
3013
  /**
3151
3014
  * Parse the location from SampleQuery resource.
@@ -3155,8 +3018,7 @@ class CompletionServiceClient {
3155
3018
  * @returns {string} A string representing the location.
3156
3019
  */
3157
3020
  matchLocationFromSampleQueryName(sampleQueryName) {
3158
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3159
- .location;
3021
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3160
3022
  }
3161
3023
  /**
3162
3024
  * Parse the sample_query_set from SampleQuery resource.
@@ -3166,8 +3028,7 @@ class CompletionServiceClient {
3166
3028
  * @returns {string} A string representing the sample_query_set.
3167
3029
  */
3168
3030
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3169
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3170
- .sample_query_set;
3031
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3171
3032
  }
3172
3033
  /**
3173
3034
  * Parse the sample_query from SampleQuery resource.
@@ -3177,8 +3038,7 @@ class CompletionServiceClient {
3177
3038
  * @returns {string} A string representing the sample_query.
3178
3039
  */
3179
3040
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3180
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3181
- .sample_query;
3041
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3182
3042
  }
3183
3043
  /**
3184
3044
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3237,8 +3097,8 @@ class CompletionServiceClient {
3237
3097
  this._log.info('ending gRPC channel');
3238
3098
  this._terminated = true;
3239
3099
  stub.close();
3240
- this.locationsClient.close();
3241
- this.operationsClient.close();
3100
+ this.locationsClient.close().catch(err => { throw err; });
3101
+ void this.operationsClient.close();
3242
3102
  });
3243
3103
  }
3244
3104
  return Promise.resolve();