@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
@@ -99,26 +99,17 @@ class ProjectServiceClient {
99
99
  constructor(opts, gaxInstance) {
100
100
  // Ensure that options include all the required fields.
101
101
  const staticMembers = this.constructor;
102
- if (opts?.universe_domain &&
103
- opts?.universeDomain &&
104
- opts?.universe_domain !== opts?.universeDomain) {
102
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
105
103
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
106
104
  }
107
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
108
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
109
- : undefined;
110
- this._universeDomain =
111
- opts?.universeDomain ??
112
- opts?.universe_domain ??
113
- universeDomainEnvVar ??
114
- 'googleapis.com';
105
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
106
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
115
107
  this._servicePath = 'discoveryengine.' + this._universeDomain;
116
108
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
117
109
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
118
110
  const port = opts?.port || staticMembers.port;
119
111
  const clientConfig = opts?.clientConfig ?? {};
120
- const fallback = opts?.fallback ??
121
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
112
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
122
113
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
123
114
  // Request numeric enum values if REST transport is used.
124
115
  opts.numericEnums = true;
@@ -148,7 +139,10 @@ class ProjectServiceClient {
148
139
  }
149
140
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
150
141
  // Determine the client header string.
151
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
142
+ const clientHeader = [
143
+ `gax/${this._gaxModule.version}`,
144
+ `gapic/${version}`,
145
+ ];
152
146
  if (typeof process === 'object' && 'versions' in process) {
153
147
  clientHeader.push(`gl-node/${process.versions.node}`);
154
148
  }
@@ -208,131 +202,26 @@ class ProjectServiceClient {
208
202
  sampleQueryPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}'),
209
203
  sampleQuerySetPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}'),
210
204
  };
211
- const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
205
+ const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
212
206
  // This API contains "long-running operations", which return a
213
207
  // an Operation object that allows for tracking of the operation,
214
208
  // rather than holding a request open.
215
209
  const lroOptions = {
216
210
  auth: this.auth,
217
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
211
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
218
212
  };
219
213
  if (opts.fallback) {
220
214
  lroOptions.protoJson = protoFilesRoot;
221
- lroOptions.httpRules = [
222
- {
223
- selector: 'google.longrunning.Operations.CancelOperation',
224
- post: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
225
- body: '*',
226
- additional_bindings: [
227
- {
228
- post: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
229
- body: '*',
230
- },
231
- ],
232
- },
233
- {
234
- selector: 'google.longrunning.Operations.GetOperation',
235
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
236
- additional_bindings: [
237
- {
238
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
239
- },
240
- {
241
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
242
- },
243
- {
244
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
245
- },
246
- {
247
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
248
- },
249
- {
250
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
251
- },
252
- {
253
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
254
- },
255
- {
256
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
257
- },
258
- {
259
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}',
260
- },
261
- {
262
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
263
- },
264
- {
265
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
266
- },
267
- {
268
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}',
269
- },
270
- {
271
- get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}',
272
- },
273
- {
274
- get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}',
275
- },
276
- { get: '/v1alpha/{name=projects/*/locations/*/operations/*}' },
277
- {
278
- get: '/v1alpha/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
279
- },
280
- { get: '/v1alpha/{name=projects/*/operations/*}' },
281
- ],
282
- },
283
- {
284
- selector: 'google.longrunning.Operations.ListOperations',
285
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
286
- additional_bindings: [
287
- {
288
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
289
- },
290
- {
291
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
292
- },
293
- {
294
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
295
- },
296
- {
297
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
298
- },
299
- {
300
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
301
- },
302
- {
303
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
304
- },
305
- {
306
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations',
307
- },
308
- {
309
- get: '/v1alpha/{name=projects/*/locations/*/collections/*}/operations',
310
- },
311
- {
312
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
313
- },
314
- {
315
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
316
- },
317
- {
318
- get: '/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations',
319
- },
320
- {
321
- get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*}/operations',
322
- },
323
- { get: '/v1alpha/{name=projects/*/locations/*}/operations' },
324
- { get: '/v1alpha/{name=projects/*}/operations' },
325
- ],
326
- },
327
- ];
215
+ lroOptions.httpRules = [{ selector: 'google.longrunning.Operations.CancelOperation', post: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', additional_bindings: [{ post: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }],
216
+ }, { selector: 'google.longrunning.Operations.GetOperation', get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', additional_bindings: [{ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/operations/*}', }],
217
+ }, { selector: 'google.longrunning.Operations.ListOperations', get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}/operations', additional_bindings: [{ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*}/operations', }, { get: '/v1alpha/{name=projects/*}/operations', }],
218
+ }];
328
219
  }
329
- this.operationsClient = this._gaxModule
330
- .lro(lroOptions)
331
- .operationsClient(opts);
220
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
332
221
  const provisionProjectResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.Project');
333
222
  const provisionProjectMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.ProvisionProjectMetadata');
334
223
  this.descriptors.longrunning = {
335
- provisionProject: new this._gaxModule.LongrunningDescriptor(this.operationsClient, provisionProjectResponse.decode.bind(provisionProjectResponse), provisionProjectMetadata.decode.bind(provisionProjectMetadata)),
224
+ provisionProject: new this._gaxModule.LongrunningDescriptor(this.operationsClient, provisionProjectResponse.decode.bind(provisionProjectResponse), provisionProjectMetadata.decode.bind(provisionProjectMetadata))
336
225
  };
337
226
  // Put together the default options sent with requests.
338
227
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1alpha.ProjectService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -361,18 +250,13 @@ class ProjectServiceClient {
361
250
  }
362
251
  // Put together the "service stub" for
363
252
  // google.cloud.discoveryengine.v1alpha.ProjectService.
364
- this.projectServiceStub = this._gaxGrpc.createStub(this._opts.fallback
365
- ? this._protos.lookupService('google.cloud.discoveryengine.v1alpha.ProjectService')
366
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
367
- this._protos.google.cloud.discoveryengine.v1alpha
368
- .ProjectService, this._opts, this._providedCustomServicePath);
253
+ this.projectServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
254
+ this._protos.lookupService('google.cloud.discoveryengine.v1alpha.ProjectService') :
255
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
256
+ this._protos.google.cloud.discoveryengine.v1alpha.ProjectService, this._opts, this._providedCustomServicePath);
369
257
  // Iterate over each of the methods that the service provides
370
258
  // and create an API call method for each.
371
- const projectServiceStubMethods = [
372
- 'getProject',
373
- 'provisionProject',
374
- 'reportConsentChange',
375
- ];
259
+ const projectServiceStubMethods = ['getProject', 'provisionProject', 'reportConsentChange'];
376
260
  for (const methodName of projectServiceStubMethods) {
377
261
  const callPromise = this.projectServiceStub.then(stub => (...args) => {
378
262
  if (this._terminated) {
@@ -383,7 +267,8 @@ class ProjectServiceClient {
383
267
  }, (err) => () => {
384
268
  throw err;
385
269
  });
386
- const descriptor = this.descriptors.longrunning[methodName] || undefined;
270
+ const descriptor = this.descriptors.longrunning[methodName] ||
271
+ undefined;
387
272
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
388
273
  this.innerApiCalls[methodName] = apiCall;
389
274
  }
@@ -395,8 +280,7 @@ class ProjectServiceClient {
395
280
  * @returns {string} The DNS address for this service.
396
281
  */
397
282
  static get servicePath() {
398
- if (typeof process === 'object' &&
399
- typeof process.emitWarning === 'function') {
283
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
400
284
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
401
285
  }
402
286
  return 'discoveryengine.googleapis.com';
@@ -407,8 +291,7 @@ class ProjectServiceClient {
407
291
  * @returns {string} The DNS address for this service.
408
292
  */
409
293
  static get apiEndpoint() {
410
- if (typeof process === 'object' &&
411
- typeof process.emitWarning === 'function') {
294
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
412
295
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
413
296
  }
414
297
  return 'discoveryengine.googleapis.com';
@@ -436,7 +319,9 @@ class ProjectServiceClient {
436
319
  * @returns {string[]} List of default scopes.
437
320
  */
438
321
  static get scopes() {
439
- return ['https://www.googleapis.com/auth/cloud-platform'];
322
+ return [
323
+ 'https://www.googleapis.com/auth/cloud-platform'
324
+ ];
440
325
  }
441
326
  /**
442
327
  * Return the project ID used by this class.
@@ -462,13 +347,10 @@ class ProjectServiceClient {
462
347
  options = options || {};
463
348
  options.otherArgs = options.otherArgs || {};
464
349
  options.otherArgs.headers = options.otherArgs.headers || {};
465
- options.otherArgs.headers['x-goog-request-params'] =
466
- this._gaxModule.routingHeader.fromParams({
467
- name: request.name ?? '',
468
- });
469
- this.initialize().catch(err => {
470
- throw err;
350
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
351
+ 'name': request.name ?? '',
471
352
  });
353
+ this.initialize().catch(err => { throw err; });
472
354
  this._log.info('getProject request %j', request);
473
355
  const wrappedCallback = callback
474
356
  ? (error, response, options, rawResponse) => {
@@ -476,11 +358,16 @@ class ProjectServiceClient {
476
358
  callback(error, response, options, rawResponse); // We verified callback above.
477
359
  }
478
360
  : undefined;
479
- return this.innerApiCalls
480
- .getProject(request, options, wrappedCallback)
361
+ return this.innerApiCalls.getProject(request, options, wrappedCallback)
481
362
  ?.then(([response, options, rawResponse]) => {
482
363
  this._log.info('getProject response %j', response);
483
364
  return [response, options, rawResponse];
365
+ }).catch((error) => {
366
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
367
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
368
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
369
+ }
370
+ throw error;
484
371
  });
485
372
  }
486
373
  reportConsentChange(request, optionsOrCallback, callback) {
@@ -496,13 +383,10 @@ class ProjectServiceClient {
496
383
  options = options || {};
497
384
  options.otherArgs = options.otherArgs || {};
498
385
  options.otherArgs.headers = options.otherArgs.headers || {};
499
- options.otherArgs.headers['x-goog-request-params'] =
500
- this._gaxModule.routingHeader.fromParams({
501
- project: request.project ?? '',
502
- });
503
- this.initialize().catch(err => {
504
- throw err;
386
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
387
+ 'project': request.project ?? '',
505
388
  });
389
+ this.initialize().catch(err => { throw err; });
506
390
  this._log.info('reportConsentChange request %j', request);
507
391
  const wrappedCallback = callback
508
392
  ? (error, response, options, rawResponse) => {
@@ -510,11 +394,16 @@ class ProjectServiceClient {
510
394
  callback(error, response, options, rawResponse); // We verified callback above.
511
395
  }
512
396
  : undefined;
513
- return this.innerApiCalls
514
- .reportConsentChange(request, options, wrappedCallback)
397
+ return this.innerApiCalls.reportConsentChange(request, options, wrappedCallback)
515
398
  ?.then(([response, options, rawResponse]) => {
516
399
  this._log.info('reportConsentChange response %j', response);
517
400
  return [response, options, rawResponse];
401
+ }).catch((error) => {
402
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
403
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
404
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
405
+ }
406
+ throw error;
518
407
  });
519
408
  }
520
409
  provisionProject(request, optionsOrCallback, callback) {
@@ -530,13 +419,10 @@ class ProjectServiceClient {
530
419
  options = options || {};
531
420
  options.otherArgs = options.otherArgs || {};
532
421
  options.otherArgs.headers = options.otherArgs.headers || {};
533
- options.otherArgs.headers['x-goog-request-params'] =
534
- this._gaxModule.routingHeader.fromParams({
535
- name: request.name ?? '',
536
- });
537
- this.initialize().catch(err => {
538
- throw err;
422
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
423
+ 'name': request.name ?? '',
539
424
  });
425
+ this.initialize().catch(err => { throw err; });
540
426
  const wrappedCallback = callback
541
427
  ? (error, response, rawResponse, _) => {
542
428
  this._log.info('provisionProject response %j', rawResponse);
@@ -544,8 +430,7 @@ class ProjectServiceClient {
544
430
  }
545
431
  : undefined;
546
432
  this._log.info('provisionProject request %j', request);
547
- return this.innerApiCalls
548
- .provisionProject(request, options, wrappedCallback)
433
+ return this.innerApiCalls.provisionProject(request, options, wrappedCallback)
549
434
  ?.then(([response, rawResponse, _]) => {
550
435
  this._log.info('provisionProject response %j', rawResponse);
551
436
  return [response, rawResponse, _];
@@ -570,90 +455,90 @@ class ProjectServiceClient {
570
455
  return decodeOperation;
571
456
  }
572
457
  /**
573
- * Gets information about a location.
574
- *
575
- * @param {Object} request
576
- * The request object that will be sent.
577
- * @param {string} request.name
578
- * Resource name for the location.
579
- * @param {object} [options]
580
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
581
- * @returns {Promise} - The promise which resolves to an array.
582
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
583
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
584
- * for more details and examples.
585
- * @example
586
- * ```
587
- * const [response] = await client.getLocation(request);
588
- * ```
589
- */
458
+ * Gets information about a location.
459
+ *
460
+ * @param {Object} request
461
+ * The request object that will be sent.
462
+ * @param {string} request.name
463
+ * Resource name for the location.
464
+ * @param {object} [options]
465
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
466
+ * @returns {Promise} - The promise which resolves to an array.
467
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
468
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
469
+ * for more details and examples.
470
+ * @example
471
+ * ```
472
+ * const [response] = await client.getLocation(request);
473
+ * ```
474
+ */
590
475
  getLocation(request, options, callback) {
591
476
  return this.locationsClient.getLocation(request, options, callback);
592
477
  }
593
478
  /**
594
- * Lists information about the supported locations for this service. Returns an iterable object.
595
- *
596
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
597
- * @param {Object} request
598
- * The request object that will be sent.
599
- * @param {string} request.name
600
- * The resource that owns the locations collection, if applicable.
601
- * @param {string} request.filter
602
- * The standard list filter.
603
- * @param {number} request.pageSize
604
- * The standard list page size.
605
- * @param {string} request.pageToken
606
- * The standard list page token.
607
- * @param {object} [options]
608
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
609
- * @returns {Object}
610
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
611
- * When you iterate the returned iterable, each element will be an object representing
612
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
613
- * so you can stop the iteration when you don't need more results.
614
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
615
- * for more details and examples.
616
- * @example
617
- * ```
618
- * const iterable = client.listLocationsAsync(request);
619
- * for await (const response of iterable) {
620
- * // process response
621
- * }
622
- * ```
623
- */
479
+ * Lists information about the supported locations for this service. Returns an iterable object.
480
+ *
481
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
482
+ * @param {Object} request
483
+ * The request object that will be sent.
484
+ * @param {string} request.name
485
+ * The resource that owns the locations collection, if applicable.
486
+ * @param {string} request.filter
487
+ * The standard list filter.
488
+ * @param {number} request.pageSize
489
+ * The standard list page size.
490
+ * @param {string} request.pageToken
491
+ * The standard list page token.
492
+ * @param {object} [options]
493
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
494
+ * @returns {Object}
495
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
496
+ * When you iterate the returned iterable, each element will be an object representing
497
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
498
+ * so you can stop the iteration when you don't need more results.
499
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
500
+ * for more details and examples.
501
+ * @example
502
+ * ```
503
+ * const iterable = client.listLocationsAsync(request);
504
+ * for await (const response of iterable) {
505
+ * // process response
506
+ * }
507
+ * ```
508
+ */
624
509
  listLocationsAsync(request, options) {
625
510
  return this.locationsClient.listLocationsAsync(request, options);
626
511
  }
627
512
  /**
628
- * Gets the latest state of a long-running operation. Clients can use this
629
- * method to poll the operation result at intervals as recommended by the API
630
- * service.
631
- *
632
- * @param {Object} request - The request object that will be sent.
633
- * @param {string} request.name - The name of the operation resource.
634
- * @param {Object=} options
635
- * Optional parameters. You can override the default settings for this call,
636
- * e.g, timeout, retries, paginations, etc. See {@link
637
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
638
- * for the details.
639
- * @param {function(?Error, ?Object)=} callback
640
- * The function which will be called with the result of the API call.
641
- *
642
- * The second parameter to the callback is an object representing
643
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
644
- * @return {Promise} - The promise which resolves to an array.
645
- * The first element of the array is an object representing
646
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
647
- * The promise has a method named "cancel" which cancels the ongoing API call.
648
- *
649
- * @example
650
- * ```
651
- * const client = longrunning.operationsClient();
652
- * const name = '';
653
- * const [response] = await client.getOperation({name});
654
- * // doThingsWith(response)
655
- * ```
656
- */
513
+ * Gets the latest state of a long-running operation. Clients can use this
514
+ * method to poll the operation result at intervals as recommended by the API
515
+ * service.
516
+ *
517
+ * @param {Object} request - The request object that will be sent.
518
+ * @param {string} request.name - The name of the operation resource.
519
+ * @param {Object=} options
520
+ * Optional parameters. You can override the default settings for this call,
521
+ * e.g, timeout, retries, paginations, etc. See {@link
522
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
523
+ * for the details.
524
+ * @param {function(?Error, ?Object)=} callback
525
+ * The function which will be called with the result of the API call.
526
+ *
527
+ * The second parameter to the callback is an object representing
528
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
529
+ * @return {Promise} - The promise which resolves to an array.
530
+ * The first element of the array is an object representing
531
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
532
+ * The promise has a method named "cancel" which cancels the ongoing API call.
533
+ *
534
+ * @example
535
+ * ```
536
+ * const client = longrunning.operationsClient();
537
+ * const name = '';
538
+ * const [response] = await client.getOperation({name});
539
+ * // doThingsWith(response)
540
+ * ```
541
+ */
657
542
  getOperation(request, optionsOrCallback, callback) {
658
543
  let options;
659
544
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -828,8 +713,7 @@ class ProjectServiceClient {
828
713
  * @returns {string} A string representing the project.
829
714
  */
830
715
  matchProjectFromAclConfigName(aclConfigName) {
831
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
832
- .project;
716
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
833
717
  }
834
718
  /**
835
719
  * Parse the location from AclConfig resource.
@@ -839,8 +723,7 @@ class ProjectServiceClient {
839
723
  * @returns {string} A string representing the location.
840
724
  */
841
725
  matchLocationFromAclConfigName(aclConfigName) {
842
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
843
- .location;
726
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
844
727
  }
845
728
  /**
846
729
  * Return a fully-qualified engine resource name string.
@@ -922,8 +805,7 @@ class ProjectServiceClient {
922
805
  * @returns {string} A string representing the project.
923
806
  */
924
807
  matchProjectFromEvaluationName(evaluationName) {
925
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
926
- .project;
808
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
927
809
  }
928
810
  /**
929
811
  * Parse the location from Evaluation resource.
@@ -933,8 +815,7 @@ class ProjectServiceClient {
933
815
  * @returns {string} A string representing the location.
934
816
  */
935
817
  matchLocationFromEvaluationName(evaluationName) {
936
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
937
- .location;
818
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
938
819
  }
939
820
  /**
940
821
  * Parse the evaluation from Evaluation resource.
@@ -944,8 +825,7 @@ class ProjectServiceClient {
944
825
  * @returns {string} A string representing the evaluation.
945
826
  */
946
827
  matchEvaluationFromEvaluationName(evaluationName) {
947
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
948
- .evaluation;
828
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
949
829
  }
950
830
  /**
951
831
  * Return a fully-qualified project resource name string.
@@ -3012,8 +2892,7 @@ class ProjectServiceClient {
3012
2892
  * @returns {string} A string representing the project.
3013
2893
  */
3014
2894
  matchProjectFromSampleQueryName(sampleQueryName) {
3015
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3016
- .project;
2895
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3017
2896
  }
3018
2897
  /**
3019
2898
  * Parse the location from SampleQuery resource.
@@ -3023,8 +2902,7 @@ class ProjectServiceClient {
3023
2902
  * @returns {string} A string representing the location.
3024
2903
  */
3025
2904
  matchLocationFromSampleQueryName(sampleQueryName) {
3026
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3027
- .location;
2905
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3028
2906
  }
3029
2907
  /**
3030
2908
  * Parse the sample_query_set from SampleQuery resource.
@@ -3034,8 +2912,7 @@ class ProjectServiceClient {
3034
2912
  * @returns {string} A string representing the sample_query_set.
3035
2913
  */
3036
2914
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3037
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3038
- .sample_query_set;
2915
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3039
2916
  }
3040
2917
  /**
3041
2918
  * Parse the sample_query from SampleQuery resource.
@@ -3045,8 +2922,7 @@ class ProjectServiceClient {
3045
2922
  * @returns {string} A string representing the sample_query.
3046
2923
  */
3047
2924
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
3048
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3049
- .sample_query;
2925
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
3050
2926
  }
3051
2927
  /**
3052
2928
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3105,8 +2981,8 @@ class ProjectServiceClient {
3105
2981
  this._log.info('ending gRPC channel');
3106
2982
  this._terminated = true;
3107
2983
  stub.close();
3108
- this.locationsClient.close();
3109
- this.operationsClient.close();
2984
+ this.locationsClient.close().catch(err => { throw err; });
2985
+ void this.operationsClient.close();
3110
2986
  });
3111
2987
  }
3112
2988
  return Promise.resolve();