@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
@@ -145,7 +145,7 @@ export declare class ServingConfigServiceClient {
145
145
  */
146
146
  updateServingConfig(request?: protos.google.cloud.discoveryengine.v1alpha.IUpdateServingConfigRequest, options?: CallOptions): Promise<[
147
147
  protos.google.cloud.discoveryengine.v1alpha.IServingConfig,
148
- (protos.google.cloud.discoveryengine.v1alpha.IUpdateServingConfigRequest | undefined),
148
+ protos.google.cloud.discoveryengine.v1alpha.IUpdateServingConfigRequest | undefined,
149
149
  {} | undefined
150
150
  ]>;
151
151
  updateServingConfig(request: protos.google.cloud.discoveryengine.v1alpha.IUpdateServingConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1alpha.IServingConfig, protos.google.cloud.discoveryengine.v1alpha.IUpdateServingConfigRequest | null | undefined, {} | null | undefined>): void;
@@ -171,38 +171,38 @@ export declare class ServingConfigServiceClient {
171
171
  */
172
172
  getServingConfig(request?: protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest, options?: CallOptions): Promise<[
173
173
  protos.google.cloud.discoveryengine.v1alpha.IServingConfig,
174
- (protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest | undefined),
174
+ protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest | undefined,
175
175
  {} | undefined
176
176
  ]>;
177
177
  getServingConfig(request: protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1alpha.IServingConfig, protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest | null | undefined, {} | null | undefined>): void;
178
178
  getServingConfig(request: protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest, callback: Callback<protos.google.cloud.discoveryengine.v1alpha.IServingConfig, protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest | null | undefined, {} | null | undefined>): void;
179
179
  /**
180
- * Lists all ServingConfigs linked to this dataStore.
181
- *
182
- * @param {Object} request
183
- * The request object that will be sent.
184
- * @param {string} request.parent
185
- * Required. Full resource name of the parent resource. Format:
186
- * `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine}`
187
- * @param {number} [request.pageSize]
188
- * Optional. Maximum number of results to return. If unspecified, defaults
189
- * to 100. If a value greater than 100 is provided, at most 100 results are
190
- * returned.
191
- * @param {string} [request.pageToken]
192
- * Optional. A page token, received from a previous `ListServingConfigs` call.
193
- * Provide this to retrieve the subsequent page.
194
- * @param {object} [options]
195
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
196
- * @returns {Promise} - The promise which resolves to an array.
197
- * The first element of the array is Array of {@link protos.google.cloud.discoveryengine.v1alpha.ServingConfig|ServingConfig}.
198
- * The client library will perform auto-pagination by default: it will call the API as many
199
- * times as needed and will merge results from all the pages into this array.
200
- * Note that it can affect your quota.
201
- * We recommend using `listServingConfigsAsync()`
202
- * method described below for async iteration which you can stop as needed.
203
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
204
- * for more details and examples.
205
- */
180
+ * Lists all ServingConfigs linked to this dataStore.
181
+ *
182
+ * @param {Object} request
183
+ * The request object that will be sent.
184
+ * @param {string} request.parent
185
+ * Required. Full resource name of the parent resource. Format:
186
+ * `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine}`
187
+ * @param {number} [request.pageSize]
188
+ * Optional. Maximum number of results to return. If unspecified, defaults
189
+ * to 100. If a value greater than 100 is provided, at most 100 results are
190
+ * returned.
191
+ * @param {string} [request.pageToken]
192
+ * Optional. A page token, received from a previous `ListServingConfigs` call.
193
+ * Provide this to retrieve the subsequent page.
194
+ * @param {object} [options]
195
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
196
+ * @returns {Promise} - The promise which resolves to an array.
197
+ * The first element of the array is Array of {@link protos.google.cloud.discoveryengine.v1alpha.ServingConfig|ServingConfig}.
198
+ * The client library will perform auto-pagination by default: it will call the API as many
199
+ * times as needed and will merge results from all the pages into this array.
200
+ * Note that it can affect your quota.
201
+ * We recommend using `listServingConfigsAsync()`
202
+ * method described below for async iteration which you can stop as needed.
203
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
204
+ * for more details and examples.
205
+ */
206
206
  listServingConfigs(request?: protos.google.cloud.discoveryengine.v1alpha.IListServingConfigsRequest, options?: CallOptions): Promise<[
207
207
  protos.google.cloud.discoveryengine.v1alpha.IServingConfig[],
208
208
  protos.google.cloud.discoveryengine.v1alpha.IListServingConfigsRequest | null,
@@ -266,55 +266,55 @@ export declare class ServingConfigServiceClient {
266
266
  */
267
267
  listServingConfigsAsync(request?: protos.google.cloud.discoveryengine.v1alpha.IListServingConfigsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.discoveryengine.v1alpha.IServingConfig>;
268
268
  /**
269
- * Gets information about a location.
270
- *
271
- * @param {Object} request
272
- * The request object that will be sent.
273
- * @param {string} request.name
274
- * Resource name for the location.
275
- * @param {object} [options]
276
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
277
- * @returns {Promise} - The promise which resolves to an array.
278
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
279
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
280
- * for more details and examples.
281
- * @example
282
- * ```
283
- * const [response] = await client.getLocation(request);
284
- * ```
285
- */
269
+ * Gets information about a location.
270
+ *
271
+ * @param {Object} request
272
+ * The request object that will be sent.
273
+ * @param {string} request.name
274
+ * Resource name for the location.
275
+ * @param {object} [options]
276
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
277
+ * @returns {Promise} - The promise which resolves to an array.
278
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
279
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
280
+ * for more details and examples.
281
+ * @example
282
+ * ```
283
+ * const [response] = await client.getLocation(request);
284
+ * ```
285
+ */
286
286
  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>;
287
287
  /**
288
- * Lists information about the supported locations for this service. Returns an iterable object.
289
- *
290
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
291
- * @param {Object} request
292
- * The request object that will be sent.
293
- * @param {string} request.name
294
- * The resource that owns the locations collection, if applicable.
295
- * @param {string} request.filter
296
- * The standard list filter.
297
- * @param {number} request.pageSize
298
- * The standard list page size.
299
- * @param {string} request.pageToken
300
- * The standard list page token.
301
- * @param {object} [options]
302
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
303
- * @returns {Object}
304
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
305
- * When you iterate the returned iterable, each element will be an object representing
306
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
307
- * so you can stop the iteration when you don't need more results.
308
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
309
- * for more details and examples.
310
- * @example
311
- * ```
312
- * const iterable = client.listLocationsAsync(request);
313
- * for await (const response of iterable) {
314
- * // process response
315
- * }
316
- * ```
317
- */
288
+ * Lists information about the supported locations for this service. Returns an iterable object.
289
+ *
290
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
291
+ * @param {Object} request
292
+ * The request object that will be sent.
293
+ * @param {string} request.name
294
+ * The resource that owns the locations collection, if applicable.
295
+ * @param {string} request.filter
296
+ * The standard list filter.
297
+ * @param {number} request.pageSize
298
+ * The standard list page size.
299
+ * @param {string} request.pageToken
300
+ * The standard list page token.
301
+ * @param {object} [options]
302
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
303
+ * @returns {Object}
304
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
305
+ * When you iterate the returned iterable, each element will be an object representing
306
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
307
+ * so you can stop the iteration when you don't need more results.
308
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
309
+ * for more details and examples.
310
+ * @example
311
+ * ```
312
+ * const iterable = client.listLocationsAsync(request);
313
+ * for await (const response of iterable) {
314
+ * // process response
315
+ * }
316
+ * ```
317
+ */
318
318
  listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
319
319
  /**
320
320
  * Return a fully-qualified aclConfig resource name string.
@@ -98,26 +98,17 @@ class ServingConfigServiceClient {
98
98
  constructor(opts, gaxInstance) {
99
99
  // Ensure that options include all the required fields.
100
100
  const staticMembers = this.constructor;
101
- if (opts?.universe_domain &&
102
- opts?.universeDomain &&
103
- opts?.universe_domain !== opts?.universeDomain) {
101
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
104
102
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
105
103
  }
106
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
107
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
108
- : undefined;
109
- this._universeDomain =
110
- opts?.universeDomain ??
111
- opts?.universe_domain ??
112
- universeDomainEnvVar ??
113
- 'googleapis.com';
104
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
105
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
114
106
  this._servicePath = 'discoveryengine.' + this._universeDomain;
115
107
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
116
108
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
117
109
  const port = opts?.port || staticMembers.port;
118
110
  const clientConfig = opts?.clientConfig ?? {};
119
- const fallback = opts?.fallback ??
120
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
111
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
121
112
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
122
113
  // Request numeric enum values if REST transport is used.
123
114
  opts.numericEnums = true;
@@ -147,7 +138,10 @@ class ServingConfigServiceClient {
147
138
  }
148
139
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
149
140
  // Determine the client header string.
150
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
141
+ const clientHeader = [
142
+ `gax/${this._gaxModule.version}`,
143
+ `gapic/${version}`,
144
+ ];
151
145
  if (typeof process === 'object' && 'versions' in process) {
152
146
  clientHeader.push(`gl-node/${process.versions.node}`);
153
147
  }
@@ -212,7 +206,7 @@ class ServingConfigServiceClient {
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
- listServingConfigs: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'servingConfigs'),
209
+ listServingConfigs: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'servingConfigs')
216
210
  };
217
211
  // Put together the default options sent with requests.
218
212
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1alpha.ServingConfigService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -241,18 +235,13 @@ class ServingConfigServiceClient {
241
235
  }
242
236
  // Put together the "service stub" for
243
237
  // google.cloud.discoveryengine.v1alpha.ServingConfigService.
244
- this.servingConfigServiceStub = this._gaxGrpc.createStub(this._opts.fallback
245
- ? this._protos.lookupService('google.cloud.discoveryengine.v1alpha.ServingConfigService')
246
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
247
- this._protos.google.cloud.discoveryengine.v1alpha
248
- .ServingConfigService, this._opts, this._providedCustomServicePath);
238
+ this.servingConfigServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
239
+ this._protos.lookupService('google.cloud.discoveryengine.v1alpha.ServingConfigService') :
240
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
241
+ this._protos.google.cloud.discoveryengine.v1alpha.ServingConfigService, this._opts, this._providedCustomServicePath);
249
242
  // Iterate over each of the methods that the service provides
250
243
  // and create an API call method for each.
251
- const servingConfigServiceStubMethods = [
252
- 'updateServingConfig',
253
- 'getServingConfig',
254
- 'listServingConfigs',
255
- ];
244
+ const servingConfigServiceStubMethods = ['updateServingConfig', 'getServingConfig', 'listServingConfigs'];
256
245
  for (const methodName of servingConfigServiceStubMethods) {
257
246
  const callPromise = this.servingConfigServiceStub.then(stub => (...args) => {
258
247
  if (this._terminated) {
@@ -263,7 +252,8 @@ class ServingConfigServiceClient {
263
252
  }, (err) => () => {
264
253
  throw err;
265
254
  });
266
- const descriptor = this.descriptors.page[methodName] || undefined;
255
+ const descriptor = this.descriptors.page[methodName] ||
256
+ undefined;
267
257
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
268
258
  this.innerApiCalls[methodName] = apiCall;
269
259
  }
@@ -275,8 +265,7 @@ class ServingConfigServiceClient {
275
265
  * @returns {string} The DNS address for this service.
276
266
  */
277
267
  static get servicePath() {
278
- if (typeof process === 'object' &&
279
- typeof process.emitWarning === 'function') {
268
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
280
269
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
281
270
  }
282
271
  return 'discoveryengine.googleapis.com';
@@ -287,8 +276,7 @@ class ServingConfigServiceClient {
287
276
  * @returns {string} The DNS address for this service.
288
277
  */
289
278
  static get apiEndpoint() {
290
- if (typeof process === 'object' &&
291
- typeof process.emitWarning === 'function') {
279
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
292
280
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
293
281
  }
294
282
  return 'discoveryengine.googleapis.com';
@@ -316,7 +304,9 @@ class ServingConfigServiceClient {
316
304
  * @returns {string[]} List of default scopes.
317
305
  */
318
306
  static get scopes() {
319
- return ['https://www.googleapis.com/auth/cloud-platform'];
307
+ return [
308
+ 'https://www.googleapis.com/auth/cloud-platform'
309
+ ];
320
310
  }
321
311
  /**
322
312
  * Return the project ID used by this class.
@@ -342,13 +332,10 @@ class ServingConfigServiceClient {
342
332
  options = options || {};
343
333
  options.otherArgs = options.otherArgs || {};
344
334
  options.otherArgs.headers = options.otherArgs.headers || {};
345
- options.otherArgs.headers['x-goog-request-params'] =
346
- this._gaxModule.routingHeader.fromParams({
347
- 'serving_config.name': request.servingConfig.name ?? '',
348
- });
349
- this.initialize().catch(err => {
350
- throw err;
335
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
336
+ 'serving_config.name': request.servingConfig.name ?? '',
351
337
  });
338
+ this.initialize().catch(err => { throw err; });
352
339
  this._log.info('updateServingConfig request %j', request);
353
340
  const wrappedCallback = callback
354
341
  ? (error, response, options, rawResponse) => {
@@ -356,8 +343,7 @@ class ServingConfigServiceClient {
356
343
  callback(error, response, options, rawResponse); // We verified callback above.
357
344
  }
358
345
  : undefined;
359
- return this.innerApiCalls
360
- .updateServingConfig(request, options, wrappedCallback)
346
+ return this.innerApiCalls.updateServingConfig(request, options, wrappedCallback)
361
347
  ?.then(([response, options, rawResponse]) => {
362
348
  this._log.info('updateServingConfig response %j', response);
363
349
  return [response, options, rawResponse];
@@ -376,13 +362,10 @@ class ServingConfigServiceClient {
376
362
  options = options || {};
377
363
  options.otherArgs = options.otherArgs || {};
378
364
  options.otherArgs.headers = options.otherArgs.headers || {};
379
- options.otherArgs.headers['x-goog-request-params'] =
380
- this._gaxModule.routingHeader.fromParams({
381
- name: request.name ?? '',
382
- });
383
- this.initialize().catch(err => {
384
- throw err;
365
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
366
+ 'name': request.name ?? '',
385
367
  });
368
+ this.initialize().catch(err => { throw err; });
386
369
  this._log.info('getServingConfig request %j', request);
387
370
  const wrappedCallback = callback
388
371
  ? (error, response, options, rawResponse) => {
@@ -390,8 +373,7 @@ class ServingConfigServiceClient {
390
373
  callback(error, response, options, rawResponse); // We verified callback above.
391
374
  }
392
375
  : undefined;
393
- return this.innerApiCalls
394
- .getServingConfig(request, options, wrappedCallback)
376
+ return this.innerApiCalls.getServingConfig(request, options, wrappedCallback)
395
377
  ?.then(([response, options, rawResponse]) => {
396
378
  this._log.info('getServingConfig response %j', response);
397
379
  return [response, options, rawResponse];
@@ -410,13 +392,10 @@ class ServingConfigServiceClient {
410
392
  options = options || {};
411
393
  options.otherArgs = options.otherArgs || {};
412
394
  options.otherArgs.headers = options.otherArgs.headers || {};
413
- options.otherArgs.headers['x-goog-request-params'] =
414
- this._gaxModule.routingHeader.fromParams({
415
- parent: request.parent ?? '',
416
- });
417
- this.initialize().catch(err => {
418
- throw err;
395
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
396
+ 'parent': request.parent ?? '',
419
397
  });
398
+ this.initialize().catch(err => { throw err; });
420
399
  const wrappedCallback = callback
421
400
  ? (error, values, nextPageRequest, rawResponse) => {
422
401
  this._log.info('listServingConfigs values %j', values);
@@ -461,15 +440,12 @@ class ServingConfigServiceClient {
461
440
  options = options || {};
462
441
  options.otherArgs = options.otherArgs || {};
463
442
  options.otherArgs.headers = options.otherArgs.headers || {};
464
- options.otherArgs.headers['x-goog-request-params'] =
465
- this._gaxModule.routingHeader.fromParams({
466
- parent: request.parent ?? '',
467
- });
443
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
444
+ 'parent': request.parent ?? '',
445
+ });
468
446
  const defaultCallSettings = this._defaults['listServingConfigs'];
469
447
  const callSettings = defaultCallSettings.merge(options);
470
- this.initialize().catch(err => {
471
- throw err;
472
- });
448
+ this.initialize().catch(err => { throw err; });
473
449
  this._log.info('listServingConfigs stream %j', request);
474
450
  return this.descriptors.page.listServingConfigs.createStream(this.innerApiCalls.listServingConfigs, request, callSettings);
475
451
  }
@@ -506,70 +482,67 @@ class ServingConfigServiceClient {
506
482
  options = options || {};
507
483
  options.otherArgs = options.otherArgs || {};
508
484
  options.otherArgs.headers = options.otherArgs.headers || {};
509
- options.otherArgs.headers['x-goog-request-params'] =
510
- this._gaxModule.routingHeader.fromParams({
511
- parent: request.parent ?? '',
512
- });
485
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
486
+ 'parent': request.parent ?? '',
487
+ });
513
488
  const defaultCallSettings = this._defaults['listServingConfigs'];
514
489
  const callSettings = defaultCallSettings.merge(options);
515
- this.initialize().catch(err => {
516
- throw err;
517
- });
490
+ this.initialize().catch(err => { throw err; });
518
491
  this._log.info('listServingConfigs iterate %j', request);
519
492
  return this.descriptors.page.listServingConfigs.asyncIterate(this.innerApiCalls['listServingConfigs'], request, callSettings);
520
493
  }
521
494
  /**
522
- * Gets information about a location.
523
- *
524
- * @param {Object} request
525
- * The request object that will be sent.
526
- * @param {string} request.name
527
- * Resource name for the location.
528
- * @param {object} [options]
529
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
530
- * @returns {Promise} - The promise which resolves to an array.
531
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
532
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
533
- * for more details and examples.
534
- * @example
535
- * ```
536
- * const [response] = await client.getLocation(request);
537
- * ```
538
- */
495
+ * Gets information about a location.
496
+ *
497
+ * @param {Object} request
498
+ * The request object that will be sent.
499
+ * @param {string} request.name
500
+ * Resource name for the location.
501
+ * @param {object} [options]
502
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
503
+ * @returns {Promise} - The promise which resolves to an array.
504
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
505
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
506
+ * for more details and examples.
507
+ * @example
508
+ * ```
509
+ * const [response] = await client.getLocation(request);
510
+ * ```
511
+ */
539
512
  getLocation(request, options, callback) {
540
513
  return this.locationsClient.getLocation(request, options, callback);
541
514
  }
542
515
  /**
543
- * Lists information about the supported locations for this service. Returns an iterable object.
544
- *
545
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
546
- * @param {Object} request
547
- * The request object that will be sent.
548
- * @param {string} request.name
549
- * The resource that owns the locations collection, if applicable.
550
- * @param {string} request.filter
551
- * The standard list filter.
552
- * @param {number} request.pageSize
553
- * The standard list page size.
554
- * @param {string} request.pageToken
555
- * The standard list page token.
556
- * @param {object} [options]
557
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
558
- * @returns {Object}
559
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
560
- * When you iterate the returned iterable, each element will be an object representing
561
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
562
- * so you can stop the iteration when you don't need more results.
563
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
564
- * for more details and examples.
565
- * @example
566
- * ```
567
- * const iterable = client.listLocationsAsync(request);
568
- * for await (const response of iterable) {
569
- * // process response
570
- * }
571
- * ```
572
- */
516
+ * Lists information about the supported locations for this service. Returns an iterable object.
517
+ *
518
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
519
+ * @param {Object} request
520
+ * The request object that will be sent.
521
+ * @param {string} request.name
522
+ * The resource that owns the locations collection, if applicable.
523
+ * @param {string} request.filter
524
+ * The standard list filter.
525
+ * @param {number} request.pageSize
526
+ * The standard list page size.
527
+ * @param {string} request.pageToken
528
+ * The standard list page token.
529
+ * @param {object} [options]
530
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
531
+ * @returns {Object}
532
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
533
+ * When you iterate the returned iterable, each element will be an object representing
534
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
535
+ * so you can stop the iteration when you don't need more results.
536
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
537
+ * for more details and examples.
538
+ * @example
539
+ * ```
540
+ * const iterable = client.listLocationsAsync(request);
541
+ * for await (const response of iterable) {
542
+ * // process response
543
+ * }
544
+ * ```
545
+ */
573
546
  listLocationsAsync(request, options) {
574
547
  return this.locationsClient.listLocationsAsync(request, options);
575
548
  }
@@ -597,8 +570,7 @@ class ServingConfigServiceClient {
597
570
  * @returns {string} A string representing the project.
598
571
  */
599
572
  matchProjectFromAclConfigName(aclConfigName) {
600
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
601
- .project;
573
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
602
574
  }
603
575
  /**
604
576
  * Parse the location from AclConfig resource.
@@ -608,8 +580,7 @@ class ServingConfigServiceClient {
608
580
  * @returns {string} A string representing the location.
609
581
  */
610
582
  matchLocationFromAclConfigName(aclConfigName) {
611
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
612
- .location;
583
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
613
584
  }
614
585
  /**
615
586
  * Return a fully-qualified engine resource name string.
@@ -691,8 +662,7 @@ class ServingConfigServiceClient {
691
662
  * @returns {string} A string representing the project.
692
663
  */
693
664
  matchProjectFromEvaluationName(evaluationName) {
694
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
695
- .project;
665
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
696
666
  }
697
667
  /**
698
668
  * Parse the location from Evaluation resource.
@@ -702,8 +672,7 @@ class ServingConfigServiceClient {
702
672
  * @returns {string} A string representing the location.
703
673
  */
704
674
  matchLocationFromEvaluationName(evaluationName) {
705
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
706
- .location;
675
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
707
676
  }
708
677
  /**
709
678
  * Parse the evaluation from Evaluation resource.
@@ -713,8 +682,7 @@ class ServingConfigServiceClient {
713
682
  * @returns {string} A string representing the evaluation.
714
683
  */
715
684
  matchEvaluationFromEvaluationName(evaluationName) {
716
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
717
- .evaluation;
685
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
718
686
  }
719
687
  /**
720
688
  * Return a fully-qualified location resource name string.
@@ -2814,8 +2782,7 @@ class ServingConfigServiceClient {
2814
2782
  * @returns {string} A string representing the project.
2815
2783
  */
2816
2784
  matchProjectFromSampleQueryName(sampleQueryName) {
2817
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2818
- .project;
2785
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
2819
2786
  }
2820
2787
  /**
2821
2788
  * Parse the location from SampleQuery resource.
@@ -2825,8 +2792,7 @@ class ServingConfigServiceClient {
2825
2792
  * @returns {string} A string representing the location.
2826
2793
  */
2827
2794
  matchLocationFromSampleQueryName(sampleQueryName) {
2828
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2829
- .location;
2795
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
2830
2796
  }
2831
2797
  /**
2832
2798
  * Parse the sample_query_set from SampleQuery resource.
@@ -2836,8 +2802,7 @@ class ServingConfigServiceClient {
2836
2802
  * @returns {string} A string representing the sample_query_set.
2837
2803
  */
2838
2804
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
2839
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2840
- .sample_query_set;
2805
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
2841
2806
  }
2842
2807
  /**
2843
2808
  * Parse the sample_query from SampleQuery resource.
@@ -2847,8 +2812,7 @@ class ServingConfigServiceClient {
2847
2812
  * @returns {string} A string representing the sample_query.
2848
2813
  */
2849
2814
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
2850
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2851
- .sample_query;
2815
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
2852
2816
  }
2853
2817
  /**
2854
2818
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -2907,7 +2871,7 @@ class ServingConfigServiceClient {
2907
2871
  this._log.info('ending gRPC channel');
2908
2872
  this._terminated = true;
2909
2873
  stub.close();
2910
- this.locationsClient.close();
2874
+ this.locationsClient.close().catch(err => { throw err; });
2911
2875
  });
2912
2876
  }
2913
2877
  return Promise.resolve();