@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
  }
@@ -212,121 +206,22 @@ class CompletionServiceClient {
212
206
  sampleQueryPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}'),
213
207
  sampleQuerySetPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}'),
214
208
  };
215
- const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
209
+ const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
216
210
  // This API contains "long-running operations", which return a
217
211
  // an Operation object that allows for tracking of the operation,
218
212
  // rather than holding a request open.
219
213
  const lroOptions = {
220
214
  auth: this.auth,
221
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
215
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
222
216
  };
223
217
  if (opts.fallback) {
224
218
  lroOptions.protoJson = protoFilesRoot;
225
- lroOptions.httpRules = [
226
- {
227
- selector: 'google.longrunning.Operations.CancelOperation',
228
- post: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
229
- body: '*',
230
- additional_bindings: [
231
- {
232
- post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
233
- body: '*',
234
- },
235
- ],
236
- },
237
- {
238
- selector: 'google.longrunning.Operations.GetOperation',
239
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
240
- additional_bindings: [
241
- {
242
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
243
- },
244
- {
245
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
246
- },
247
- {
248
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
249
- },
250
- {
251
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
252
- },
253
- {
254
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
255
- },
256
- {
257
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
258
- },
259
- {
260
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
261
- },
262
- {
263
- get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}',
264
- },
265
- {
266
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
267
- },
268
- {
269
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
270
- },
271
- {
272
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}',
273
- },
274
- {
275
- get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}',
276
- },
277
- { get: '/v1beta/{name=projects/*/locations/*/operations/*}' },
278
- {
279
- get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
280
- },
281
- { get: '/v1beta/{name=projects/*/operations/*}' },
282
- ],
283
- },
284
- {
285
- selector: 'google.longrunning.Operations.ListOperations',
286
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
287
- additional_bindings: [
288
- {
289
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
290
- },
291
- {
292
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
293
- },
294
- {
295
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
296
- },
297
- {
298
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
299
- },
300
- {
301
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
302
- },
303
- {
304
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
305
- },
306
- {
307
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations',
308
- },
309
- {
310
- get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations',
311
- },
312
- {
313
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
314
- },
315
- {
316
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
317
- },
318
- {
319
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations',
320
- },
321
- { get: '/v1beta/{name=projects/*/locations/*}/operations' },
322
- { get: '/v1beta/{name=projects/*}/operations' },
323
- ],
324
- },
325
- ];
219
+ lroOptions.httpRules = [{ selector: 'google.longrunning.Operations.CancelOperation', post: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', additional_bindings: [{ post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }],
220
+ }, { selector: 'google.longrunning.Operations.GetOperation', get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', additional_bindings: [{ get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}', }, { get: '/v1beta/{name=projects/*/operations/*}', }],
221
+ }, { selector: 'google.longrunning.Operations.ListOperations', get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations', additional_bindings: [{ get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*}/operations', }, { get: '/v1beta/{name=projects/*}/operations', }],
222
+ }];
326
223
  }
327
- this.operationsClient = this._gaxModule
328
- .lro(lroOptions)
329
- .operationsClient(opts);
224
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
330
225
  const importSuggestionDenyListEntriesResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.ImportSuggestionDenyListEntriesResponse');
331
226
  const importSuggestionDenyListEntriesMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.ImportSuggestionDenyListEntriesMetadata');
332
227
  const purgeSuggestionDenyListEntriesResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.PurgeSuggestionDenyListEntriesResponse');
@@ -339,7 +234,7 @@ class CompletionServiceClient {
339
234
  importSuggestionDenyListEntries: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importSuggestionDenyListEntriesResponse.decode.bind(importSuggestionDenyListEntriesResponse), importSuggestionDenyListEntriesMetadata.decode.bind(importSuggestionDenyListEntriesMetadata)),
340
235
  purgeSuggestionDenyListEntries: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeSuggestionDenyListEntriesResponse.decode.bind(purgeSuggestionDenyListEntriesResponse), purgeSuggestionDenyListEntriesMetadata.decode.bind(purgeSuggestionDenyListEntriesMetadata)),
341
236
  importCompletionSuggestions: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importCompletionSuggestionsResponse.decode.bind(importCompletionSuggestionsResponse), importCompletionSuggestionsMetadata.decode.bind(importCompletionSuggestionsMetadata)),
342
- purgeCompletionSuggestions: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeCompletionSuggestionsResponse.decode.bind(purgeCompletionSuggestionsResponse), purgeCompletionSuggestionsMetadata.decode.bind(purgeCompletionSuggestionsMetadata)),
237
+ purgeCompletionSuggestions: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeCompletionSuggestionsResponse.decode.bind(purgeCompletionSuggestionsResponse), purgeCompletionSuggestionsMetadata.decode.bind(purgeCompletionSuggestionsMetadata))
343
238
  };
344
239
  // Put together the default options sent with requests.
345
240
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.CompletionService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -368,21 +263,13 @@ class CompletionServiceClient {
368
263
  }
369
264
  // Put together the "service stub" for
370
265
  // google.cloud.discoveryengine.v1beta.CompletionService.
371
- this.completionServiceStub = this._gaxGrpc.createStub(this._opts.fallback
372
- ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.CompletionService')
373
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
374
- this._protos.google.cloud.discoveryengine.v1beta
375
- .CompletionService, this._opts, this._providedCustomServicePath);
266
+ this.completionServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
267
+ this._protos.lookupService('google.cloud.discoveryengine.v1beta.CompletionService') :
268
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
269
+ this._protos.google.cloud.discoveryengine.v1beta.CompletionService, this._opts, this._providedCustomServicePath);
376
270
  // Iterate over each of the methods that the service provides
377
271
  // and create an API call method for each.
378
- const completionServiceStubMethods = [
379
- 'completeQuery',
380
- 'advancedCompleteQuery',
381
- 'importSuggestionDenyListEntries',
382
- 'purgeSuggestionDenyListEntries',
383
- 'importCompletionSuggestions',
384
- 'purgeCompletionSuggestions',
385
- ];
272
+ const completionServiceStubMethods = ['completeQuery', 'advancedCompleteQuery', 'importSuggestionDenyListEntries', 'purgeSuggestionDenyListEntries', 'importCompletionSuggestions', 'purgeCompletionSuggestions'];
386
273
  for (const methodName of completionServiceStubMethods) {
387
274
  const callPromise = this.completionServiceStub.then(stub => (...args) => {
388
275
  if (this._terminated) {
@@ -393,7 +280,8 @@ class CompletionServiceClient {
393
280
  }, (err) => () => {
394
281
  throw err;
395
282
  });
396
- const descriptor = this.descriptors.longrunning[methodName] || undefined;
283
+ const descriptor = this.descriptors.longrunning[methodName] ||
284
+ undefined;
397
285
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
398
286
  this.innerApiCalls[methodName] = apiCall;
399
287
  }
@@ -405,8 +293,7 @@ class CompletionServiceClient {
405
293
  * @returns {string} The DNS address for this service.
406
294
  */
407
295
  static get servicePath() {
408
- if (typeof process === 'object' &&
409
- typeof process.emitWarning === 'function') {
296
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
410
297
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
411
298
  }
412
299
  return 'discoveryengine.googleapis.com';
@@ -417,8 +304,7 @@ class CompletionServiceClient {
417
304
  * @returns {string} The DNS address for this service.
418
305
  */
419
306
  static get apiEndpoint() {
420
- if (typeof process === 'object' &&
421
- typeof process.emitWarning === 'function') {
307
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
422
308
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
423
309
  }
424
310
  return 'discoveryengine.googleapis.com';
@@ -446,7 +332,9 @@ class CompletionServiceClient {
446
332
  * @returns {string[]} List of default scopes.
447
333
  */
448
334
  static get scopes() {
449
- return ['https://www.googleapis.com/auth/cloud-platform'];
335
+ return [
336
+ 'https://www.googleapis.com/auth/cloud-platform'
337
+ ];
450
338
  }
451
339
  /**
452
340
  * Return the project ID used by this class.
@@ -472,13 +360,10 @@ class CompletionServiceClient {
472
360
  options = options || {};
473
361
  options.otherArgs = options.otherArgs || {};
474
362
  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;
363
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
364
+ 'data_store': request.dataStore ?? '',
481
365
  });
366
+ this.initialize().catch(err => { throw err; });
482
367
  this._log.info('completeQuery request %j', request);
483
368
  const wrappedCallback = callback
484
369
  ? (error, response, options, rawResponse) => {
@@ -486,11 +371,16 @@ class CompletionServiceClient {
486
371
  callback(error, response, options, rawResponse); // We verified callback above.
487
372
  }
488
373
  : undefined;
489
- return this.innerApiCalls
490
- .completeQuery(request, options, wrappedCallback)
374
+ return this.innerApiCalls.completeQuery(request, options, wrappedCallback)
491
375
  ?.then(([response, options, rawResponse]) => {
492
376
  this._log.info('completeQuery response %j', response);
493
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;
494
384
  });
495
385
  }
496
386
  advancedCompleteQuery(request, optionsOrCallback, callback) {
@@ -506,13 +396,10 @@ class CompletionServiceClient {
506
396
  options = options || {};
507
397
  options.otherArgs = options.otherArgs || {};
508
398
  options.otherArgs.headers = options.otherArgs.headers || {};
509
- options.otherArgs.headers['x-goog-request-params'] =
510
- this._gaxModule.routingHeader.fromParams({
511
- completion_config: request.completionConfig ?? '',
512
- });
513
- this.initialize().catch(err => {
514
- throw err;
399
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
400
+ 'completion_config': request.completionConfig ?? '',
515
401
  });
402
+ this.initialize().catch(err => { throw err; });
516
403
  this._log.info('advancedCompleteQuery request %j', request);
517
404
  const wrappedCallback = callback
518
405
  ? (error, response, options, rawResponse) => {
@@ -520,11 +407,16 @@ class CompletionServiceClient {
520
407
  callback(error, response, options, rawResponse); // We verified callback above.
521
408
  }
522
409
  : undefined;
523
- return this.innerApiCalls
524
- .advancedCompleteQuery(request, options, wrappedCallback)
410
+ return this.innerApiCalls.advancedCompleteQuery(request, options, wrappedCallback)
525
411
  ?.then(([response, options, rawResponse]) => {
526
412
  this._log.info('advancedCompleteQuery response %j', response);
527
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;
528
420
  });
529
421
  }
530
422
  importSuggestionDenyListEntries(request, optionsOrCallback, callback) {
@@ -540,13 +432,10 @@ class CompletionServiceClient {
540
432
  options = options || {};
541
433
  options.otherArgs = options.otherArgs || {};
542
434
  options.otherArgs.headers = options.otherArgs.headers || {};
543
- options.otherArgs.headers['x-goog-request-params'] =
544
- this._gaxModule.routingHeader.fromParams({
545
- parent: request.parent ?? '',
546
- });
547
- this.initialize().catch(err => {
548
- throw err;
435
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
436
+ 'parent': request.parent ?? '',
549
437
  });
438
+ this.initialize().catch(err => { throw err; });
550
439
  const wrappedCallback = callback
551
440
  ? (error, response, rawResponse, _) => {
552
441
  this._log.info('importSuggestionDenyListEntries response %j', rawResponse);
@@ -554,8 +443,7 @@ class CompletionServiceClient {
554
443
  }
555
444
  : undefined;
556
445
  this._log.info('importSuggestionDenyListEntries request %j', request);
557
- return this.innerApiCalls
558
- .importSuggestionDenyListEntries(request, options, wrappedCallback)
446
+ return this.innerApiCalls.importSuggestionDenyListEntries(request, options, wrappedCallback)
559
447
  ?.then(([response, rawResponse, _]) => {
560
448
  this._log.info('importSuggestionDenyListEntries response %j', rawResponse);
561
449
  return [response, rawResponse, _];
@@ -592,13 +480,10 @@ class CompletionServiceClient {
592
480
  options = options || {};
593
481
  options.otherArgs = options.otherArgs || {};
594
482
  options.otherArgs.headers = options.otherArgs.headers || {};
595
- options.otherArgs.headers['x-goog-request-params'] =
596
- this._gaxModule.routingHeader.fromParams({
597
- parent: request.parent ?? '',
598
- });
599
- this.initialize().catch(err => {
600
- throw err;
483
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
484
+ 'parent': request.parent ?? '',
601
485
  });
486
+ this.initialize().catch(err => { throw err; });
602
487
  const wrappedCallback = callback
603
488
  ? (error, response, rawResponse, _) => {
604
489
  this._log.info('purgeSuggestionDenyListEntries response %j', rawResponse);
@@ -606,8 +491,7 @@ class CompletionServiceClient {
606
491
  }
607
492
  : undefined;
608
493
  this._log.info('purgeSuggestionDenyListEntries request %j', request);
609
- return this.innerApiCalls
610
- .purgeSuggestionDenyListEntries(request, options, wrappedCallback)
494
+ return this.innerApiCalls.purgeSuggestionDenyListEntries(request, options, wrappedCallback)
611
495
  ?.then(([response, rawResponse, _]) => {
612
496
  this._log.info('purgeSuggestionDenyListEntries response %j', rawResponse);
613
497
  return [response, rawResponse, _];
@@ -644,13 +528,10 @@ class CompletionServiceClient {
644
528
  options = options || {};
645
529
  options.otherArgs = options.otherArgs || {};
646
530
  options.otherArgs.headers = options.otherArgs.headers || {};
647
- options.otherArgs.headers['x-goog-request-params'] =
648
- this._gaxModule.routingHeader.fromParams({
649
- parent: request.parent ?? '',
650
- });
651
- this.initialize().catch(err => {
652
- throw err;
531
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
532
+ 'parent': request.parent ?? '',
653
533
  });
534
+ this.initialize().catch(err => { throw err; });
654
535
  const wrappedCallback = callback
655
536
  ? (error, response, rawResponse, _) => {
656
537
  this._log.info('importCompletionSuggestions response %j', rawResponse);
@@ -658,8 +539,7 @@ class CompletionServiceClient {
658
539
  }
659
540
  : undefined;
660
541
  this._log.info('importCompletionSuggestions request %j', request);
661
- return this.innerApiCalls
662
- .importCompletionSuggestions(request, options, wrappedCallback)
542
+ return this.innerApiCalls.importCompletionSuggestions(request, options, wrappedCallback)
663
543
  ?.then(([response, rawResponse, _]) => {
664
544
  this._log.info('importCompletionSuggestions response %j', rawResponse);
665
545
  return [response, rawResponse, _];
@@ -696,13 +576,10 @@ class CompletionServiceClient {
696
576
  options = options || {};
697
577
  options.otherArgs = options.otherArgs || {};
698
578
  options.otherArgs.headers = options.otherArgs.headers || {};
699
- options.otherArgs.headers['x-goog-request-params'] =
700
- this._gaxModule.routingHeader.fromParams({
701
- parent: request.parent ?? '',
702
- });
703
- this.initialize().catch(err => {
704
- throw err;
579
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
580
+ 'parent': request.parent ?? '',
705
581
  });
582
+ this.initialize().catch(err => { throw err; });
706
583
  const wrappedCallback = callback
707
584
  ? (error, response, rawResponse, _) => {
708
585
  this._log.info('purgeCompletionSuggestions response %j', rawResponse);
@@ -710,8 +587,7 @@ class CompletionServiceClient {
710
587
  }
711
588
  : undefined;
712
589
  this._log.info('purgeCompletionSuggestions request %j', request);
713
- return this.innerApiCalls
714
- .purgeCompletionSuggestions(request, options, wrappedCallback)
590
+ return this.innerApiCalls.purgeCompletionSuggestions(request, options, wrappedCallback)
715
591
  ?.then(([response, rawResponse, _]) => {
716
592
  this._log.info('purgeCompletionSuggestions response %j', rawResponse);
717
593
  return [response, rawResponse, _];
@@ -736,90 +612,90 @@ class CompletionServiceClient {
736
612
  return decodeOperation;
737
613
  }
738
614
  /**
739
- * Gets information about a location.
740
- *
741
- * @param {Object} request
742
- * The request object that will be sent.
743
- * @param {string} request.name
744
- * Resource name for the location.
745
- * @param {object} [options]
746
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
747
- * @returns {Promise} - The promise which resolves to an array.
748
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
749
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
750
- * for more details and examples.
751
- * @example
752
- * ```
753
- * const [response] = await client.getLocation(request);
754
- * ```
755
- */
615
+ * Gets information about a location.
616
+ *
617
+ * @param {Object} request
618
+ * The request object that will be sent.
619
+ * @param {string} request.name
620
+ * Resource name for the location.
621
+ * @param {object} [options]
622
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
623
+ * @returns {Promise} - The promise which resolves to an array.
624
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
625
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
626
+ * for more details and examples.
627
+ * @example
628
+ * ```
629
+ * const [response] = await client.getLocation(request);
630
+ * ```
631
+ */
756
632
  getLocation(request, options, callback) {
757
633
  return this.locationsClient.getLocation(request, options, callback);
758
634
  }
759
635
  /**
760
- * Lists information about the supported locations for this service. Returns an iterable object.
761
- *
762
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
763
- * @param {Object} request
764
- * The request object that will be sent.
765
- * @param {string} request.name
766
- * The resource that owns the locations collection, if applicable.
767
- * @param {string} request.filter
768
- * The standard list filter.
769
- * @param {number} request.pageSize
770
- * The standard list page size.
771
- * @param {string} request.pageToken
772
- * The standard list page token.
773
- * @param {object} [options]
774
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
775
- * @returns {Object}
776
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
777
- * When you iterate the returned iterable, each element will be an object representing
778
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
779
- * so you can stop the iteration when you don't need more results.
780
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
781
- * for more details and examples.
782
- * @example
783
- * ```
784
- * const iterable = client.listLocationsAsync(request);
785
- * for await (const response of iterable) {
786
- * // process response
787
- * }
788
- * ```
789
- */
636
+ * Lists information about the supported locations for this service. Returns an iterable object.
637
+ *
638
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
639
+ * @param {Object} request
640
+ * The request object that will be sent.
641
+ * @param {string} request.name
642
+ * The resource that owns the locations collection, if applicable.
643
+ * @param {string} request.filter
644
+ * The standard list filter.
645
+ * @param {number} request.pageSize
646
+ * The standard list page size.
647
+ * @param {string} request.pageToken
648
+ * The standard list page token.
649
+ * @param {object} [options]
650
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
651
+ * @returns {Object}
652
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
653
+ * When you iterate the returned iterable, each element will be an object representing
654
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
655
+ * so you can stop the iteration when you don't need more results.
656
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
657
+ * for more details and examples.
658
+ * @example
659
+ * ```
660
+ * const iterable = client.listLocationsAsync(request);
661
+ * for await (const response of iterable) {
662
+ * // process response
663
+ * }
664
+ * ```
665
+ */
790
666
  listLocationsAsync(request, options) {
791
667
  return this.locationsClient.listLocationsAsync(request, options);
792
668
  }
793
669
  /**
794
- * Gets the latest state of a long-running operation. Clients can use this
795
- * method to poll the operation result at intervals as recommended by the API
796
- * service.
797
- *
798
- * @param {Object} request - The request object that will be sent.
799
- * @param {string} request.name - The name of the operation resource.
800
- * @param {Object=} options
801
- * Optional parameters. You can override the default settings for this call,
802
- * e.g, timeout, retries, paginations, etc. See {@link
803
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
804
- * for the details.
805
- * @param {function(?Error, ?Object)=} callback
806
- * The function which will be called with the result of the API call.
807
- *
808
- * The second parameter to the callback is an object representing
809
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
810
- * @return {Promise} - The promise which resolves to an array.
811
- * The first element of the array is an object representing
812
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
813
- * The promise has a method named "cancel" which cancels the ongoing API call.
814
- *
815
- * @example
816
- * ```
817
- * const client = longrunning.operationsClient();
818
- * const name = '';
819
- * const [response] = await client.getOperation({name});
820
- * // doThingsWith(response)
821
- * ```
822
- */
670
+ * Gets the latest state of a long-running operation. Clients can use this
671
+ * method to poll the operation result at intervals as recommended by the API
672
+ * service.
673
+ *
674
+ * @param {Object} request - The request object that will be sent.
675
+ * @param {string} request.name - The name of the operation resource.
676
+ * @param {Object=} options
677
+ * Optional parameters. You can override the default settings for this call,
678
+ * e.g, timeout, retries, paginations, etc. See {@link
679
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
680
+ * for the details.
681
+ * @param {function(?Error, ?Object)=} callback
682
+ * The function which will be called with the result of the API call.
683
+ *
684
+ * The second parameter to the callback is an object representing
685
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
686
+ * @return {Promise} - The promise which resolves to an array.
687
+ * The first element of the array is an object representing
688
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
689
+ * The promise has a method named "cancel" which cancels the ongoing API call.
690
+ *
691
+ * @example
692
+ * ```
693
+ * const client = longrunning.operationsClient();
694
+ * const name = '';
695
+ * const [response] = await client.getOperation({name});
696
+ * // doThingsWith(response)
697
+ * ```
698
+ */
823
699
  getOperation(request, optionsOrCallback, callback) {
824
700
  let options;
825
701
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1053,8 +929,7 @@ class CompletionServiceClient {
1053
929
  * @returns {string} A string representing the project.
1054
930
  */
1055
931
  matchProjectFromEvaluationName(evaluationName) {
1056
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1057
- .project;
932
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
1058
933
  }
1059
934
  /**
1060
935
  * Parse the location from Evaluation resource.
@@ -1064,8 +939,7 @@ class CompletionServiceClient {
1064
939
  * @returns {string} A string representing the location.
1065
940
  */
1066
941
  matchLocationFromEvaluationName(evaluationName) {
1067
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1068
- .location;
942
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
1069
943
  }
1070
944
  /**
1071
945
  * Parse the evaluation from Evaluation resource.
@@ -1075,8 +949,7 @@ class CompletionServiceClient {
1075
949
  * @returns {string} A string representing the evaluation.
1076
950
  */
1077
951
  matchEvaluationFromEvaluationName(evaluationName) {
1078
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1079
- .evaluation;
952
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
1080
953
  }
1081
954
  /**
1082
955
  * Return a fully-qualified groundingConfig resource name string.
@@ -3473,8 +3346,7 @@ class CompletionServiceClient {
3473
3346
  * @returns {string} A string representing the project.
3474
3347
  */
3475
3348
  matchProjectFromSampleQueryName(sampleQueryName) {
3476
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3477
- .project;
3349
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3478
3350
  }
3479
3351
  /**
3480
3352
  * Parse the location from SampleQuery resource.
@@ -3484,8 +3356,7 @@ class CompletionServiceClient {
3484
3356
  * @returns {string} A string representing the location.
3485
3357
  */
3486
3358
  matchLocationFromSampleQueryName(sampleQueryName) {
3487
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3488
- .location;
3359
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3489
3360
  }
3490
3361
  /**
3491
3362
  * Parse the sample_query_set from SampleQuery resource.
@@ -3495,8 +3366,7 @@ class CompletionServiceClient {
3495
3366
  * @returns {string} A string representing the sample_query_set.
3496
3367
  */
3497
3368
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3498
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3499
- .sample_query_set;
3369
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3500
3370
  }
3501
3371
  /**
3502
3372
  * Parse the sample_query from SampleQuery resource.
@@ -3506,8 +3376,7 @@ class CompletionServiceClient {
3506
3376
  * @returns {string} A string representing the sample_query.
3507
3377
  */
3508
3378
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3509
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3510
- .sample_query;
3379
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3511
3380
  }
3512
3381
  /**
3513
3382
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3566,8 +3435,8 @@ class CompletionServiceClient {
3566
3435
  this._log.info('ending gRPC channel');
3567
3436
  this._terminated = true;
3568
3437
  stub.close();
3569
- this.locationsClient.close();
3570
- this.operationsClient.close();
3438
+ this.locationsClient.close().catch(err => { throw err; });
3439
+ void this.operationsClient.close();
3571
3440
  });
3572
3441
  }
3573
3442
  return Promise.resolve();