@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
@@ -97,28 +97,18 @@ class SiteSearchEngineServiceClient {
97
97
  */
98
98
  constructor(opts, gaxInstance) {
99
99
  // Ensure that options include all the required fields.
100
- const staticMembers = this
101
- .constructor;
102
- if (opts?.universe_domain &&
103
- opts?.universeDomain &&
104
- opts?.universe_domain !== opts?.universeDomain) {
100
+ const staticMembers = this.constructor;
101
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
105
102
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
106
103
  }
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';
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';
115
106
  this._servicePath = 'discoveryengine.' + this._universeDomain;
116
107
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
117
108
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
118
109
  const port = opts?.port || staticMembers.port;
119
110
  const clientConfig = opts?.clientConfig ?? {};
120
- const fallback = opts?.fallback ??
121
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
111
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
122
112
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
123
113
  // Request numeric enum values if REST transport is used.
124
114
  opts.numericEnums = true;
@@ -148,7 +138,10 @@ class SiteSearchEngineServiceClient {
148
138
  }
149
139
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
150
140
  // Determine the client header string.
151
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
141
+ const clientHeader = [
142
+ `gax/${this._gaxModule.version}`,
143
+ `gapic/${version}`,
144
+ ];
152
145
  if (typeof process === 'object' && 'versions' in process) {
153
146
  clientHeader.push(`gl-node/${process.versions.node}`);
154
147
  }
@@ -215,123 +208,24 @@ class SiteSearchEngineServiceClient {
215
208
  // pages). Denote the keys used for pagination and results.
216
209
  this.descriptors.page = {
217
210
  listTargetSites: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'targetSites'),
218
- fetchDomainVerificationStatus: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'targetSites'),
211
+ fetchDomainVerificationStatus: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'targetSites')
219
212
  };
220
- const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
213
+ const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
221
214
  // This API contains "long-running operations", which return a
222
215
  // an Operation object that allows for tracking of the operation,
223
216
  // rather than holding a request open.
224
217
  const lroOptions = {
225
218
  auth: this.auth,
226
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
219
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
227
220
  };
228
221
  if (opts.fallback) {
229
222
  lroOptions.protoJson = protoFilesRoot;
230
- lroOptions.httpRules = [
231
- {
232
- selector: 'google.longrunning.Operations.CancelOperation',
233
- post: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
234
- body: '*',
235
- additional_bindings: [
236
- {
237
- post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
238
- body: '*',
239
- },
240
- ],
241
- },
242
- {
243
- selector: 'google.longrunning.Operations.GetOperation',
244
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
245
- additional_bindings: [
246
- {
247
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
248
- },
249
- {
250
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
251
- },
252
- {
253
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
254
- },
255
- {
256
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
257
- },
258
- {
259
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
260
- },
261
- {
262
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
263
- },
264
- {
265
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
266
- },
267
- {
268
- get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}',
269
- },
270
- {
271
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
272
- },
273
- {
274
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
275
- },
276
- {
277
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}',
278
- },
279
- {
280
- get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}',
281
- },
282
- { get: '/v1beta/{name=projects/*/locations/*/operations/*}' },
283
- {
284
- get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
285
- },
286
- { get: '/v1beta/{name=projects/*/operations/*}' },
287
- ],
288
- },
289
- {
290
- selector: 'google.longrunning.Operations.ListOperations',
291
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
292
- additional_bindings: [
293
- {
294
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
295
- },
296
- {
297
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
298
- },
299
- {
300
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
301
- },
302
- {
303
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
304
- },
305
- {
306
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
307
- },
308
- {
309
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
310
- },
311
- {
312
- get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations',
313
- },
314
- {
315
- get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations',
316
- },
317
- {
318
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
319
- },
320
- {
321
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
322
- },
323
- {
324
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations',
325
- },
326
- { get: '/v1beta/{name=projects/*/locations/*}/operations' },
327
- { get: '/v1beta/{name=projects/*}/operations' },
328
- ],
329
- },
330
- ];
223
+ 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: '*', }],
224
+ }, { 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/*}', }],
225
+ }, { 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', }],
226
+ }];
331
227
  }
332
- this.operationsClient = this._gaxModule
333
- .lro(lroOptions)
334
- .operationsClient(opts);
228
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
335
229
  const createTargetSiteResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.TargetSite');
336
230
  const createTargetSiteMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.CreateTargetSiteMetadata');
337
231
  const batchCreateTargetSitesResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.BatchCreateTargetSitesResponse');
@@ -362,7 +256,7 @@ class SiteSearchEngineServiceClient {
362
256
  enableAdvancedSiteSearch: new this._gaxModule.LongrunningDescriptor(this.operationsClient, enableAdvancedSiteSearchResponse.decode.bind(enableAdvancedSiteSearchResponse), enableAdvancedSiteSearchMetadata.decode.bind(enableAdvancedSiteSearchMetadata)),
363
257
  disableAdvancedSiteSearch: new this._gaxModule.LongrunningDescriptor(this.operationsClient, disableAdvancedSiteSearchResponse.decode.bind(disableAdvancedSiteSearchResponse), disableAdvancedSiteSearchMetadata.decode.bind(disableAdvancedSiteSearchMetadata)),
364
258
  recrawlUris: new this._gaxModule.LongrunningDescriptor(this.operationsClient, recrawlUrisResponse.decode.bind(recrawlUrisResponse), recrawlUrisMetadata.decode.bind(recrawlUrisMetadata)),
365
- batchVerifyTargetSites: new this._gaxModule.LongrunningDescriptor(this.operationsClient, batchVerifyTargetSitesResponse.decode.bind(batchVerifyTargetSitesResponse), batchVerifyTargetSitesMetadata.decode.bind(batchVerifyTargetSitesMetadata)),
259
+ batchVerifyTargetSites: new this._gaxModule.LongrunningDescriptor(this.operationsClient, batchVerifyTargetSitesResponse.decode.bind(batchVerifyTargetSitesResponse), batchVerifyTargetSitesMetadata.decode.bind(batchVerifyTargetSitesMetadata))
366
260
  };
367
261
  // Put together the default options sent with requests.
368
262
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.SiteSearchEngineService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -391,30 +285,13 @@ class SiteSearchEngineServiceClient {
391
285
  }
392
286
  // Put together the "service stub" for
393
287
  // google.cloud.discoveryengine.v1beta.SiteSearchEngineService.
394
- this.siteSearchEngineServiceStub = this._gaxGrpc.createStub(this._opts.fallback
395
- ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.SiteSearchEngineService')
396
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
397
- this._protos.google.cloud.discoveryengine.v1beta
398
- .SiteSearchEngineService, this._opts, this._providedCustomServicePath);
288
+ this.siteSearchEngineServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
289
+ this._protos.lookupService('google.cloud.discoveryengine.v1beta.SiteSearchEngineService') :
290
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
291
+ this._protos.google.cloud.discoveryengine.v1beta.SiteSearchEngineService, this._opts, this._providedCustomServicePath);
399
292
  // Iterate over each of the methods that the service provides
400
293
  // and create an API call method for each.
401
- const siteSearchEngineServiceStubMethods = [
402
- 'getSiteSearchEngine',
403
- 'createTargetSite',
404
- 'batchCreateTargetSites',
405
- 'getTargetSite',
406
- 'updateTargetSite',
407
- 'deleteTargetSite',
408
- 'listTargetSites',
409
- 'createSitemap',
410
- 'deleteSitemap',
411
- 'fetchSitemaps',
412
- 'enableAdvancedSiteSearch',
413
- 'disableAdvancedSiteSearch',
414
- 'recrawlUris',
415
- 'batchVerifyTargetSites',
416
- 'fetchDomainVerificationStatus',
417
- ];
294
+ const siteSearchEngineServiceStubMethods = ['getSiteSearchEngine', 'createTargetSite', 'batchCreateTargetSites', 'getTargetSite', 'updateTargetSite', 'deleteTargetSite', 'listTargetSites', 'createSitemap', 'deleteSitemap', 'fetchSitemaps', 'enableAdvancedSiteSearch', 'disableAdvancedSiteSearch', 'recrawlUris', 'batchVerifyTargetSites', 'fetchDomainVerificationStatus'];
418
295
  for (const methodName of siteSearchEngineServiceStubMethods) {
419
296
  const callPromise = this.siteSearchEngineServiceStub.then(stub => (...args) => {
420
297
  if (this._terminated) {
@@ -439,8 +316,7 @@ class SiteSearchEngineServiceClient {
439
316
  * @returns {string} The DNS address for this service.
440
317
  */
441
318
  static get servicePath() {
442
- if (typeof process === 'object' &&
443
- typeof process.emitWarning === 'function') {
319
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
444
320
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
445
321
  }
446
322
  return 'discoveryengine.googleapis.com';
@@ -451,8 +327,7 @@ class SiteSearchEngineServiceClient {
451
327
  * @returns {string} The DNS address for this service.
452
328
  */
453
329
  static get apiEndpoint() {
454
- if (typeof process === 'object' &&
455
- typeof process.emitWarning === 'function') {
330
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
456
331
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
457
332
  }
458
333
  return 'discoveryengine.googleapis.com';
@@ -480,7 +355,9 @@ class SiteSearchEngineServiceClient {
480
355
  * @returns {string[]} List of default scopes.
481
356
  */
482
357
  static get scopes() {
483
- return ['https://www.googleapis.com/auth/cloud-platform'];
358
+ return [
359
+ 'https://www.googleapis.com/auth/cloud-platform'
360
+ ];
484
361
  }
485
362
  /**
486
363
  * Return the project ID used by this class.
@@ -506,13 +383,10 @@ class SiteSearchEngineServiceClient {
506
383
  options = options || {};
507
384
  options.otherArgs = options.otherArgs || {};
508
385
  options.otherArgs.headers = options.otherArgs.headers || {};
509
- options.otherArgs.headers['x-goog-request-params'] =
510
- this._gaxModule.routingHeader.fromParams({
511
- name: request.name ?? '',
512
- });
513
- this.initialize().catch(err => {
514
- throw err;
386
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
387
+ 'name': request.name ?? '',
515
388
  });
389
+ this.initialize().catch(err => { throw err; });
516
390
  this._log.info('getSiteSearchEngine request %j', request);
517
391
  const wrappedCallback = callback
518
392
  ? (error, response, options, rawResponse) => {
@@ -520,11 +394,16 @@ class SiteSearchEngineServiceClient {
520
394
  callback(error, response, options, rawResponse); // We verified callback above.
521
395
  }
522
396
  : undefined;
523
- return this.innerApiCalls
524
- .getSiteSearchEngine(request, options, wrappedCallback)
397
+ return this.innerApiCalls.getSiteSearchEngine(request, options, wrappedCallback)
525
398
  ?.then(([response, options, rawResponse]) => {
526
399
  this._log.info('getSiteSearchEngine response %j', response);
527
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;
528
407
  });
529
408
  }
530
409
  getTargetSite(request, optionsOrCallback, callback) {
@@ -540,13 +419,10 @@ class SiteSearchEngineServiceClient {
540
419
  options = options || {};
541
420
  options.otherArgs = options.otherArgs || {};
542
421
  options.otherArgs.headers = options.otherArgs.headers || {};
543
- options.otherArgs.headers['x-goog-request-params'] =
544
- this._gaxModule.routingHeader.fromParams({
545
- name: request.name ?? '',
546
- });
547
- this.initialize().catch(err => {
548
- throw err;
422
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
423
+ 'name': request.name ?? '',
549
424
  });
425
+ this.initialize().catch(err => { throw err; });
550
426
  this._log.info('getTargetSite request %j', request);
551
427
  const wrappedCallback = callback
552
428
  ? (error, response, options, rawResponse) => {
@@ -554,11 +430,16 @@ class SiteSearchEngineServiceClient {
554
430
  callback(error, response, options, rawResponse); // We verified callback above.
555
431
  }
556
432
  : undefined;
557
- return this.innerApiCalls
558
- .getTargetSite(request, options, wrappedCallback)
433
+ return this.innerApiCalls.getTargetSite(request, options, wrappedCallback)
559
434
  ?.then(([response, options, rawResponse]) => {
560
435
  this._log.info('getTargetSite response %j', response);
561
436
  return [response, options, rawResponse];
437
+ }).catch((error) => {
438
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
439
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
440
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
441
+ }
442
+ throw error;
562
443
  });
563
444
  }
564
445
  fetchSitemaps(request, optionsOrCallback, callback) {
@@ -574,13 +455,10 @@ class SiteSearchEngineServiceClient {
574
455
  options = options || {};
575
456
  options.otherArgs = options.otherArgs || {};
576
457
  options.otherArgs.headers = options.otherArgs.headers || {};
577
- options.otherArgs.headers['x-goog-request-params'] =
578
- this._gaxModule.routingHeader.fromParams({
579
- parent: request.parent ?? '',
580
- });
581
- this.initialize().catch(err => {
582
- throw err;
458
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
459
+ 'parent': request.parent ?? '',
583
460
  });
461
+ this.initialize().catch(err => { throw err; });
584
462
  this._log.info('fetchSitemaps request %j', request);
585
463
  const wrappedCallback = callback
586
464
  ? (error, response, options, rawResponse) => {
@@ -588,11 +466,16 @@ class SiteSearchEngineServiceClient {
588
466
  callback(error, response, options, rawResponse); // We verified callback above.
589
467
  }
590
468
  : undefined;
591
- return this.innerApiCalls
592
- .fetchSitemaps(request, options, wrappedCallback)
469
+ return this.innerApiCalls.fetchSitemaps(request, options, wrappedCallback)
593
470
  ?.then(([response, options, rawResponse]) => {
594
471
  this._log.info('fetchSitemaps response %j', response);
595
472
  return [response, options, rawResponse];
473
+ }).catch((error) => {
474
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
475
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
476
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
477
+ }
478
+ throw error;
596
479
  });
597
480
  }
598
481
  createTargetSite(request, optionsOrCallback, callback) {
@@ -608,13 +491,10 @@ class SiteSearchEngineServiceClient {
608
491
  options = options || {};
609
492
  options.otherArgs = options.otherArgs || {};
610
493
  options.otherArgs.headers = options.otherArgs.headers || {};
611
- options.otherArgs.headers['x-goog-request-params'] =
612
- this._gaxModule.routingHeader.fromParams({
613
- parent: request.parent ?? '',
614
- });
615
- this.initialize().catch(err => {
616
- throw err;
494
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
495
+ 'parent': request.parent ?? '',
617
496
  });
497
+ this.initialize().catch(err => { throw err; });
618
498
  const wrappedCallback = callback
619
499
  ? (error, response, rawResponse, _) => {
620
500
  this._log.info('createTargetSite response %j', rawResponse);
@@ -622,8 +502,7 @@ class SiteSearchEngineServiceClient {
622
502
  }
623
503
  : undefined;
624
504
  this._log.info('createTargetSite request %j', request);
625
- return this.innerApiCalls
626
- .createTargetSite(request, options, wrappedCallback)
505
+ return this.innerApiCalls.createTargetSite(request, options, wrappedCallback)
627
506
  ?.then(([response, rawResponse, _]) => {
628
507
  this._log.info('createTargetSite response %j', rawResponse);
629
508
  return [response, rawResponse, _];
@@ -660,13 +539,10 @@ class SiteSearchEngineServiceClient {
660
539
  options = options || {};
661
540
  options.otherArgs = options.otherArgs || {};
662
541
  options.otherArgs.headers = options.otherArgs.headers || {};
663
- options.otherArgs.headers['x-goog-request-params'] =
664
- this._gaxModule.routingHeader.fromParams({
665
- parent: request.parent ?? '',
666
- });
667
- this.initialize().catch(err => {
668
- throw err;
542
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
543
+ 'parent': request.parent ?? '',
669
544
  });
545
+ this.initialize().catch(err => { throw err; });
670
546
  const wrappedCallback = callback
671
547
  ? (error, response, rawResponse, _) => {
672
548
  this._log.info('batchCreateTargetSites response %j', rawResponse);
@@ -674,8 +550,7 @@ class SiteSearchEngineServiceClient {
674
550
  }
675
551
  : undefined;
676
552
  this._log.info('batchCreateTargetSites request %j', request);
677
- return this.innerApiCalls
678
- .batchCreateTargetSites(request, options, wrappedCallback)
553
+ return this.innerApiCalls.batchCreateTargetSites(request, options, wrappedCallback)
679
554
  ?.then(([response, rawResponse, _]) => {
680
555
  this._log.info('batchCreateTargetSites response %j', rawResponse);
681
556
  return [response, rawResponse, _];
@@ -712,13 +587,10 @@ class SiteSearchEngineServiceClient {
712
587
  options = options || {};
713
588
  options.otherArgs = options.otherArgs || {};
714
589
  options.otherArgs.headers = options.otherArgs.headers || {};
715
- options.otherArgs.headers['x-goog-request-params'] =
716
- this._gaxModule.routingHeader.fromParams({
717
- 'target_site.name': request.targetSite.name ?? '',
718
- });
719
- this.initialize().catch(err => {
720
- throw err;
590
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
591
+ 'target_site.name': request.targetSite.name ?? '',
721
592
  });
593
+ this.initialize().catch(err => { throw err; });
722
594
  const wrappedCallback = callback
723
595
  ? (error, response, rawResponse, _) => {
724
596
  this._log.info('updateTargetSite response %j', rawResponse);
@@ -726,8 +598,7 @@ class SiteSearchEngineServiceClient {
726
598
  }
727
599
  : undefined;
728
600
  this._log.info('updateTargetSite request %j', request);
729
- return this.innerApiCalls
730
- .updateTargetSite(request, options, wrappedCallback)
601
+ return this.innerApiCalls.updateTargetSite(request, options, wrappedCallback)
731
602
  ?.then(([response, rawResponse, _]) => {
732
603
  this._log.info('updateTargetSite response %j', rawResponse);
733
604
  return [response, rawResponse, _];
@@ -764,13 +635,10 @@ class SiteSearchEngineServiceClient {
764
635
  options = options || {};
765
636
  options.otherArgs = options.otherArgs || {};
766
637
  options.otherArgs.headers = options.otherArgs.headers || {};
767
- options.otherArgs.headers['x-goog-request-params'] =
768
- this._gaxModule.routingHeader.fromParams({
769
- name: request.name ?? '',
770
- });
771
- this.initialize().catch(err => {
772
- throw err;
638
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
639
+ 'name': request.name ?? '',
773
640
  });
641
+ this.initialize().catch(err => { throw err; });
774
642
  const wrappedCallback = callback
775
643
  ? (error, response, rawResponse, _) => {
776
644
  this._log.info('deleteTargetSite response %j', rawResponse);
@@ -778,8 +646,7 @@ class SiteSearchEngineServiceClient {
778
646
  }
779
647
  : undefined;
780
648
  this._log.info('deleteTargetSite request %j', request);
781
- return this.innerApiCalls
782
- .deleteTargetSite(request, options, wrappedCallback)
649
+ return this.innerApiCalls.deleteTargetSite(request, options, wrappedCallback)
783
650
  ?.then(([response, rawResponse, _]) => {
784
651
  this._log.info('deleteTargetSite response %j', rawResponse);
785
652
  return [response, rawResponse, _];
@@ -816,13 +683,10 @@ class SiteSearchEngineServiceClient {
816
683
  options = options || {};
817
684
  options.otherArgs = options.otherArgs || {};
818
685
  options.otherArgs.headers = options.otherArgs.headers || {};
819
- options.otherArgs.headers['x-goog-request-params'] =
820
- this._gaxModule.routingHeader.fromParams({
821
- parent: request.parent ?? '',
822
- });
823
- this.initialize().catch(err => {
824
- throw err;
686
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
687
+ 'parent': request.parent ?? '',
825
688
  });
689
+ this.initialize().catch(err => { throw err; });
826
690
  const wrappedCallback = callback
827
691
  ? (error, response, rawResponse, _) => {
828
692
  this._log.info('createSitemap response %j', rawResponse);
@@ -830,8 +694,7 @@ class SiteSearchEngineServiceClient {
830
694
  }
831
695
  : undefined;
832
696
  this._log.info('createSitemap request %j', request);
833
- return this.innerApiCalls
834
- .createSitemap(request, options, wrappedCallback)
697
+ return this.innerApiCalls.createSitemap(request, options, wrappedCallback)
835
698
  ?.then(([response, rawResponse, _]) => {
836
699
  this._log.info('createSitemap response %j', rawResponse);
837
700
  return [response, rawResponse, _];
@@ -868,13 +731,10 @@ class SiteSearchEngineServiceClient {
868
731
  options = options || {};
869
732
  options.otherArgs = options.otherArgs || {};
870
733
  options.otherArgs.headers = options.otherArgs.headers || {};
871
- options.otherArgs.headers['x-goog-request-params'] =
872
- this._gaxModule.routingHeader.fromParams({
873
- name: request.name ?? '',
874
- });
875
- this.initialize().catch(err => {
876
- throw err;
734
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
735
+ 'name': request.name ?? '',
877
736
  });
737
+ this.initialize().catch(err => { throw err; });
878
738
  const wrappedCallback = callback
879
739
  ? (error, response, rawResponse, _) => {
880
740
  this._log.info('deleteSitemap response %j', rawResponse);
@@ -882,8 +742,7 @@ class SiteSearchEngineServiceClient {
882
742
  }
883
743
  : undefined;
884
744
  this._log.info('deleteSitemap request %j', request);
885
- return this.innerApiCalls
886
- .deleteSitemap(request, options, wrappedCallback)
745
+ return this.innerApiCalls.deleteSitemap(request, options, wrappedCallback)
887
746
  ?.then(([response, rawResponse, _]) => {
888
747
  this._log.info('deleteSitemap response %j', rawResponse);
889
748
  return [response, rawResponse, _];
@@ -920,13 +779,10 @@ class SiteSearchEngineServiceClient {
920
779
  options = options || {};
921
780
  options.otherArgs = options.otherArgs || {};
922
781
  options.otherArgs.headers = options.otherArgs.headers || {};
923
- options.otherArgs.headers['x-goog-request-params'] =
924
- this._gaxModule.routingHeader.fromParams({
925
- site_search_engine: request.siteSearchEngine ?? '',
926
- });
927
- this.initialize().catch(err => {
928
- throw err;
782
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
783
+ 'site_search_engine': request.siteSearchEngine ?? '',
929
784
  });
785
+ this.initialize().catch(err => { throw err; });
930
786
  const wrappedCallback = callback
931
787
  ? (error, response, rawResponse, _) => {
932
788
  this._log.info('enableAdvancedSiteSearch response %j', rawResponse);
@@ -934,8 +790,7 @@ class SiteSearchEngineServiceClient {
934
790
  }
935
791
  : undefined;
936
792
  this._log.info('enableAdvancedSiteSearch request %j', request);
937
- return this.innerApiCalls
938
- .enableAdvancedSiteSearch(request, options, wrappedCallback)
793
+ return this.innerApiCalls.enableAdvancedSiteSearch(request, options, wrappedCallback)
939
794
  ?.then(([response, rawResponse, _]) => {
940
795
  this._log.info('enableAdvancedSiteSearch response %j', rawResponse);
941
796
  return [response, rawResponse, _];
@@ -972,13 +827,10 @@ class SiteSearchEngineServiceClient {
972
827
  options = options || {};
973
828
  options.otherArgs = options.otherArgs || {};
974
829
  options.otherArgs.headers = options.otherArgs.headers || {};
975
- options.otherArgs.headers['x-goog-request-params'] =
976
- this._gaxModule.routingHeader.fromParams({
977
- site_search_engine: request.siteSearchEngine ?? '',
978
- });
979
- this.initialize().catch(err => {
980
- throw err;
830
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
831
+ 'site_search_engine': request.siteSearchEngine ?? '',
981
832
  });
833
+ this.initialize().catch(err => { throw err; });
982
834
  const wrappedCallback = callback
983
835
  ? (error, response, rawResponse, _) => {
984
836
  this._log.info('disableAdvancedSiteSearch response %j', rawResponse);
@@ -986,8 +838,7 @@ class SiteSearchEngineServiceClient {
986
838
  }
987
839
  : undefined;
988
840
  this._log.info('disableAdvancedSiteSearch request %j', request);
989
- return this.innerApiCalls
990
- .disableAdvancedSiteSearch(request, options, wrappedCallback)
841
+ return this.innerApiCalls.disableAdvancedSiteSearch(request, options, wrappedCallback)
991
842
  ?.then(([response, rawResponse, _]) => {
992
843
  this._log.info('disableAdvancedSiteSearch response %j', rawResponse);
993
844
  return [response, rawResponse, _];
@@ -1024,13 +875,10 @@ class SiteSearchEngineServiceClient {
1024
875
  options = options || {};
1025
876
  options.otherArgs = options.otherArgs || {};
1026
877
  options.otherArgs.headers = options.otherArgs.headers || {};
1027
- options.otherArgs.headers['x-goog-request-params'] =
1028
- this._gaxModule.routingHeader.fromParams({
1029
- site_search_engine: request.siteSearchEngine ?? '',
1030
- });
1031
- this.initialize().catch(err => {
1032
- throw err;
878
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
879
+ 'site_search_engine': request.siteSearchEngine ?? '',
1033
880
  });
881
+ this.initialize().catch(err => { throw err; });
1034
882
  const wrappedCallback = callback
1035
883
  ? (error, response, rawResponse, _) => {
1036
884
  this._log.info('recrawlUris response %j', rawResponse);
@@ -1038,8 +886,7 @@ class SiteSearchEngineServiceClient {
1038
886
  }
1039
887
  : undefined;
1040
888
  this._log.info('recrawlUris request %j', request);
1041
- return this.innerApiCalls
1042
- .recrawlUris(request, options, wrappedCallback)
889
+ return this.innerApiCalls.recrawlUris(request, options, wrappedCallback)
1043
890
  ?.then(([response, rawResponse, _]) => {
1044
891
  this._log.info('recrawlUris response %j', rawResponse);
1045
892
  return [response, rawResponse, _];
@@ -1076,13 +923,10 @@ class SiteSearchEngineServiceClient {
1076
923
  options = options || {};
1077
924
  options.otherArgs = options.otherArgs || {};
1078
925
  options.otherArgs.headers = options.otherArgs.headers || {};
1079
- options.otherArgs.headers['x-goog-request-params'] =
1080
- this._gaxModule.routingHeader.fromParams({
1081
- parent: request.parent ?? '',
1082
- });
1083
- this.initialize().catch(err => {
1084
- throw err;
926
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
927
+ 'parent': request.parent ?? '',
1085
928
  });
929
+ this.initialize().catch(err => { throw err; });
1086
930
  const wrappedCallback = callback
1087
931
  ? (error, response, rawResponse, _) => {
1088
932
  this._log.info('batchVerifyTargetSites response %j', rawResponse);
@@ -1090,8 +934,7 @@ class SiteSearchEngineServiceClient {
1090
934
  }
1091
935
  : undefined;
1092
936
  this._log.info('batchVerifyTargetSites request %j', request);
1093
- return this.innerApiCalls
1094
- .batchVerifyTargetSites(request, options, wrappedCallback)
937
+ return this.innerApiCalls.batchVerifyTargetSites(request, options, wrappedCallback)
1095
938
  ?.then(([response, rawResponse, _]) => {
1096
939
  this._log.info('batchVerifyTargetSites response %j', rawResponse);
1097
940
  return [response, rawResponse, _];
@@ -1128,13 +971,10 @@ class SiteSearchEngineServiceClient {
1128
971
  options = options || {};
1129
972
  options.otherArgs = options.otherArgs || {};
1130
973
  options.otherArgs.headers = options.otherArgs.headers || {};
1131
- options.otherArgs.headers['x-goog-request-params'] =
1132
- this._gaxModule.routingHeader.fromParams({
1133
- parent: request.parent ?? '',
1134
- });
1135
- this.initialize().catch(err => {
1136
- throw err;
974
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
975
+ 'parent': request.parent ?? '',
1137
976
  });
977
+ this.initialize().catch(err => { throw err; });
1138
978
  const wrappedCallback = callback
1139
979
  ? (error, values, nextPageRequest, rawResponse) => {
1140
980
  this._log.info('listTargetSites values %j', values);
@@ -1189,15 +1029,12 @@ class SiteSearchEngineServiceClient {
1189
1029
  options = options || {};
1190
1030
  options.otherArgs = options.otherArgs || {};
1191
1031
  options.otherArgs.headers = options.otherArgs.headers || {};
1192
- options.otherArgs.headers['x-goog-request-params'] =
1193
- this._gaxModule.routingHeader.fromParams({
1194
- parent: request.parent ?? '',
1195
- });
1032
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1033
+ 'parent': request.parent ?? '',
1034
+ });
1196
1035
  const defaultCallSettings = this._defaults['listTargetSites'];
1197
1036
  const callSettings = defaultCallSettings.merge(options);
1198
- this.initialize().catch(err => {
1199
- throw err;
1200
- });
1037
+ this.initialize().catch(err => { throw err; });
1201
1038
  this._log.info('listTargetSites stream %j', request);
1202
1039
  return this.descriptors.page.listTargetSites.createStream(this.innerApiCalls.listTargetSites, request, callSettings);
1203
1040
  }
@@ -1244,15 +1081,12 @@ class SiteSearchEngineServiceClient {
1244
1081
  options = options || {};
1245
1082
  options.otherArgs = options.otherArgs || {};
1246
1083
  options.otherArgs.headers = options.otherArgs.headers || {};
1247
- options.otherArgs.headers['x-goog-request-params'] =
1248
- this._gaxModule.routingHeader.fromParams({
1249
- parent: request.parent ?? '',
1250
- });
1084
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1085
+ 'parent': request.parent ?? '',
1086
+ });
1251
1087
  const defaultCallSettings = this._defaults['listTargetSites'];
1252
1088
  const callSettings = defaultCallSettings.merge(options);
1253
- this.initialize().catch(err => {
1254
- throw err;
1255
- });
1089
+ this.initialize().catch(err => { throw err; });
1256
1090
  this._log.info('listTargetSites iterate %j', request);
1257
1091
  return this.descriptors.page.listTargetSites.asyncIterate(this.innerApiCalls['listTargetSites'], request, callSettings);
1258
1092
  }
@@ -1269,13 +1103,10 @@ class SiteSearchEngineServiceClient {
1269
1103
  options = options || {};
1270
1104
  options.otherArgs = options.otherArgs || {};
1271
1105
  options.otherArgs.headers = options.otherArgs.headers || {};
1272
- options.otherArgs.headers['x-goog-request-params'] =
1273
- this._gaxModule.routingHeader.fromParams({
1274
- site_search_engine: request.siteSearchEngine ?? '',
1275
- });
1276
- this.initialize().catch(err => {
1277
- throw err;
1106
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1107
+ 'site_search_engine': request.siteSearchEngine ?? '',
1278
1108
  });
1109
+ this.initialize().catch(err => { throw err; });
1279
1110
  const wrappedCallback = callback
1280
1111
  ? (error, values, nextPageRequest, rawResponse) => {
1281
1112
  this._log.info('fetchDomainVerificationStatus values %j', values);
@@ -1327,15 +1158,12 @@ class SiteSearchEngineServiceClient {
1327
1158
  options = options || {};
1328
1159
  options.otherArgs = options.otherArgs || {};
1329
1160
  options.otherArgs.headers = options.otherArgs.headers || {};
1330
- options.otherArgs.headers['x-goog-request-params'] =
1331
- this._gaxModule.routingHeader.fromParams({
1332
- site_search_engine: request.siteSearchEngine ?? '',
1333
- });
1161
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1162
+ 'site_search_engine': request.siteSearchEngine ?? '',
1163
+ });
1334
1164
  const defaultCallSettings = this._defaults['fetchDomainVerificationStatus'];
1335
1165
  const callSettings = defaultCallSettings.merge(options);
1336
- this.initialize().catch(err => {
1337
- throw err;
1338
- });
1166
+ this.initialize().catch(err => { throw err; });
1339
1167
  this._log.info('fetchDomainVerificationStatus stream %j', request);
1340
1168
  return this.descriptors.page.fetchDomainVerificationStatus.createStream(this.innerApiCalls.fetchDomainVerificationStatus, request, callSettings);
1341
1169
  }
@@ -1379,103 +1207,100 @@ class SiteSearchEngineServiceClient {
1379
1207
  options = options || {};
1380
1208
  options.otherArgs = options.otherArgs || {};
1381
1209
  options.otherArgs.headers = options.otherArgs.headers || {};
1382
- options.otherArgs.headers['x-goog-request-params'] =
1383
- this._gaxModule.routingHeader.fromParams({
1384
- site_search_engine: request.siteSearchEngine ?? '',
1385
- });
1210
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1211
+ 'site_search_engine': request.siteSearchEngine ?? '',
1212
+ });
1386
1213
  const defaultCallSettings = this._defaults['fetchDomainVerificationStatus'];
1387
1214
  const callSettings = defaultCallSettings.merge(options);
1388
- this.initialize().catch(err => {
1389
- throw err;
1390
- });
1215
+ this.initialize().catch(err => { throw err; });
1391
1216
  this._log.info('fetchDomainVerificationStatus iterate %j', request);
1392
1217
  return this.descriptors.page.fetchDomainVerificationStatus.asyncIterate(this.innerApiCalls['fetchDomainVerificationStatus'], request, callSettings);
1393
1218
  }
1394
1219
  /**
1395
- * Gets information about a location.
1396
- *
1397
- * @param {Object} request
1398
- * The request object that will be sent.
1399
- * @param {string} request.name
1400
- * Resource name for the location.
1401
- * @param {object} [options]
1402
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
1403
- * @returns {Promise} - The promise which resolves to an array.
1404
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
1405
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
1406
- * for more details and examples.
1407
- * @example
1408
- * ```
1409
- * const [response] = await client.getLocation(request);
1410
- * ```
1411
- */
1220
+ * Gets information about a location.
1221
+ *
1222
+ * @param {Object} request
1223
+ * The request object that will be sent.
1224
+ * @param {string} request.name
1225
+ * Resource name for the location.
1226
+ * @param {object} [options]
1227
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
1228
+ * @returns {Promise} - The promise which resolves to an array.
1229
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
1230
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
1231
+ * for more details and examples.
1232
+ * @example
1233
+ * ```
1234
+ * const [response] = await client.getLocation(request);
1235
+ * ```
1236
+ */
1412
1237
  getLocation(request, options, callback) {
1413
1238
  return this.locationsClient.getLocation(request, options, callback);
1414
1239
  }
1415
1240
  /**
1416
- * Lists information about the supported locations for this service. Returns an iterable object.
1417
- *
1418
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1419
- * @param {Object} request
1420
- * The request object that will be sent.
1421
- * @param {string} request.name
1422
- * The resource that owns the locations collection, if applicable.
1423
- * @param {string} request.filter
1424
- * The standard list filter.
1425
- * @param {number} request.pageSize
1426
- * The standard list page size.
1427
- * @param {string} request.pageToken
1428
- * The standard list page token.
1429
- * @param {object} [options]
1430
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1431
- * @returns {Object}
1432
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1433
- * When you iterate the returned iterable, each element will be an object representing
1434
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
1435
- * so you can stop the iteration when you don't need more results.
1436
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1437
- * for more details and examples.
1438
- * @example
1439
- * ```
1440
- * const iterable = client.listLocationsAsync(request);
1441
- * for await (const response of iterable) {
1442
- * // process response
1443
- * }
1444
- * ```
1445
- */
1241
+ * Lists information about the supported locations for this service. Returns an iterable object.
1242
+ *
1243
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1244
+ * @param {Object} request
1245
+ * The request object that will be sent.
1246
+ * @param {string} request.name
1247
+ * The resource that owns the locations collection, if applicable.
1248
+ * @param {string} request.filter
1249
+ * The standard list filter.
1250
+ * @param {number} request.pageSize
1251
+ * The standard list page size.
1252
+ * @param {string} request.pageToken
1253
+ * The standard list page token.
1254
+ * @param {object} [options]
1255
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1256
+ * @returns {Object}
1257
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1258
+ * When you iterate the returned iterable, each element will be an object representing
1259
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
1260
+ * so you can stop the iteration when you don't need more results.
1261
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1262
+ * for more details and examples.
1263
+ * @example
1264
+ * ```
1265
+ * const iterable = client.listLocationsAsync(request);
1266
+ * for await (const response of iterable) {
1267
+ * // process response
1268
+ * }
1269
+ * ```
1270
+ */
1446
1271
  listLocationsAsync(request, options) {
1447
1272
  return this.locationsClient.listLocationsAsync(request, options);
1448
1273
  }
1449
1274
  /**
1450
- * Gets the latest state of a long-running operation. Clients can use this
1451
- * method to poll the operation result at intervals as recommended by the API
1452
- * service.
1453
- *
1454
- * @param {Object} request - The request object that will be sent.
1455
- * @param {string} request.name - The name of the operation resource.
1456
- * @param {Object=} options
1457
- * Optional parameters. You can override the default settings for this call,
1458
- * e.g, timeout, retries, paginations, etc. See {@link
1459
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
1460
- * for the details.
1461
- * @param {function(?Error, ?Object)=} callback
1462
- * The function which will be called with the result of the API call.
1463
- *
1464
- * The second parameter to the callback is an object representing
1465
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
1466
- * @return {Promise} - The promise which resolves to an array.
1467
- * The first element of the array is an object representing
1468
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
1469
- * The promise has a method named "cancel" which cancels the ongoing API call.
1470
- *
1471
- * @example
1472
- * ```
1473
- * const client = longrunning.operationsClient();
1474
- * const name = '';
1475
- * const [response] = await client.getOperation({name});
1476
- * // doThingsWith(response)
1477
- * ```
1478
- */
1275
+ * Gets the latest state of a long-running operation. Clients can use this
1276
+ * method to poll the operation result at intervals as recommended by the API
1277
+ * service.
1278
+ *
1279
+ * @param {Object} request - The request object that will be sent.
1280
+ * @param {string} request.name - The name of the operation resource.
1281
+ * @param {Object=} options
1282
+ * Optional parameters. You can override the default settings for this call,
1283
+ * e.g, timeout, retries, paginations, etc. See {@link
1284
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
1285
+ * for the details.
1286
+ * @param {function(?Error, ?Object)=} callback
1287
+ * The function which will be called with the result of the API call.
1288
+ *
1289
+ * The second parameter to the callback is an object representing
1290
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
1291
+ * @return {Promise} - The promise which resolves to an array.
1292
+ * The first element of the array is an object representing
1293
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
1294
+ * The promise has a method named "cancel" which cancels the ongoing API call.
1295
+ *
1296
+ * @example
1297
+ * ```
1298
+ * const client = longrunning.operationsClient();
1299
+ * const name = '';
1300
+ * const [response] = await client.getOperation({name});
1301
+ * // doThingsWith(response)
1302
+ * ```
1303
+ */
1479
1304
  getOperation(request, optionsOrCallback, callback) {
1480
1305
  let options;
1481
1306
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1709,8 +1534,7 @@ class SiteSearchEngineServiceClient {
1709
1534
  * @returns {string} A string representing the project.
1710
1535
  */
1711
1536
  matchProjectFromEvaluationName(evaluationName) {
1712
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1713
- .project;
1537
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
1714
1538
  }
1715
1539
  /**
1716
1540
  * Parse the location from Evaluation resource.
@@ -1720,8 +1544,7 @@ class SiteSearchEngineServiceClient {
1720
1544
  * @returns {string} A string representing the location.
1721
1545
  */
1722
1546
  matchLocationFromEvaluationName(evaluationName) {
1723
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1724
- .location;
1547
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
1725
1548
  }
1726
1549
  /**
1727
1550
  * Parse the evaluation from Evaluation resource.
@@ -1731,8 +1554,7 @@ class SiteSearchEngineServiceClient {
1731
1554
  * @returns {string} A string representing the evaluation.
1732
1555
  */
1733
1556
  matchEvaluationFromEvaluationName(evaluationName) {
1734
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1735
- .evaluation;
1557
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
1736
1558
  }
1737
1559
  /**
1738
1560
  * Return a fully-qualified groundingConfig resource name string.
@@ -3970,8 +3792,7 @@ class SiteSearchEngineServiceClient {
3970
3792
  * @returns {string} A string representing the project.
3971
3793
  */
3972
3794
  matchProjectFromSampleQueryName(sampleQueryName) {
3973
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3974
- .project;
3795
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3975
3796
  }
3976
3797
  /**
3977
3798
  * Parse the location from SampleQuery resource.
@@ -3981,8 +3802,7 @@ class SiteSearchEngineServiceClient {
3981
3802
  * @returns {string} A string representing the location.
3982
3803
  */
3983
3804
  matchLocationFromSampleQueryName(sampleQueryName) {
3984
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3985
- .location;
3805
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3986
3806
  }
3987
3807
  /**
3988
3808
  * Parse the sample_query_set from SampleQuery resource.
@@ -3992,8 +3812,7 @@ class SiteSearchEngineServiceClient {
3992
3812
  * @returns {string} A string representing the sample_query_set.
3993
3813
  */
3994
3814
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3995
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3996
- .sample_query_set;
3815
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3997
3816
  }
3998
3817
  /**
3999
3818
  * Parse the sample_query from SampleQuery resource.
@@ -4003,8 +3822,7 @@ class SiteSearchEngineServiceClient {
4003
3822
  * @returns {string} A string representing the sample_query.
4004
3823
  */
4005
3824
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
4006
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
4007
- .sample_query;
3825
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
4008
3826
  }
4009
3827
  /**
4010
3828
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -4063,8 +3881,8 @@ class SiteSearchEngineServiceClient {
4063
3881
  this._log.info('ending gRPC channel');
4064
3882
  this._terminated = true;
4065
3883
  stub.close();
4066
- this.locationsClient.close();
4067
- this.operationsClient.close();
3884
+ this.locationsClient.close().catch(err => { throw err; });
3885
+ void this.operationsClient.close();
4068
3886
  });
4069
3887
  }
4070
3888
  return Promise.resolve();