@google-cloud/discoveryengine 2.1.0 → 2.2.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 (121) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/protos/protos.d.ts +31 -316
  3. package/build/protos/protos.js +146 -593
  4. package/build/protos/protos.json +25 -1
  5. package/build/src/index.d.ts +1 -1
  6. package/build/src/index.js +1 -21
  7. package/build/src/v1/completion_service_client.d.ts +76 -76
  8. package/build/src/v1/completion_service_client.js +125 -262
  9. package/build/src/v1/control_service_client.d.ts +81 -81
  10. package/build/src/v1/control_service_client.js +96 -132
  11. package/build/src/v1/conversational_search_service_client.d.ts +143 -143
  12. package/build/src/v1/conversational_search_service_client.js +138 -226
  13. package/build/src/v1/data_store_service_client.d.ts +122 -122
  14. package/build/src/v1/data_store_service_client.js +134 -280
  15. package/build/src/v1/document_service_client.d.ts +120 -120
  16. package/build/src/v1/document_service_client.js +143 -300
  17. package/build/src/v1/engine_service_client.d.ts +103 -103
  18. package/build/src/v1/engine_service_client.js +134 -279
  19. package/build/src/v1/grounded_generation_service_client.d.ts +48 -48
  20. package/build/src/v1/grounded_generation_service_client.js +79 -100
  21. package/build/src/v1/project_service_client.d.ts +76 -76
  22. package/build/src/v1/project_service_client.js +108 -222
  23. package/build/src/v1/rank_service_client.d.ts +47 -47
  24. package/build/src/v1/rank_service_client.js +72 -85
  25. package/build/src/v1/recommendation_service_client.d.ts +47 -47
  26. package/build/src/v1/recommendation_service_client.js +70 -82
  27. package/build/src/v1/schema_service_client.d.ts +111 -111
  28. package/build/src/v1/schema_service_client.js +131 -273
  29. package/build/src/v1/search_service_client.d.ts +545 -545
  30. package/build/src/v1/search_service_client.js +90 -113
  31. package/build/src/v1/search_tuning_service_client.d.ts +77 -77
  32. package/build/src/v1/search_tuning_service_client.js +113 -235
  33. package/build/src/v1/serving_config_service_client.d.ts +48 -48
  34. package/build/src/v1/serving_config_service_client.js +69 -80
  35. package/build/src/v1/site_search_engine_service_client.d.ts +148 -148
  36. package/build/src/v1/site_search_engine_service_client.js +179 -378
  37. package/build/src/v1/user_event_service_client.d.ts +77 -77
  38. package/build/src/v1/user_event_service_client.js +121 -253
  39. package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
  40. package/build/src/v1alpha/acl_config_service_client.js +82 -106
  41. package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
  42. package/build/src/v1alpha/chunk_service_client.js +92 -120
  43. package/build/src/v1alpha/completion_service_client.d.ts +77 -77
  44. package/build/src/v1alpha/completion_service_client.js +134 -280
  45. package/build/src/v1alpha/control_service_client.d.ts +85 -85
  46. package/build/src/v1alpha/control_service_client.js +105 -151
  47. package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
  48. package/build/src/v1alpha/conversational_search_service_client.js +145 -237
  49. package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
  50. package/build/src/v1alpha/data_store_service_client.js +151 -316
  51. package/build/src/v1alpha/document_service_client.d.ts +126 -126
  52. package/build/src/v1alpha/document_service_client.js +156 -328
  53. package/build/src/v1alpha/engine_service_client.d.ts +106 -106
  54. package/build/src/v1alpha/engine_service_client.js +155 -325
  55. package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
  56. package/build/src/v1alpha/estimate_billing_service_client.js +118 -243
  57. package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
  58. package/build/src/v1alpha/evaluation_service_client.js +143 -295
  59. package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
  60. package/build/src/v1alpha/grounded_generation_service_client.js +79 -100
  61. package/build/src/v1alpha/project_service_client.d.ts +78 -78
  62. package/build/src/v1alpha/project_service_client.js +126 -262
  63. package/build/src/v1alpha/rank_service_client.d.ts +47 -47
  64. package/build/src/v1alpha/rank_service_client.js +81 -104
  65. package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
  66. package/build/src/v1alpha/recommendation_service_client.js +79 -100
  67. package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
  68. package/build/src/v1alpha/sample_query_service_client.js +144 -301
  69. package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
  70. package/build/src/v1alpha/sample_query_set_service_client.js +106 -153
  71. package/build/src/v1alpha/schema_service_client.d.ts +112 -112
  72. package/build/src/v1alpha/schema_service_client.js +140 -292
  73. package/build/src/v1alpha/search_service_client.d.ts +327 -327
  74. package/build/src/v1alpha/search_service_client.js +88 -112
  75. package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
  76. package/build/src/v1alpha/search_tuning_service_client.js +122 -253
  77. package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
  78. package/build/src/v1alpha/serving_config_service_client.js +97 -133
  79. package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
  80. package/build/src/v1alpha/site_search_engine_service_client.js +184 -387
  81. package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
  82. package/build/src/v1alpha/user_event_service_client.js +130 -271
  83. package/build/src/v1beta/completion_service_client.d.ts +78 -78
  84. package/build/src/v1beta/completion_service_client.js +136 -279
  85. package/build/src/v1beta/control_service_client.d.ts +84 -84
  86. package/build/src/v1beta/control_service_client.js +103 -147
  87. package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
  88. package/build/src/v1beta/conversational_search_service_client.js +143 -233
  89. package/build/src/v1beta/data_store_service_client.d.ts +124 -124
  90. package/build/src/v1beta/data_store_service_client.js +141 -288
  91. package/build/src/v1beta/document_service_client.d.ts +124 -124
  92. package/build/src/v1beta/document_service_client.js +150 -309
  93. package/build/src/v1beta/engine_service_client.d.ts +106 -106
  94. package/build/src/v1beta/engine_service_client.js +153 -315
  95. package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
  96. package/build/src/v1beta/evaluation_service_client.js +141 -285
  97. package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
  98. package/build/src/v1beta/grounded_generation_service_client.js +86 -114
  99. package/build/src/v1beta/project_service_client.d.ts +76 -76
  100. package/build/src/v1beta/project_service_client.js +115 -231
  101. package/build/src/v1beta/rank_service_client.d.ts +47 -47
  102. package/build/src/v1beta/rank_service_client.js +79 -99
  103. package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
  104. package/build/src/v1beta/recommendation_service_client.js +77 -96
  105. package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
  106. package/build/src/v1beta/sample_query_service_client.js +142 -291
  107. package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
  108. package/build/src/v1beta/sample_query_set_service_client.js +104 -149
  109. package/build/src/v1beta/schema_service_client.d.ts +111 -111
  110. package/build/src/v1beta/schema_service_client.js +138 -282
  111. package/build/src/v1beta/search_service_client.d.ts +665 -665
  112. package/build/src/v1beta/search_service_client.js +97 -128
  113. package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
  114. package/build/src/v1beta/search_tuning_service_client.js +120 -243
  115. package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
  116. package/build/src/v1beta/serving_config_service_client.js +95 -129
  117. package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
  118. package/build/src/v1beta/site_search_engine_service_client.js +186 -386
  119. package/build/src/v1beta/user_event_service_client.d.ts +78 -78
  120. package/build/src/v1beta/user_event_service_client.js +128 -261
  121. package/package.json +1 -1
@@ -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,7 +208,7 @@ 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
213
  const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
221
214
  // This API contains "long-running operations", which return a
@@ -223,115 +216,16 @@ class SiteSearchEngineServiceClient {
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,8 +394,7 @@ 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];
@@ -540,13 +413,10 @@ class SiteSearchEngineServiceClient {
540
413
  options = options || {};
541
414
  options.otherArgs = options.otherArgs || {};
542
415
  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;
416
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
417
+ 'name': request.name ?? '',
549
418
  });
419
+ this.initialize().catch(err => { throw err; });
550
420
  this._log.info('getTargetSite request %j', request);
551
421
  const wrappedCallback = callback
552
422
  ? (error, response, options, rawResponse) => {
@@ -554,8 +424,7 @@ class SiteSearchEngineServiceClient {
554
424
  callback(error, response, options, rawResponse); // We verified callback above.
555
425
  }
556
426
  : undefined;
557
- return this.innerApiCalls
558
- .getTargetSite(request, options, wrappedCallback)
427
+ return this.innerApiCalls.getTargetSite(request, options, wrappedCallback)
559
428
  ?.then(([response, options, rawResponse]) => {
560
429
  this._log.info('getTargetSite response %j', response);
561
430
  return [response, options, rawResponse];
@@ -574,13 +443,10 @@ class SiteSearchEngineServiceClient {
574
443
  options = options || {};
575
444
  options.otherArgs = options.otherArgs || {};
576
445
  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;
446
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
447
+ 'parent': request.parent ?? '',
583
448
  });
449
+ this.initialize().catch(err => { throw err; });
584
450
  this._log.info('fetchSitemaps request %j', request);
585
451
  const wrappedCallback = callback
586
452
  ? (error, response, options, rawResponse) => {
@@ -588,8 +454,7 @@ class SiteSearchEngineServiceClient {
588
454
  callback(error, response, options, rawResponse); // We verified callback above.
589
455
  }
590
456
  : undefined;
591
- return this.innerApiCalls
592
- .fetchSitemaps(request, options, wrappedCallback)
457
+ return this.innerApiCalls.fetchSitemaps(request, options, wrappedCallback)
593
458
  ?.then(([response, options, rawResponse]) => {
594
459
  this._log.info('fetchSitemaps response %j', response);
595
460
  return [response, options, rawResponse];
@@ -608,13 +473,10 @@ class SiteSearchEngineServiceClient {
608
473
  options = options || {};
609
474
  options.otherArgs = options.otherArgs || {};
610
475
  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;
476
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
477
+ 'parent': request.parent ?? '',
617
478
  });
479
+ this.initialize().catch(err => { throw err; });
618
480
  const wrappedCallback = callback
619
481
  ? (error, response, rawResponse, _) => {
620
482
  this._log.info('createTargetSite response %j', rawResponse);
@@ -622,8 +484,7 @@ class SiteSearchEngineServiceClient {
622
484
  }
623
485
  : undefined;
624
486
  this._log.info('createTargetSite request %j', request);
625
- return this.innerApiCalls
626
- .createTargetSite(request, options, wrappedCallback)
487
+ return this.innerApiCalls.createTargetSite(request, options, wrappedCallback)
627
488
  ?.then(([response, rawResponse, _]) => {
628
489
  this._log.info('createTargetSite response %j', rawResponse);
629
490
  return [response, rawResponse, _];
@@ -660,13 +521,10 @@ class SiteSearchEngineServiceClient {
660
521
  options = options || {};
661
522
  options.otherArgs = options.otherArgs || {};
662
523
  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;
524
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
525
+ 'parent': request.parent ?? '',
669
526
  });
527
+ this.initialize().catch(err => { throw err; });
670
528
  const wrappedCallback = callback
671
529
  ? (error, response, rawResponse, _) => {
672
530
  this._log.info('batchCreateTargetSites response %j', rawResponse);
@@ -674,8 +532,7 @@ class SiteSearchEngineServiceClient {
674
532
  }
675
533
  : undefined;
676
534
  this._log.info('batchCreateTargetSites request %j', request);
677
- return this.innerApiCalls
678
- .batchCreateTargetSites(request, options, wrappedCallback)
535
+ return this.innerApiCalls.batchCreateTargetSites(request, options, wrappedCallback)
679
536
  ?.then(([response, rawResponse, _]) => {
680
537
  this._log.info('batchCreateTargetSites response %j', rawResponse);
681
538
  return [response, rawResponse, _];
@@ -712,13 +569,10 @@ class SiteSearchEngineServiceClient {
712
569
  options = options || {};
713
570
  options.otherArgs = options.otherArgs || {};
714
571
  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;
572
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
573
+ 'target_site.name': request.targetSite.name ?? '',
721
574
  });
575
+ this.initialize().catch(err => { throw err; });
722
576
  const wrappedCallback = callback
723
577
  ? (error, response, rawResponse, _) => {
724
578
  this._log.info('updateTargetSite response %j', rawResponse);
@@ -726,8 +580,7 @@ class SiteSearchEngineServiceClient {
726
580
  }
727
581
  : undefined;
728
582
  this._log.info('updateTargetSite request %j', request);
729
- return this.innerApiCalls
730
- .updateTargetSite(request, options, wrappedCallback)
583
+ return this.innerApiCalls.updateTargetSite(request, options, wrappedCallback)
731
584
  ?.then(([response, rawResponse, _]) => {
732
585
  this._log.info('updateTargetSite response %j', rawResponse);
733
586
  return [response, rawResponse, _];
@@ -764,13 +617,10 @@ class SiteSearchEngineServiceClient {
764
617
  options = options || {};
765
618
  options.otherArgs = options.otherArgs || {};
766
619
  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;
620
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
621
+ 'name': request.name ?? '',
773
622
  });
623
+ this.initialize().catch(err => { throw err; });
774
624
  const wrappedCallback = callback
775
625
  ? (error, response, rawResponse, _) => {
776
626
  this._log.info('deleteTargetSite response %j', rawResponse);
@@ -778,8 +628,7 @@ class SiteSearchEngineServiceClient {
778
628
  }
779
629
  : undefined;
780
630
  this._log.info('deleteTargetSite request %j', request);
781
- return this.innerApiCalls
782
- .deleteTargetSite(request, options, wrappedCallback)
631
+ return this.innerApiCalls.deleteTargetSite(request, options, wrappedCallback)
783
632
  ?.then(([response, rawResponse, _]) => {
784
633
  this._log.info('deleteTargetSite response %j', rawResponse);
785
634
  return [response, rawResponse, _];
@@ -816,13 +665,10 @@ class SiteSearchEngineServiceClient {
816
665
  options = options || {};
817
666
  options.otherArgs = options.otherArgs || {};
818
667
  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;
668
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
669
+ 'parent': request.parent ?? '',
825
670
  });
671
+ this.initialize().catch(err => { throw err; });
826
672
  const wrappedCallback = callback
827
673
  ? (error, response, rawResponse, _) => {
828
674
  this._log.info('createSitemap response %j', rawResponse);
@@ -830,8 +676,7 @@ class SiteSearchEngineServiceClient {
830
676
  }
831
677
  : undefined;
832
678
  this._log.info('createSitemap request %j', request);
833
- return this.innerApiCalls
834
- .createSitemap(request, options, wrappedCallback)
679
+ return this.innerApiCalls.createSitemap(request, options, wrappedCallback)
835
680
  ?.then(([response, rawResponse, _]) => {
836
681
  this._log.info('createSitemap response %j', rawResponse);
837
682
  return [response, rawResponse, _];
@@ -868,13 +713,10 @@ class SiteSearchEngineServiceClient {
868
713
  options = options || {};
869
714
  options.otherArgs = options.otherArgs || {};
870
715
  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;
716
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
717
+ 'name': request.name ?? '',
877
718
  });
719
+ this.initialize().catch(err => { throw err; });
878
720
  const wrappedCallback = callback
879
721
  ? (error, response, rawResponse, _) => {
880
722
  this._log.info('deleteSitemap response %j', rawResponse);
@@ -882,8 +724,7 @@ class SiteSearchEngineServiceClient {
882
724
  }
883
725
  : undefined;
884
726
  this._log.info('deleteSitemap request %j', request);
885
- return this.innerApiCalls
886
- .deleteSitemap(request, options, wrappedCallback)
727
+ return this.innerApiCalls.deleteSitemap(request, options, wrappedCallback)
887
728
  ?.then(([response, rawResponse, _]) => {
888
729
  this._log.info('deleteSitemap response %j', rawResponse);
889
730
  return [response, rawResponse, _];
@@ -920,13 +761,10 @@ class SiteSearchEngineServiceClient {
920
761
  options = options || {};
921
762
  options.otherArgs = options.otherArgs || {};
922
763
  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;
764
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
765
+ 'site_search_engine': request.siteSearchEngine ?? '',
929
766
  });
767
+ this.initialize().catch(err => { throw err; });
930
768
  const wrappedCallback = callback
931
769
  ? (error, response, rawResponse, _) => {
932
770
  this._log.info('enableAdvancedSiteSearch response %j', rawResponse);
@@ -934,8 +772,7 @@ class SiteSearchEngineServiceClient {
934
772
  }
935
773
  : undefined;
936
774
  this._log.info('enableAdvancedSiteSearch request %j', request);
937
- return this.innerApiCalls
938
- .enableAdvancedSiteSearch(request, options, wrappedCallback)
775
+ return this.innerApiCalls.enableAdvancedSiteSearch(request, options, wrappedCallback)
939
776
  ?.then(([response, rawResponse, _]) => {
940
777
  this._log.info('enableAdvancedSiteSearch response %j', rawResponse);
941
778
  return [response, rawResponse, _];
@@ -972,13 +809,10 @@ class SiteSearchEngineServiceClient {
972
809
  options = options || {};
973
810
  options.otherArgs = options.otherArgs || {};
974
811
  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;
812
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
813
+ 'site_search_engine': request.siteSearchEngine ?? '',
981
814
  });
815
+ this.initialize().catch(err => { throw err; });
982
816
  const wrappedCallback = callback
983
817
  ? (error, response, rawResponse, _) => {
984
818
  this._log.info('disableAdvancedSiteSearch response %j', rawResponse);
@@ -986,8 +820,7 @@ class SiteSearchEngineServiceClient {
986
820
  }
987
821
  : undefined;
988
822
  this._log.info('disableAdvancedSiteSearch request %j', request);
989
- return this.innerApiCalls
990
- .disableAdvancedSiteSearch(request, options, wrappedCallback)
823
+ return this.innerApiCalls.disableAdvancedSiteSearch(request, options, wrappedCallback)
991
824
  ?.then(([response, rawResponse, _]) => {
992
825
  this._log.info('disableAdvancedSiteSearch response %j', rawResponse);
993
826
  return [response, rawResponse, _];
@@ -1024,13 +857,10 @@ class SiteSearchEngineServiceClient {
1024
857
  options = options || {};
1025
858
  options.otherArgs = options.otherArgs || {};
1026
859
  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;
860
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
861
+ 'site_search_engine': request.siteSearchEngine ?? '',
1033
862
  });
863
+ this.initialize().catch(err => { throw err; });
1034
864
  const wrappedCallback = callback
1035
865
  ? (error, response, rawResponse, _) => {
1036
866
  this._log.info('recrawlUris response %j', rawResponse);
@@ -1038,8 +868,7 @@ class SiteSearchEngineServiceClient {
1038
868
  }
1039
869
  : undefined;
1040
870
  this._log.info('recrawlUris request %j', request);
1041
- return this.innerApiCalls
1042
- .recrawlUris(request, options, wrappedCallback)
871
+ return this.innerApiCalls.recrawlUris(request, options, wrappedCallback)
1043
872
  ?.then(([response, rawResponse, _]) => {
1044
873
  this._log.info('recrawlUris response %j', rawResponse);
1045
874
  return [response, rawResponse, _];
@@ -1076,13 +905,10 @@ class SiteSearchEngineServiceClient {
1076
905
  options = options || {};
1077
906
  options.otherArgs = options.otherArgs || {};
1078
907
  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;
908
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
909
+ 'parent': request.parent ?? '',
1085
910
  });
911
+ this.initialize().catch(err => { throw err; });
1086
912
  const wrappedCallback = callback
1087
913
  ? (error, response, rawResponse, _) => {
1088
914
  this._log.info('batchVerifyTargetSites response %j', rawResponse);
@@ -1090,8 +916,7 @@ class SiteSearchEngineServiceClient {
1090
916
  }
1091
917
  : undefined;
1092
918
  this._log.info('batchVerifyTargetSites request %j', request);
1093
- return this.innerApiCalls
1094
- .batchVerifyTargetSites(request, options, wrappedCallback)
919
+ return this.innerApiCalls.batchVerifyTargetSites(request, options, wrappedCallback)
1095
920
  ?.then(([response, rawResponse, _]) => {
1096
921
  this._log.info('batchVerifyTargetSites response %j', rawResponse);
1097
922
  return [response, rawResponse, _];
@@ -1128,13 +953,10 @@ class SiteSearchEngineServiceClient {
1128
953
  options = options || {};
1129
954
  options.otherArgs = options.otherArgs || {};
1130
955
  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;
956
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
957
+ 'parent': request.parent ?? '',
1137
958
  });
959
+ this.initialize().catch(err => { throw err; });
1138
960
  const wrappedCallback = callback
1139
961
  ? (error, values, nextPageRequest, rawResponse) => {
1140
962
  this._log.info('listTargetSites values %j', values);
@@ -1189,15 +1011,12 @@ class SiteSearchEngineServiceClient {
1189
1011
  options = options || {};
1190
1012
  options.otherArgs = options.otherArgs || {};
1191
1013
  options.otherArgs.headers = options.otherArgs.headers || {};
1192
- options.otherArgs.headers['x-goog-request-params'] =
1193
- this._gaxModule.routingHeader.fromParams({
1194
- parent: request.parent ?? '',
1195
- });
1014
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1015
+ 'parent': request.parent ?? '',
1016
+ });
1196
1017
  const defaultCallSettings = this._defaults['listTargetSites'];
1197
1018
  const callSettings = defaultCallSettings.merge(options);
1198
- this.initialize().catch(err => {
1199
- throw err;
1200
- });
1019
+ this.initialize().catch(err => { throw err; });
1201
1020
  this._log.info('listTargetSites stream %j', request);
1202
1021
  return this.descriptors.page.listTargetSites.createStream(this.innerApiCalls.listTargetSites, request, callSettings);
1203
1022
  }
@@ -1244,15 +1063,12 @@ class SiteSearchEngineServiceClient {
1244
1063
  options = options || {};
1245
1064
  options.otherArgs = options.otherArgs || {};
1246
1065
  options.otherArgs.headers = options.otherArgs.headers || {};
1247
- options.otherArgs.headers['x-goog-request-params'] =
1248
- this._gaxModule.routingHeader.fromParams({
1249
- parent: request.parent ?? '',
1250
- });
1066
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1067
+ 'parent': request.parent ?? '',
1068
+ });
1251
1069
  const defaultCallSettings = this._defaults['listTargetSites'];
1252
1070
  const callSettings = defaultCallSettings.merge(options);
1253
- this.initialize().catch(err => {
1254
- throw err;
1255
- });
1071
+ this.initialize().catch(err => { throw err; });
1256
1072
  this._log.info('listTargetSites iterate %j', request);
1257
1073
  return this.descriptors.page.listTargetSites.asyncIterate(this.innerApiCalls['listTargetSites'], request, callSettings);
1258
1074
  }
@@ -1269,13 +1085,10 @@ class SiteSearchEngineServiceClient {
1269
1085
  options = options || {};
1270
1086
  options.otherArgs = options.otherArgs || {};
1271
1087
  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;
1088
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1089
+ 'site_search_engine': request.siteSearchEngine ?? '',
1278
1090
  });
1091
+ this.initialize().catch(err => { throw err; });
1279
1092
  const wrappedCallback = callback
1280
1093
  ? (error, values, nextPageRequest, rawResponse) => {
1281
1094
  this._log.info('fetchDomainVerificationStatus values %j', values);
@@ -1327,15 +1140,12 @@ class SiteSearchEngineServiceClient {
1327
1140
  options = options || {};
1328
1141
  options.otherArgs = options.otherArgs || {};
1329
1142
  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
- });
1143
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1144
+ 'site_search_engine': request.siteSearchEngine ?? '',
1145
+ });
1334
1146
  const defaultCallSettings = this._defaults['fetchDomainVerificationStatus'];
1335
1147
  const callSettings = defaultCallSettings.merge(options);
1336
- this.initialize().catch(err => {
1337
- throw err;
1338
- });
1148
+ this.initialize().catch(err => { throw err; });
1339
1149
  this._log.info('fetchDomainVerificationStatus stream %j', request);
1340
1150
  return this.descriptors.page.fetchDomainVerificationStatus.createStream(this.innerApiCalls.fetchDomainVerificationStatus, request, callSettings);
1341
1151
  }
@@ -1379,103 +1189,100 @@ class SiteSearchEngineServiceClient {
1379
1189
  options = options || {};
1380
1190
  options.otherArgs = options.otherArgs || {};
1381
1191
  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
- });
1192
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
1193
+ 'site_search_engine': request.siteSearchEngine ?? '',
1194
+ });
1386
1195
  const defaultCallSettings = this._defaults['fetchDomainVerificationStatus'];
1387
1196
  const callSettings = defaultCallSettings.merge(options);
1388
- this.initialize().catch(err => {
1389
- throw err;
1390
- });
1197
+ this.initialize().catch(err => { throw err; });
1391
1198
  this._log.info('fetchDomainVerificationStatus iterate %j', request);
1392
1199
  return this.descriptors.page.fetchDomainVerificationStatus.asyncIterate(this.innerApiCalls['fetchDomainVerificationStatus'], request, callSettings);
1393
1200
  }
1394
1201
  /**
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
- */
1202
+ * Gets information about a location.
1203
+ *
1204
+ * @param {Object} request
1205
+ * The request object that will be sent.
1206
+ * @param {string} request.name
1207
+ * Resource name for the location.
1208
+ * @param {object} [options]
1209
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
1210
+ * @returns {Promise} - The promise which resolves to an array.
1211
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
1212
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
1213
+ * for more details and examples.
1214
+ * @example
1215
+ * ```
1216
+ * const [response] = await client.getLocation(request);
1217
+ * ```
1218
+ */
1412
1219
  getLocation(request, options, callback) {
1413
1220
  return this.locationsClient.getLocation(request, options, callback);
1414
1221
  }
1415
1222
  /**
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
- */
1223
+ * Lists information about the supported locations for this service. Returns an iterable object.
1224
+ *
1225
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1226
+ * @param {Object} request
1227
+ * The request object that will be sent.
1228
+ * @param {string} request.name
1229
+ * The resource that owns the locations collection, if applicable.
1230
+ * @param {string} request.filter
1231
+ * The standard list filter.
1232
+ * @param {number} request.pageSize
1233
+ * The standard list page size.
1234
+ * @param {string} request.pageToken
1235
+ * The standard list page token.
1236
+ * @param {object} [options]
1237
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1238
+ * @returns {Object}
1239
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1240
+ * When you iterate the returned iterable, each element will be an object representing
1241
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
1242
+ * so you can stop the iteration when you don't need more results.
1243
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1244
+ * for more details and examples.
1245
+ * @example
1246
+ * ```
1247
+ * const iterable = client.listLocationsAsync(request);
1248
+ * for await (const response of iterable) {
1249
+ * // process response
1250
+ * }
1251
+ * ```
1252
+ */
1446
1253
  listLocationsAsync(request, options) {
1447
1254
  return this.locationsClient.listLocationsAsync(request, options);
1448
1255
  }
1449
1256
  /**
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
- */
1257
+ * Gets the latest state of a long-running operation. Clients can use this
1258
+ * method to poll the operation result at intervals as recommended by the API
1259
+ * service.
1260
+ *
1261
+ * @param {Object} request - The request object that will be sent.
1262
+ * @param {string} request.name - The name of the operation resource.
1263
+ * @param {Object=} options
1264
+ * Optional parameters. You can override the default settings for this call,
1265
+ * e.g, timeout, retries, paginations, etc. See {@link
1266
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
1267
+ * for the details.
1268
+ * @param {function(?Error, ?Object)=} callback
1269
+ * The function which will be called with the result of the API call.
1270
+ *
1271
+ * The second parameter to the callback is an object representing
1272
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
1273
+ * @return {Promise} - The promise which resolves to an array.
1274
+ * The first element of the array is an object representing
1275
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
1276
+ * The promise has a method named "cancel" which cancels the ongoing API call.
1277
+ *
1278
+ * @example
1279
+ * ```
1280
+ * const client = longrunning.operationsClient();
1281
+ * const name = '';
1282
+ * const [response] = await client.getOperation({name});
1283
+ * // doThingsWith(response)
1284
+ * ```
1285
+ */
1479
1286
  getOperation(request, optionsOrCallback, callback) {
1480
1287
  let options;
1481
1288
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1709,8 +1516,7 @@ class SiteSearchEngineServiceClient {
1709
1516
  * @returns {string} A string representing the project.
1710
1517
  */
1711
1518
  matchProjectFromEvaluationName(evaluationName) {
1712
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1713
- .project;
1519
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
1714
1520
  }
1715
1521
  /**
1716
1522
  * Parse the location from Evaluation resource.
@@ -1720,8 +1526,7 @@ class SiteSearchEngineServiceClient {
1720
1526
  * @returns {string} A string representing the location.
1721
1527
  */
1722
1528
  matchLocationFromEvaluationName(evaluationName) {
1723
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1724
- .location;
1529
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
1725
1530
  }
1726
1531
  /**
1727
1532
  * Parse the evaluation from Evaluation resource.
@@ -1731,8 +1536,7 @@ class SiteSearchEngineServiceClient {
1731
1536
  * @returns {string} A string representing the evaluation.
1732
1537
  */
1733
1538
  matchEvaluationFromEvaluationName(evaluationName) {
1734
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
1735
- .evaluation;
1539
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
1736
1540
  }
1737
1541
  /**
1738
1542
  * Return a fully-qualified groundingConfig resource name string.
@@ -3970,8 +3774,7 @@ class SiteSearchEngineServiceClient {
3970
3774
  * @returns {string} A string representing the project.
3971
3775
  */
3972
3776
  matchProjectFromSampleQueryName(sampleQueryName) {
3973
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3974
- .project;
3777
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
3975
3778
  }
3976
3779
  /**
3977
3780
  * Parse the location from SampleQuery resource.
@@ -3981,8 +3784,7 @@ class SiteSearchEngineServiceClient {
3981
3784
  * @returns {string} A string representing the location.
3982
3785
  */
3983
3786
  matchLocationFromSampleQueryName(sampleQueryName) {
3984
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3985
- .location;
3787
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
3986
3788
  }
3987
3789
  /**
3988
3790
  * Parse the sample_query_set from SampleQuery resource.
@@ -3992,8 +3794,7 @@ class SiteSearchEngineServiceClient {
3992
3794
  * @returns {string} A string representing the sample_query_set.
3993
3795
  */
3994
3796
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
3995
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
3996
- .sample_query_set;
3797
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
3997
3798
  }
3998
3799
  /**
3999
3800
  * Parse the sample_query from SampleQuery resource.
@@ -4003,8 +3804,7 @@ class SiteSearchEngineServiceClient {
4003
3804
  * @returns {string} A string representing the sample_query.
4004
3805
  */
4005
3806
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
4006
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
4007
- .sample_query;
3807
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
4008
3808
  }
4009
3809
  /**
4010
3810
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -4063,8 +3863,8 @@ class SiteSearchEngineServiceClient {
4063
3863
  this._log.info('ending gRPC channel');
4064
3864
  this._terminated = true;
4065
3865
  stub.close();
4066
- this.locationsClient.close();
4067
- this.operationsClient.close();
3866
+ this.locationsClient.close().catch(err => { throw err; });
3867
+ void this.operationsClient.close();
4068
3868
  });
4069
3869
  }
4070
3870
  return Promise.resolve();