@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
@@ -246,40 +246,40 @@ export declare class ControlServiceClient {
246
246
  getControl(request: protos.google.cloud.discoveryengine.v1.IGetControlRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1.IControl, protos.google.cloud.discoveryengine.v1.IGetControlRequest | null | undefined, {} | null | undefined>): void;
247
247
  getControl(request: protos.google.cloud.discoveryengine.v1.IGetControlRequest, callback: Callback<protos.google.cloud.discoveryengine.v1.IControl, protos.google.cloud.discoveryengine.v1.IGetControlRequest | null | undefined, {} | null | undefined>): void;
248
248
  /**
249
- * Lists all Controls by their parent
250
- * {@link protos.google.cloud.discoveryengine.v1.DataStore|DataStore}.
251
- *
252
- * @param {Object} request
253
- * The request object that will be sent.
254
- * @param {string} request.parent
255
- * Required. The data store resource name. Format:
256
- * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`
257
- * or
258
- * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`.
259
- * @param {number} [request.pageSize]
260
- * Optional. Maximum number of results to return. If unspecified, defaults
261
- * to 50. Max allowed value is 1000.
262
- * @param {string} [request.pageToken]
263
- * Optional. A page token, received from a previous `ListControls` call.
264
- * Provide this to retrieve the subsequent page.
265
- * @param {string} [request.filter]
266
- * Optional. A filter to apply on the list results. Supported features:
267
- *
268
- * * List all the products under the parent branch if
269
- * {@link protos.google.cloud.discoveryengine.v1.ListControlsRequest.filter|filter} is
270
- * unset. Currently this field is unsupported.
271
- * @param {object} [options]
272
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
273
- * @returns {Promise} - The promise which resolves to an array.
274
- * The first element of the array is Array of {@link protos.google.cloud.discoveryengine.v1.Control|Control}.
275
- * The client library will perform auto-pagination by default: it will call the API as many
276
- * times as needed and will merge results from all the pages into this array.
277
- * Note that it can affect your quota.
278
- * We recommend using `listControlsAsync()`
279
- * method described below for async iteration which you can stop as needed.
280
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
281
- * for more details and examples.
282
- */
249
+ * Lists all Controls by their parent
250
+ * {@link protos.google.cloud.discoveryengine.v1.DataStore|DataStore}.
251
+ *
252
+ * @param {Object} request
253
+ * The request object that will be sent.
254
+ * @param {string} request.parent
255
+ * Required. The data store resource name. Format:
256
+ * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`
257
+ * or
258
+ * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`.
259
+ * @param {number} [request.pageSize]
260
+ * Optional. Maximum number of results to return. If unspecified, defaults
261
+ * to 50. Max allowed value is 1000.
262
+ * @param {string} [request.pageToken]
263
+ * Optional. A page token, received from a previous `ListControls` call.
264
+ * Provide this to retrieve the subsequent page.
265
+ * @param {string} [request.filter]
266
+ * Optional. A filter to apply on the list results. Supported features:
267
+ *
268
+ * * List all the products under the parent branch if
269
+ * {@link protos.google.cloud.discoveryengine.v1.ListControlsRequest.filter|filter} is
270
+ * unset. Currently this field is unsupported.
271
+ * @param {object} [options]
272
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
273
+ * @returns {Promise} - The promise which resolves to an array.
274
+ * The first element of the array is Array of {@link protos.google.cloud.discoveryengine.v1.Control|Control}.
275
+ * The client library will perform auto-pagination by default: it will call the API as many
276
+ * times as needed and will merge results from all the pages into this array.
277
+ * Note that it can affect your quota.
278
+ * We recommend using `listControlsAsync()`
279
+ * method described below for async iteration which you can stop as needed.
280
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
281
+ * for more details and examples.
282
+ */
283
283
  listControls(request?: protos.google.cloud.discoveryengine.v1.IListControlsRequest, options?: CallOptions): Promise<[
284
284
  protos.google.cloud.discoveryengine.v1.IControl[],
285
285
  protos.google.cloud.discoveryengine.v1.IListControlsRequest | null,
@@ -357,55 +357,55 @@ export declare class ControlServiceClient {
357
357
  */
358
358
  listControlsAsync(request?: protos.google.cloud.discoveryengine.v1.IListControlsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.discoveryengine.v1.IControl>;
359
359
  /**
360
- * Gets information about a location.
361
- *
362
- * @param {Object} request
363
- * The request object that will be sent.
364
- * @param {string} request.name
365
- * Resource name for the location.
366
- * @param {object} [options]
367
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
368
- * @returns {Promise} - The promise which resolves to an array.
369
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
370
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
371
- * for more details and examples.
372
- * @example
373
- * ```
374
- * const [response] = await client.getLocation(request);
375
- * ```
376
- */
360
+ * Gets information about a location.
361
+ *
362
+ * @param {Object} request
363
+ * The request object that will be sent.
364
+ * @param {string} request.name
365
+ * Resource name for the location.
366
+ * @param {object} [options]
367
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
368
+ * @returns {Promise} - The promise which resolves to an array.
369
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
370
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
371
+ * for more details and examples.
372
+ * @example
373
+ * ```
374
+ * const [response] = await client.getLocation(request);
375
+ * ```
376
+ */
377
377
  getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;
378
378
  /**
379
- * Lists information about the supported locations for this service. Returns an iterable object.
380
- *
381
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
382
- * @param {Object} request
383
- * The request object that will be sent.
384
- * @param {string} request.name
385
- * The resource that owns the locations collection, if applicable.
386
- * @param {string} request.filter
387
- * The standard list filter.
388
- * @param {number} request.pageSize
389
- * The standard list page size.
390
- * @param {string} request.pageToken
391
- * The standard list page token.
392
- * @param {object} [options]
393
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
394
- * @returns {Object}
395
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
396
- * When you iterate the returned iterable, each element will be an object representing
397
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
398
- * so you can stop the iteration when you don't need more results.
399
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
400
- * for more details and examples.
401
- * @example
402
- * ```
403
- * const iterable = client.listLocationsAsync(request);
404
- * for await (const response of iterable) {
405
- * // process response
406
- * }
407
- * ```
408
- */
379
+ * Lists information about the supported locations for this service. Returns an iterable object.
380
+ *
381
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
382
+ * @param {Object} request
383
+ * The request object that will be sent.
384
+ * @param {string} request.name
385
+ * The resource that owns the locations collection, if applicable.
386
+ * @param {string} request.filter
387
+ * The standard list filter.
388
+ * @param {number} request.pageSize
389
+ * The standard list page size.
390
+ * @param {string} request.pageToken
391
+ * The standard list page token.
392
+ * @param {object} [options]
393
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
394
+ * @returns {Object}
395
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
396
+ * When you iterate the returned iterable, each element will be an object representing
397
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
398
+ * so you can stop the iteration when you don't need more results.
399
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
400
+ * for more details and examples.
401
+ * @example
402
+ * ```
403
+ * const iterable = client.listLocationsAsync(request);
404
+ * for await (const response of iterable) {
405
+ * // process response
406
+ * }
407
+ * ```
408
+ */
409
409
  listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
410
410
  /**
411
411
  * Return a fully-qualified engine resource name string.
@@ -100,26 +100,17 @@ class ControlServiceClient {
100
100
  constructor(opts, gaxInstance) {
101
101
  // Ensure that options include all the required fields.
102
102
  const staticMembers = this.constructor;
103
- if (opts?.universe_domain &&
104
- opts?.universeDomain &&
105
- opts?.universe_domain !== opts?.universeDomain) {
103
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
106
104
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
107
105
  }
108
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
109
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
110
- : undefined;
111
- this._universeDomain =
112
- opts?.universeDomain ??
113
- opts?.universe_domain ??
114
- universeDomainEnvVar ??
115
- 'googleapis.com';
106
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
107
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
116
108
  this._servicePath = 'discoveryengine.' + this._universeDomain;
117
109
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
118
110
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
119
111
  const port = opts?.port || staticMembers.port;
120
112
  const clientConfig = opts?.clientConfig ?? {};
121
- const fallback = opts?.fallback ??
122
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
113
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
123
114
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
124
115
  // Request numeric enum values if REST transport is used.
125
116
  opts.numericEnums = true;
@@ -149,7 +140,10 @@ class ControlServiceClient {
149
140
  }
150
141
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
151
142
  // Determine the client header string.
152
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
143
+ const clientHeader = [
144
+ `gax/${this._gaxModule.version}`,
145
+ `gapic/${version}`,
146
+ ];
153
147
  if (typeof process === 'object' && 'versions' in process) {
154
148
  clientHeader.push(`gl-node/${process.versions.node}`);
155
149
  }
@@ -212,7 +206,7 @@ class ControlServiceClient {
212
206
  // (e.g. 50 results at a time, with tokens to get subsequent
213
207
  // pages). Denote the keys used for pagination and results.
214
208
  this.descriptors.page = {
215
- listControls: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'controls'),
209
+ listControls: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'controls')
216
210
  };
217
211
  // Put together the default options sent with requests.
218
212
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.ControlService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -241,19 +235,13 @@ class ControlServiceClient {
241
235
  }
242
236
  // Put together the "service stub" for
243
237
  // google.cloud.discoveryengine.v1.ControlService.
244
- this.controlServiceStub = this._gaxGrpc.createStub(this._opts.fallback
245
- ? this._protos.lookupService('google.cloud.discoveryengine.v1.ControlService')
246
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
247
- this._protos.google.cloud.discoveryengine.v1.ControlService, this._opts, this._providedCustomServicePath);
238
+ this.controlServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
239
+ this._protos.lookupService('google.cloud.discoveryengine.v1.ControlService') :
240
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
241
+ this._protos.google.cloud.discoveryengine.v1.ControlService, this._opts, this._providedCustomServicePath);
248
242
  // Iterate over each of the methods that the service provides
249
243
  // and create an API call method for each.
250
- const controlServiceStubMethods = [
251
- 'createControl',
252
- 'deleteControl',
253
- 'updateControl',
254
- 'getControl',
255
- 'listControls',
256
- ];
244
+ const controlServiceStubMethods = ['createControl', 'deleteControl', 'updateControl', 'getControl', 'listControls'];
257
245
  for (const methodName of controlServiceStubMethods) {
258
246
  const callPromise = this.controlServiceStub.then(stub => (...args) => {
259
247
  if (this._terminated) {
@@ -264,7 +252,8 @@ class ControlServiceClient {
264
252
  }, (err) => () => {
265
253
  throw err;
266
254
  });
267
- const descriptor = this.descriptors.page[methodName] || undefined;
255
+ const descriptor = this.descriptors.page[methodName] ||
256
+ undefined;
268
257
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
269
258
  this.innerApiCalls[methodName] = apiCall;
270
259
  }
@@ -276,8 +265,7 @@ class ControlServiceClient {
276
265
  * @returns {string} The DNS address for this service.
277
266
  */
278
267
  static get servicePath() {
279
- if (typeof process === 'object' &&
280
- typeof process.emitWarning === 'function') {
268
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
281
269
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
282
270
  }
283
271
  return 'discoveryengine.googleapis.com';
@@ -288,8 +276,7 @@ class ControlServiceClient {
288
276
  * @returns {string} The DNS address for this service.
289
277
  */
290
278
  static get apiEndpoint() {
291
- if (typeof process === 'object' &&
292
- typeof process.emitWarning === 'function') {
279
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
293
280
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
294
281
  }
295
282
  return 'discoveryengine.googleapis.com';
@@ -317,7 +304,9 @@ class ControlServiceClient {
317
304
  * @returns {string[]} List of default scopes.
318
305
  */
319
306
  static get scopes() {
320
- return ['https://www.googleapis.com/auth/cloud-platform'];
307
+ return [
308
+ 'https://www.googleapis.com/auth/cloud-platform'
309
+ ];
321
310
  }
322
311
  /**
323
312
  * Return the project ID used by this class.
@@ -343,13 +332,10 @@ class ControlServiceClient {
343
332
  options = options || {};
344
333
  options.otherArgs = options.otherArgs || {};
345
334
  options.otherArgs.headers = options.otherArgs.headers || {};
346
- options.otherArgs.headers['x-goog-request-params'] =
347
- this._gaxModule.routingHeader.fromParams({
348
- parent: request.parent ?? '',
349
- });
350
- this.initialize().catch(err => {
351
- throw err;
335
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
336
+ 'parent': request.parent ?? '',
352
337
  });
338
+ this.initialize().catch(err => { throw err; });
353
339
  this._log.info('createControl request %j', request);
354
340
  const wrappedCallback = callback
355
341
  ? (error, response, options, rawResponse) => {
@@ -357,8 +343,7 @@ class ControlServiceClient {
357
343
  callback(error, response, options, rawResponse); // We verified callback above.
358
344
  }
359
345
  : undefined;
360
- return this.innerApiCalls
361
- .createControl(request, options, wrappedCallback)
346
+ return this.innerApiCalls.createControl(request, options, wrappedCallback)
362
347
  ?.then(([response, options, rawResponse]) => {
363
348
  this._log.info('createControl response %j', response);
364
349
  return [response, options, rawResponse];
@@ -377,13 +362,10 @@ class ControlServiceClient {
377
362
  options = options || {};
378
363
  options.otherArgs = options.otherArgs || {};
379
364
  options.otherArgs.headers = options.otherArgs.headers || {};
380
- options.otherArgs.headers['x-goog-request-params'] =
381
- this._gaxModule.routingHeader.fromParams({
382
- name: request.name ?? '',
383
- });
384
- this.initialize().catch(err => {
385
- throw err;
365
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
366
+ 'name': request.name ?? '',
386
367
  });
368
+ this.initialize().catch(err => { throw err; });
387
369
  this._log.info('deleteControl request %j', request);
388
370
  const wrappedCallback = callback
389
371
  ? (error, response, options, rawResponse) => {
@@ -391,8 +373,7 @@ class ControlServiceClient {
391
373
  callback(error, response, options, rawResponse); // We verified callback above.
392
374
  }
393
375
  : undefined;
394
- return this.innerApiCalls
395
- .deleteControl(request, options, wrappedCallback)
376
+ return this.innerApiCalls.deleteControl(request, options, wrappedCallback)
396
377
  ?.then(([response, options, rawResponse]) => {
397
378
  this._log.info('deleteControl response %j', response);
398
379
  return [response, options, rawResponse];
@@ -411,13 +392,10 @@ class ControlServiceClient {
411
392
  options = options || {};
412
393
  options.otherArgs = options.otherArgs || {};
413
394
  options.otherArgs.headers = options.otherArgs.headers || {};
414
- options.otherArgs.headers['x-goog-request-params'] =
415
- this._gaxModule.routingHeader.fromParams({
416
- 'control.name': request.control.name ?? '',
417
- });
418
- this.initialize().catch(err => {
419
- throw err;
395
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
396
+ 'control.name': request.control.name ?? '',
420
397
  });
398
+ this.initialize().catch(err => { throw err; });
421
399
  this._log.info('updateControl request %j', request);
422
400
  const wrappedCallback = callback
423
401
  ? (error, response, options, rawResponse) => {
@@ -425,8 +403,7 @@ class ControlServiceClient {
425
403
  callback(error, response, options, rawResponse); // We verified callback above.
426
404
  }
427
405
  : undefined;
428
- return this.innerApiCalls
429
- .updateControl(request, options, wrappedCallback)
406
+ return this.innerApiCalls.updateControl(request, options, wrappedCallback)
430
407
  ?.then(([response, options, rawResponse]) => {
431
408
  this._log.info('updateControl response %j', response);
432
409
  return [response, options, rawResponse];
@@ -445,13 +422,10 @@ class ControlServiceClient {
445
422
  options = options || {};
446
423
  options.otherArgs = options.otherArgs || {};
447
424
  options.otherArgs.headers = options.otherArgs.headers || {};
448
- options.otherArgs.headers['x-goog-request-params'] =
449
- this._gaxModule.routingHeader.fromParams({
450
- name: request.name ?? '',
451
- });
452
- this.initialize().catch(err => {
453
- throw err;
425
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
426
+ 'name': request.name ?? '',
454
427
  });
428
+ this.initialize().catch(err => { throw err; });
455
429
  this._log.info('getControl request %j', request);
456
430
  const wrappedCallback = callback
457
431
  ? (error, response, options, rawResponse) => {
@@ -459,8 +433,7 @@ class ControlServiceClient {
459
433
  callback(error, response, options, rawResponse); // We verified callback above.
460
434
  }
461
435
  : undefined;
462
- return this.innerApiCalls
463
- .getControl(request, options, wrappedCallback)
436
+ return this.innerApiCalls.getControl(request, options, wrappedCallback)
464
437
  ?.then(([response, options, rawResponse]) => {
465
438
  this._log.info('getControl response %j', response);
466
439
  return [response, options, rawResponse];
@@ -479,13 +452,10 @@ class ControlServiceClient {
479
452
  options = options || {};
480
453
  options.otherArgs = options.otherArgs || {};
481
454
  options.otherArgs.headers = options.otherArgs.headers || {};
482
- options.otherArgs.headers['x-goog-request-params'] =
483
- this._gaxModule.routingHeader.fromParams({
484
- parent: request.parent ?? '',
485
- });
486
- this.initialize().catch(err => {
487
- throw err;
455
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
456
+ 'parent': request.parent ?? '',
488
457
  });
458
+ this.initialize().catch(err => { throw err; });
489
459
  const wrappedCallback = callback
490
460
  ? (error, values, nextPageRequest, rawResponse) => {
491
461
  this._log.info('listControls values %j', values);
@@ -537,15 +507,12 @@ class ControlServiceClient {
537
507
  options = options || {};
538
508
  options.otherArgs = options.otherArgs || {};
539
509
  options.otherArgs.headers = options.otherArgs.headers || {};
540
- options.otherArgs.headers['x-goog-request-params'] =
541
- this._gaxModule.routingHeader.fromParams({
542
- parent: request.parent ?? '',
543
- });
510
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
511
+ 'parent': request.parent ?? '',
512
+ });
544
513
  const defaultCallSettings = this._defaults['listControls'];
545
514
  const callSettings = defaultCallSettings.merge(options);
546
- this.initialize().catch(err => {
547
- throw err;
548
- });
515
+ this.initialize().catch(err => { throw err; });
549
516
  this._log.info('listControls stream %j', request);
550
517
  return this.descriptors.page.listControls.createStream(this.innerApiCalls.listControls, request, callSettings);
551
518
  }
@@ -589,70 +556,67 @@ class ControlServiceClient {
589
556
  options = options || {};
590
557
  options.otherArgs = options.otherArgs || {};
591
558
  options.otherArgs.headers = options.otherArgs.headers || {};
592
- options.otherArgs.headers['x-goog-request-params'] =
593
- this._gaxModule.routingHeader.fromParams({
594
- parent: request.parent ?? '',
595
- });
559
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
560
+ 'parent': request.parent ?? '',
561
+ });
596
562
  const defaultCallSettings = this._defaults['listControls'];
597
563
  const callSettings = defaultCallSettings.merge(options);
598
- this.initialize().catch(err => {
599
- throw err;
600
- });
564
+ this.initialize().catch(err => { throw err; });
601
565
  this._log.info('listControls iterate %j', request);
602
566
  return this.descriptors.page.listControls.asyncIterate(this.innerApiCalls['listControls'], request, callSettings);
603
567
  }
604
568
  /**
605
- * Gets information about a location.
606
- *
607
- * @param {Object} request
608
- * The request object that will be sent.
609
- * @param {string} request.name
610
- * Resource name for the location.
611
- * @param {object} [options]
612
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
613
- * @returns {Promise} - The promise which resolves to an array.
614
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
615
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
616
- * for more details and examples.
617
- * @example
618
- * ```
619
- * const [response] = await client.getLocation(request);
620
- * ```
621
- */
569
+ * Gets information about a location.
570
+ *
571
+ * @param {Object} request
572
+ * The request object that will be sent.
573
+ * @param {string} request.name
574
+ * Resource name for the location.
575
+ * @param {object} [options]
576
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
577
+ * @returns {Promise} - The promise which resolves to an array.
578
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
579
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
580
+ * for more details and examples.
581
+ * @example
582
+ * ```
583
+ * const [response] = await client.getLocation(request);
584
+ * ```
585
+ */
622
586
  getLocation(request, options, callback) {
623
587
  return this.locationsClient.getLocation(request, options, callback);
624
588
  }
625
589
  /**
626
- * Lists information about the supported locations for this service. Returns an iterable object.
627
- *
628
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
629
- * @param {Object} request
630
- * The request object that will be sent.
631
- * @param {string} request.name
632
- * The resource that owns the locations collection, if applicable.
633
- * @param {string} request.filter
634
- * The standard list filter.
635
- * @param {number} request.pageSize
636
- * The standard list page size.
637
- * @param {string} request.pageToken
638
- * The standard list page token.
639
- * @param {object} [options]
640
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
641
- * @returns {Object}
642
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
643
- * When you iterate the returned iterable, each element will be an object representing
644
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
645
- * so you can stop the iteration when you don't need more results.
646
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
647
- * for more details and examples.
648
- * @example
649
- * ```
650
- * const iterable = client.listLocationsAsync(request);
651
- * for await (const response of iterable) {
652
- * // process response
653
- * }
654
- * ```
655
- */
590
+ * Lists information about the supported locations for this service. Returns an iterable object.
591
+ *
592
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
593
+ * @param {Object} request
594
+ * The request object that will be sent.
595
+ * @param {string} request.name
596
+ * The resource that owns the locations collection, if applicable.
597
+ * @param {string} request.filter
598
+ * The standard list filter.
599
+ * @param {number} request.pageSize
600
+ * The standard list page size.
601
+ * @param {string} request.pageToken
602
+ * The standard list page token.
603
+ * @param {object} [options]
604
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
605
+ * @returns {Object}
606
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
607
+ * When you iterate the returned iterable, each element will be an object representing
608
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
609
+ * so you can stop the iteration when you don't need more results.
610
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
611
+ * for more details and examples.
612
+ * @example
613
+ * ```
614
+ * const iterable = client.listLocationsAsync(request);
615
+ * for await (const response of iterable) {
616
+ * // process response
617
+ * }
618
+ * ```
619
+ */
656
620
  listLocationsAsync(request, options) {
657
621
  return this.locationsClient.listLocationsAsync(request, options);
658
622
  }
@@ -2927,7 +2891,7 @@ class ControlServiceClient {
2927
2891
  this._log.info('ending gRPC channel');
2928
2892
  this._terminated = true;
2929
2893
  stub.close();
2930
- this.locationsClient.close();
2894
+ this.locationsClient.close().catch(err => { throw err; });
2931
2895
  });
2932
2896
  }
2933
2897
  return Promise.resolve();