@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 SchemaServiceClient {
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 SchemaServiceClient {
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
  }
@@ -213,123 +207,24 @@ class SchemaServiceClient {
213
207
  // (e.g. 50 results at a time, with tokens to get subsequent
214
208
  // pages). Denote the keys used for pagination and results.
215
209
  this.descriptors.page = {
216
- listSchemas: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schemas'),
210
+ listSchemas: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schemas')
217
211
  };
218
- const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
212
+ const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
219
213
  // This API contains "long-running operations", which return a
220
214
  // an Operation object that allows for tracking of the operation,
221
215
  // rather than holding a request open.
222
216
  const lroOptions = {
223
217
  auth: this.auth,
224
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
218
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
225
219
  };
226
220
  if (opts.fallback) {
227
221
  lroOptions.protoJson = protoFilesRoot;
228
- lroOptions.httpRules = [
229
- {
230
- selector: 'google.longrunning.Operations.CancelOperation',
231
- post: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
232
- body: '*',
233
- additional_bindings: [
234
- {
235
- post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
236
- body: '*',
237
- },
238
- ],
239
- },
240
- {
241
- selector: 'google.longrunning.Operations.GetOperation',
242
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
243
- additional_bindings: [
244
- {
245
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
246
- },
247
- {
248
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
249
- },
250
- {
251
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
252
- },
253
- {
254
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
255
- },
256
- {
257
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
258
- },
259
- {
260
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
261
- },
262
- {
263
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
264
- },
265
- {
266
- get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}',
267
- },
268
- {
269
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
270
- },
271
- {
272
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
273
- },
274
- {
275
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}',
276
- },
277
- {
278
- get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}',
279
- },
280
- { get: '/v1beta/{name=projects/*/locations/*/operations/*}' },
281
- {
282
- get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
283
- },
284
- { get: '/v1beta/{name=projects/*/operations/*}' },
285
- ],
286
- },
287
- {
288
- selector: 'google.longrunning.Operations.ListOperations',
289
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
290
- additional_bindings: [
291
- {
292
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
293
- },
294
- {
295
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
296
- },
297
- {
298
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
299
- },
300
- {
301
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
302
- },
303
- {
304
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
305
- },
306
- {
307
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
308
- },
309
- {
310
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations',
311
- },
312
- {
313
- get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations',
314
- },
315
- {
316
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
317
- },
318
- {
319
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
320
- },
321
- {
322
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations',
323
- },
324
- { get: '/v1beta/{name=projects/*/locations/*}/operations' },
325
- { get: '/v1beta/{name=projects/*}/operations' },
326
- ],
327
- },
328
- ];
222
+ 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: '*', }],
223
+ }, { 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/*}', }],
224
+ }, { 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', }],
225
+ }];
329
226
  }
330
- this.operationsClient = this._gaxModule
331
- .lro(lroOptions)
332
- .operationsClient(opts);
227
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
333
228
  const createSchemaResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.Schema');
334
229
  const createSchemaMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.CreateSchemaMetadata');
335
230
  const updateSchemaResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.Schema');
@@ -339,7 +234,7 @@ class SchemaServiceClient {
339
234
  this.descriptors.longrunning = {
340
235
  createSchema: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createSchemaResponse.decode.bind(createSchemaResponse), createSchemaMetadata.decode.bind(createSchemaMetadata)),
341
236
  updateSchema: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateSchemaResponse.decode.bind(updateSchemaResponse), updateSchemaMetadata.decode.bind(updateSchemaMetadata)),
342
- deleteSchema: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteSchemaResponse.decode.bind(deleteSchemaResponse), deleteSchemaMetadata.decode.bind(deleteSchemaMetadata)),
237
+ deleteSchema: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteSchemaResponse.decode.bind(deleteSchemaResponse), deleteSchemaMetadata.decode.bind(deleteSchemaMetadata))
343
238
  };
344
239
  // Put together the default options sent with requests.
345
240
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.SchemaService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -368,20 +263,13 @@ class SchemaServiceClient {
368
263
  }
369
264
  // Put together the "service stub" for
370
265
  // google.cloud.discoveryengine.v1beta.SchemaService.
371
- this.schemaServiceStub = this._gaxGrpc.createStub(this._opts.fallback
372
- ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.SchemaService')
373
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
374
- this._protos.google.cloud.discoveryengine.v1beta
375
- .SchemaService, this._opts, this._providedCustomServicePath);
266
+ this.schemaServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
267
+ this._protos.lookupService('google.cloud.discoveryengine.v1beta.SchemaService') :
268
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
269
+ this._protos.google.cloud.discoveryengine.v1beta.SchemaService, 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 schemaServiceStubMethods = [
379
- 'getSchema',
380
- 'listSchemas',
381
- 'createSchema',
382
- 'updateSchema',
383
- 'deleteSchema',
384
- ];
272
+ const schemaServiceStubMethods = ['getSchema', 'listSchemas', 'createSchema', 'updateSchema', 'deleteSchema'];
385
273
  for (const methodName of schemaServiceStubMethods) {
386
274
  const callPromise = this.schemaServiceStub.then(stub => (...args) => {
387
275
  if (this._terminated) {
@@ -406,8 +294,7 @@ class SchemaServiceClient {
406
294
  * @returns {string} The DNS address for this service.
407
295
  */
408
296
  static get servicePath() {
409
- if (typeof process === 'object' &&
410
- typeof process.emitWarning === 'function') {
297
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
411
298
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
412
299
  }
413
300
  return 'discoveryengine.googleapis.com';
@@ -418,8 +305,7 @@ class SchemaServiceClient {
418
305
  * @returns {string} The DNS address for this service.
419
306
  */
420
307
  static get apiEndpoint() {
421
- if (typeof process === 'object' &&
422
- typeof process.emitWarning === 'function') {
308
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
423
309
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
424
310
  }
425
311
  return 'discoveryengine.googleapis.com';
@@ -447,7 +333,9 @@ class SchemaServiceClient {
447
333
  * @returns {string[]} List of default scopes.
448
334
  */
449
335
  static get scopes() {
450
- return ['https://www.googleapis.com/auth/cloud-platform'];
336
+ return [
337
+ 'https://www.googleapis.com/auth/cloud-platform'
338
+ ];
451
339
  }
452
340
  /**
453
341
  * Return the project ID used by this class.
@@ -473,13 +361,10 @@ class SchemaServiceClient {
473
361
  options = options || {};
474
362
  options.otherArgs = options.otherArgs || {};
475
363
  options.otherArgs.headers = options.otherArgs.headers || {};
476
- options.otherArgs.headers['x-goog-request-params'] =
477
- this._gaxModule.routingHeader.fromParams({
478
- name: request.name ?? '',
479
- });
480
- this.initialize().catch(err => {
481
- throw err;
364
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
365
+ 'name': request.name ?? '',
482
366
  });
367
+ this.initialize().catch(err => { throw err; });
483
368
  this._log.info('getSchema request %j', request);
484
369
  const wrappedCallback = callback
485
370
  ? (error, response, options, rawResponse) => {
@@ -487,11 +372,16 @@ class SchemaServiceClient {
487
372
  callback(error, response, options, rawResponse); // We verified callback above.
488
373
  }
489
374
  : undefined;
490
- return this.innerApiCalls
491
- .getSchema(request, options, wrappedCallback)
375
+ return this.innerApiCalls.getSchema(request, options, wrappedCallback)
492
376
  ?.then(([response, options, rawResponse]) => {
493
377
  this._log.info('getSchema response %j', response);
494
378
  return [response, options, rawResponse];
379
+ }).catch((error) => {
380
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
381
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
382
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
383
+ }
384
+ throw error;
495
385
  });
496
386
  }
497
387
  createSchema(request, optionsOrCallback, callback) {
@@ -507,13 +397,10 @@ class SchemaServiceClient {
507
397
  options = options || {};
508
398
  options.otherArgs = options.otherArgs || {};
509
399
  options.otherArgs.headers = options.otherArgs.headers || {};
510
- options.otherArgs.headers['x-goog-request-params'] =
511
- this._gaxModule.routingHeader.fromParams({
512
- parent: request.parent ?? '',
513
- });
514
- this.initialize().catch(err => {
515
- throw err;
400
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
401
+ 'parent': request.parent ?? '',
516
402
  });
403
+ this.initialize().catch(err => { throw err; });
517
404
  const wrappedCallback = callback
518
405
  ? (error, response, rawResponse, _) => {
519
406
  this._log.info('createSchema response %j', rawResponse);
@@ -521,8 +408,7 @@ class SchemaServiceClient {
521
408
  }
522
409
  : undefined;
523
410
  this._log.info('createSchema request %j', request);
524
- return this.innerApiCalls
525
- .createSchema(request, options, wrappedCallback)
411
+ return this.innerApiCalls.createSchema(request, options, wrappedCallback)
526
412
  ?.then(([response, rawResponse, _]) => {
527
413
  this._log.info('createSchema response %j', rawResponse);
528
414
  return [response, rawResponse, _];
@@ -559,13 +445,10 @@ class SchemaServiceClient {
559
445
  options = options || {};
560
446
  options.otherArgs = options.otherArgs || {};
561
447
  options.otherArgs.headers = options.otherArgs.headers || {};
562
- options.otherArgs.headers['x-goog-request-params'] =
563
- this._gaxModule.routingHeader.fromParams({
564
- 'schema.name': request.schema.name ?? '',
565
- });
566
- this.initialize().catch(err => {
567
- throw err;
448
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
449
+ 'schema.name': request.schema.name ?? '',
568
450
  });
451
+ this.initialize().catch(err => { throw err; });
569
452
  const wrappedCallback = callback
570
453
  ? (error, response, rawResponse, _) => {
571
454
  this._log.info('updateSchema response %j', rawResponse);
@@ -573,8 +456,7 @@ class SchemaServiceClient {
573
456
  }
574
457
  : undefined;
575
458
  this._log.info('updateSchema request %j', request);
576
- return this.innerApiCalls
577
- .updateSchema(request, options, wrappedCallback)
459
+ return this.innerApiCalls.updateSchema(request, options, wrappedCallback)
578
460
  ?.then(([response, rawResponse, _]) => {
579
461
  this._log.info('updateSchema response %j', rawResponse);
580
462
  return [response, rawResponse, _];
@@ -611,13 +493,10 @@ class SchemaServiceClient {
611
493
  options = options || {};
612
494
  options.otherArgs = options.otherArgs || {};
613
495
  options.otherArgs.headers = options.otherArgs.headers || {};
614
- options.otherArgs.headers['x-goog-request-params'] =
615
- this._gaxModule.routingHeader.fromParams({
616
- name: request.name ?? '',
617
- });
618
- this.initialize().catch(err => {
619
- throw err;
496
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
497
+ 'name': request.name ?? '',
620
498
  });
499
+ this.initialize().catch(err => { throw err; });
621
500
  const wrappedCallback = callback
622
501
  ? (error, response, rawResponse, _) => {
623
502
  this._log.info('deleteSchema response %j', rawResponse);
@@ -625,8 +504,7 @@ class SchemaServiceClient {
625
504
  }
626
505
  : undefined;
627
506
  this._log.info('deleteSchema request %j', request);
628
- return this.innerApiCalls
629
- .deleteSchema(request, options, wrappedCallback)
507
+ return this.innerApiCalls.deleteSchema(request, options, wrappedCallback)
630
508
  ?.then(([response, rawResponse, _]) => {
631
509
  this._log.info('deleteSchema response %j', rawResponse);
632
510
  return [response, rawResponse, _];
@@ -663,13 +541,10 @@ class SchemaServiceClient {
663
541
  options = options || {};
664
542
  options.otherArgs = options.otherArgs || {};
665
543
  options.otherArgs.headers = options.otherArgs.headers || {};
666
- options.otherArgs.headers['x-goog-request-params'] =
667
- this._gaxModule.routingHeader.fromParams({
668
- parent: request.parent ?? '',
669
- });
670
- this.initialize().catch(err => {
671
- throw err;
544
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
545
+ 'parent': request.parent ?? '',
672
546
  });
547
+ this.initialize().catch(err => { throw err; });
673
548
  const wrappedCallback = callback
674
549
  ? (error, values, nextPageRequest, rawResponse) => {
675
550
  this._log.info('listSchemas values %j', values);
@@ -723,15 +598,12 @@ class SchemaServiceClient {
723
598
  options = options || {};
724
599
  options.otherArgs = options.otherArgs || {};
725
600
  options.otherArgs.headers = options.otherArgs.headers || {};
726
- options.otherArgs.headers['x-goog-request-params'] =
727
- this._gaxModule.routingHeader.fromParams({
728
- parent: request.parent ?? '',
729
- });
601
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
602
+ 'parent': request.parent ?? '',
603
+ });
730
604
  const defaultCallSettings = this._defaults['listSchemas'];
731
605
  const callSettings = defaultCallSettings.merge(options);
732
- this.initialize().catch(err => {
733
- throw err;
734
- });
606
+ this.initialize().catch(err => { throw err; });
735
607
  this._log.info('listSchemas stream %j', request);
736
608
  return this.descriptors.page.listSchemas.createStream(this.innerApiCalls.listSchemas, request, callSettings);
737
609
  }
@@ -777,103 +649,100 @@ class SchemaServiceClient {
777
649
  options = options || {};
778
650
  options.otherArgs = options.otherArgs || {};
779
651
  options.otherArgs.headers = options.otherArgs.headers || {};
780
- options.otherArgs.headers['x-goog-request-params'] =
781
- this._gaxModule.routingHeader.fromParams({
782
- parent: request.parent ?? '',
783
- });
652
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
653
+ 'parent': request.parent ?? '',
654
+ });
784
655
  const defaultCallSettings = this._defaults['listSchemas'];
785
656
  const callSettings = defaultCallSettings.merge(options);
786
- this.initialize().catch(err => {
787
- throw err;
788
- });
657
+ this.initialize().catch(err => { throw err; });
789
658
  this._log.info('listSchemas iterate %j', request);
790
659
  return this.descriptors.page.listSchemas.asyncIterate(this.innerApiCalls['listSchemas'], request, callSettings);
791
660
  }
792
661
  /**
793
- * Gets information about a location.
794
- *
795
- * @param {Object} request
796
- * The request object that will be sent.
797
- * @param {string} request.name
798
- * Resource name for the location.
799
- * @param {object} [options]
800
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
801
- * @returns {Promise} - The promise which resolves to an array.
802
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
803
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
804
- * for more details and examples.
805
- * @example
806
- * ```
807
- * const [response] = await client.getLocation(request);
808
- * ```
809
- */
662
+ * Gets information about a location.
663
+ *
664
+ * @param {Object} request
665
+ * The request object that will be sent.
666
+ * @param {string} request.name
667
+ * Resource name for the location.
668
+ * @param {object} [options]
669
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
670
+ * @returns {Promise} - The promise which resolves to an array.
671
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
672
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
673
+ * for more details and examples.
674
+ * @example
675
+ * ```
676
+ * const [response] = await client.getLocation(request);
677
+ * ```
678
+ */
810
679
  getLocation(request, options, callback) {
811
680
  return this.locationsClient.getLocation(request, options, callback);
812
681
  }
813
682
  /**
814
- * Lists information about the supported locations for this service. Returns an iterable object.
815
- *
816
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
817
- * @param {Object} request
818
- * The request object that will be sent.
819
- * @param {string} request.name
820
- * The resource that owns the locations collection, if applicable.
821
- * @param {string} request.filter
822
- * The standard list filter.
823
- * @param {number} request.pageSize
824
- * The standard list page size.
825
- * @param {string} request.pageToken
826
- * The standard list page token.
827
- * @param {object} [options]
828
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
829
- * @returns {Object}
830
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
831
- * When you iterate the returned iterable, each element will be an object representing
832
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
833
- * so you can stop the iteration when you don't need more results.
834
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
835
- * for more details and examples.
836
- * @example
837
- * ```
838
- * const iterable = client.listLocationsAsync(request);
839
- * for await (const response of iterable) {
840
- * // process response
841
- * }
842
- * ```
843
- */
683
+ * Lists information about the supported locations for this service. Returns an iterable object.
684
+ *
685
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
686
+ * @param {Object} request
687
+ * The request object that will be sent.
688
+ * @param {string} request.name
689
+ * The resource that owns the locations collection, if applicable.
690
+ * @param {string} request.filter
691
+ * The standard list filter.
692
+ * @param {number} request.pageSize
693
+ * The standard list page size.
694
+ * @param {string} request.pageToken
695
+ * The standard list page token.
696
+ * @param {object} [options]
697
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
698
+ * @returns {Object}
699
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
700
+ * When you iterate the returned iterable, each element will be an object representing
701
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
702
+ * so you can stop the iteration when you don't need more results.
703
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
704
+ * for more details and examples.
705
+ * @example
706
+ * ```
707
+ * const iterable = client.listLocationsAsync(request);
708
+ * for await (const response of iterable) {
709
+ * // process response
710
+ * }
711
+ * ```
712
+ */
844
713
  listLocationsAsync(request, options) {
845
714
  return this.locationsClient.listLocationsAsync(request, options);
846
715
  }
847
716
  /**
848
- * Gets the latest state of a long-running operation. Clients can use this
849
- * method to poll the operation result at intervals as recommended by the API
850
- * service.
851
- *
852
- * @param {Object} request - The request object that will be sent.
853
- * @param {string} request.name - The name of the operation resource.
854
- * @param {Object=} options
855
- * Optional parameters. You can override the default settings for this call,
856
- * e.g, timeout, retries, paginations, etc. See {@link
857
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
858
- * for the details.
859
- * @param {function(?Error, ?Object)=} callback
860
- * The function which will be called with the result of the API call.
861
- *
862
- * The second parameter to the callback is an object representing
863
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
864
- * @return {Promise} - The promise which resolves to an array.
865
- * The first element of the array is an object representing
866
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
867
- * The promise has a method named "cancel" which cancels the ongoing API call.
868
- *
869
- * @example
870
- * ```
871
- * const client = longrunning.operationsClient();
872
- * const name = '';
873
- * const [response] = await client.getOperation({name});
874
- * // doThingsWith(response)
875
- * ```
876
- */
717
+ * Gets the latest state of a long-running operation. Clients can use this
718
+ * method to poll the operation result at intervals as recommended by the API
719
+ * service.
720
+ *
721
+ * @param {Object} request - The request object that will be sent.
722
+ * @param {string} request.name - The name of the operation resource.
723
+ * @param {Object=} options
724
+ * Optional parameters. You can override the default settings for this call,
725
+ * e.g, timeout, retries, paginations, etc. See {@link
726
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
727
+ * for the details.
728
+ * @param {function(?Error, ?Object)=} callback
729
+ * The function which will be called with the result of the API call.
730
+ *
731
+ * The second parameter to the callback is an object representing
732
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
733
+ * @return {Promise} - The promise which resolves to an array.
734
+ * The first element of the array is an object representing
735
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
736
+ * The promise has a method named "cancel" which cancels the ongoing API call.
737
+ *
738
+ * @example
739
+ * ```
740
+ * const client = longrunning.operationsClient();
741
+ * const name = '';
742
+ * const [response] = await client.getOperation({name});
743
+ * // doThingsWith(response)
744
+ * ```
745
+ */
877
746
  getOperation(request, optionsOrCallback, callback) {
878
747
  let options;
879
748
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1107,8 +976,7 @@ class SchemaServiceClient {
1107
976
  * @returns {string} A string representing the project.
1108
977
  */
1109
978
  matchProjectFromEvaluationName(evaluationName) {
1110
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1111
- .project;
979
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
1112
980
  }
1113
981
  /**
1114
982
  * Parse the location from Evaluation resource.
@@ -1118,8 +986,7 @@ class SchemaServiceClient {
1118
986
  * @returns {string} A string representing the location.
1119
987
  */
1120
988
  matchLocationFromEvaluationName(evaluationName) {
1121
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1122
- .location;
989
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
1123
990
  }
1124
991
  /**
1125
992
  * Parse the evaluation from Evaluation resource.
@@ -1129,8 +996,7 @@ class SchemaServiceClient {
1129
996
  * @returns {string} A string representing the evaluation.
1130
997
  */
1131
998
  matchEvaluationFromEvaluationName(evaluationName) {
1132
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1133
- .evaluation;
999
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
1134
1000
  }
1135
1001
  /**
1136
1002
  * Return a fully-qualified groundingConfig resource name string.
@@ -3368,8 +3234,7 @@ class SchemaServiceClient {
3368
3234
  * @returns {string} A string representing the project.
3369
3235
  */
3370
3236
  matchProjectFromSampleQueryName(sampleQueryName) {
3371
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3372
- .project;
3237
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3373
3238
  }
3374
3239
  /**
3375
3240
  * Parse the location from SampleQuery resource.
@@ -3379,8 +3244,7 @@ class SchemaServiceClient {
3379
3244
  * @returns {string} A string representing the location.
3380
3245
  */
3381
3246
  matchLocationFromSampleQueryName(sampleQueryName) {
3382
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3383
- .location;
3247
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3384
3248
  }
3385
3249
  /**
3386
3250
  * Parse the sample_query_set from SampleQuery resource.
@@ -3390,8 +3254,7 @@ class SchemaServiceClient {
3390
3254
  * @returns {string} A string representing the sample_query_set.
3391
3255
  */
3392
3256
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3393
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3394
- .sample_query_set;
3257
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3395
3258
  }
3396
3259
  /**
3397
3260
  * Parse the sample_query from SampleQuery resource.
@@ -3401,8 +3264,7 @@ class SchemaServiceClient {
3401
3264
  * @returns {string} A string representing the sample_query.
3402
3265
  */
3403
3266
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3404
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3405
- .sample_query;
3267
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3406
3268
  }
3407
3269
  /**
3408
3270
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3461,8 +3323,8 @@ class SchemaServiceClient {
3461
3323
  this._log.info('ending gRPC channel');
3462
3324
  this._terminated = true;
3463
3325
  stub.close();
3464
- this.locationsClient.close();
3465
- this.operationsClient.close();
3326
+ this.locationsClient.close().catch(err => { throw err; });
3327
+ void this.operationsClient.close();
3466
3328
  });
3467
3329
  }
3468
3330
  return Promise.resolve();