@google-cloud/discoveryengine 2.0.1 → 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.
- package/CHANGELOG.md +14 -0
- package/README.md +7 -2
- package/build/protos/google/cloud/discoveryengine/v1/answer.proto +54 -2
- package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +2 -1
- package/build/protos/google/cloud/discoveryengine/v1/common.proto +35 -6
- package/build/protos/google/cloud/discoveryengine/v1/control.proto +113 -2
- package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +168 -2
- package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +23 -4
- package/build/protos/google/cloud/discoveryengine/v1/document.proto +7 -2
- package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +1 -1
- package/build/protos/google/cloud/discoveryengine/v1/engine.proto +16 -3
- package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +70 -9
- package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +20 -1
- package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +9 -5
- package/build/protos/google/cloud/discoveryengine/v1/rank_service.proto +3 -1
- package/build/protos/google/cloud/discoveryengine/v1/recommendation_service.proto +2 -2
- package/build/protos/google/cloud/discoveryengine/v1/safety.proto +107 -0
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +96 -8
- package/build/protos/google/cloud/discoveryengine/v1/serving_config.proto +271 -0
- package/build/protos/google/cloud/discoveryengine/v1/serving_config_service.proto +75 -0
- package/build/protos/google/cloud/discoveryengine/v1/session.proto +19 -0
- package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +27 -3
- package/build/protos/google/cloud/discoveryengine/v1/site_search_engine_service.proto +184 -5
- package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +34 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +16 -4
- package/build/protos/protos.d.ts +4390 -300
- package/build/protos/protos.js +13785 -2922
- package/build/protos/protos.json +1355 -14
- package/build/src/index.d.ts +4 -1
- package/build/src/index.js +4 -21
- package/build/src/v1/completion_service_client.d.ts +313 -76
- package/build/src/v1/completion_service_client.js +451 -262
- package/build/src/v1/completion_service_proto_list.json +3 -0
- package/build/src/v1/control_service_client.d.ts +318 -81
- package/build/src/v1/control_service_client.js +422 -132
- package/build/src/v1/control_service_proto_list.json +3 -0
- package/build/src/v1/conversational_search_service_client.d.ts +341 -134
- package/build/src/v1/conversational_search_service_client.js +395 -223
- package/build/src/v1/conversational_search_service_client_config.json +5 -0
- package/build/src/v1/conversational_search_service_proto_list.json +3 -0
- package/build/src/v1/data_store_service_client.d.ts +359 -122
- package/build/src/v1/data_store_service_client.js +460 -280
- package/build/src/v1/data_store_service_proto_list.json +3 -0
- package/build/src/v1/document_service_client.d.ts +364 -121
- package/build/src/v1/document_service_client.js +469 -300
- package/build/src/v1/document_service_proto_list.json +3 -0
- package/build/src/v1/engine_service_client.d.ts +340 -103
- package/build/src/v1/engine_service_client.js +460 -279
- package/build/src/v1/engine_service_proto_list.json +3 -0
- package/build/src/v1/gapic_metadata.json +59 -0
- package/build/src/v1/grounded_generation_service_client.d.ts +286 -51
- package/build/src/v1/grounded_generation_service_client.js +405 -100
- package/build/src/v1/grounded_generation_service_proto_list.json +3 -0
- package/build/src/v1/index.d.ts +1 -0
- package/build/src/v1/index.js +3 -1
- package/build/src/v1/project_service_client.d.ts +313 -76
- package/build/src/v1/project_service_client.js +434 -222
- package/build/src/v1/project_service_proto_list.json +3 -0
- package/build/src/v1/rank_service_client.d.ts +285 -48
- package/build/src/v1/rank_service_client.js +398 -85
- package/build/src/v1/rank_service_proto_list.json +3 -0
- package/build/src/v1/recommendation_service_client.d.ts +142 -49
- package/build/src/v1/recommendation_service_client.js +198 -82
- package/build/src/v1/recommendation_service_proto_list.json +3 -0
- package/build/src/v1/schema_service_client.d.ts +348 -111
- package/build/src/v1/schema_service_client.js +457 -273
- package/build/src/v1/schema_service_proto_list.json +3 -0
- package/build/src/v1/search_service_client.d.ts +748 -559
- package/build/src/v1/search_service_client.js +302 -133
- package/build/src/v1/search_service_proto_list.json +3 -0
- package/build/src/v1/search_tuning_service_client.d.ts +314 -77
- package/build/src/v1/search_tuning_service_client.js +439 -235
- package/build/src/v1/search_tuning_service_proto_list.json +3 -0
- package/build/src/v1/serving_config_service_client.d.ts +1851 -0
- package/build/src/v1/serving_config_service_client.js +2642 -0
- package/build/src/v1/serving_config_service_client_config.json +30 -0
- package/build/src/v1/serving_config_service_proto_list.json +39 -0
- package/build/src/v1/site_search_engine_service_client.d.ts +504 -151
- package/build/src/v1/site_search_engine_service_client.js +625 -351
- package/build/src/v1/site_search_engine_service_client_config.json +12 -0
- package/build/src/v1/site_search_engine_service_proto_list.json +3 -0
- package/build/src/v1/user_event_service_client.d.ts +335 -86
- package/build/src/v1/user_event_service_client.js +447 -253
- package/build/src/v1/user_event_service_proto_list.json +3 -0
- package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
- package/build/src/v1alpha/acl_config_service_client.js +82 -106
- package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
- package/build/src/v1alpha/chunk_service_client.js +92 -120
- package/build/src/v1alpha/completion_service_client.d.ts +77 -77
- package/build/src/v1alpha/completion_service_client.js +134 -280
- package/build/src/v1alpha/control_service_client.d.ts +85 -85
- package/build/src/v1alpha/control_service_client.js +105 -151
- package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
- package/build/src/v1alpha/conversational_search_service_client.js +145 -237
- package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
- package/build/src/v1alpha/data_store_service_client.js +151 -316
- package/build/src/v1alpha/document_service_client.d.ts +126 -126
- package/build/src/v1alpha/document_service_client.js +156 -328
- package/build/src/v1alpha/engine_service_client.d.ts +106 -106
- package/build/src/v1alpha/engine_service_client.js +155 -325
- package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
- package/build/src/v1alpha/estimate_billing_service_client.js +118 -243
- package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
- package/build/src/v1alpha/evaluation_service_client.js +143 -295
- package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
- package/build/src/v1alpha/grounded_generation_service_client.js +79 -100
- package/build/src/v1alpha/project_service_client.d.ts +78 -78
- package/build/src/v1alpha/project_service_client.js +126 -262
- package/build/src/v1alpha/rank_service_client.d.ts +47 -47
- package/build/src/v1alpha/rank_service_client.js +81 -104
- package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
- package/build/src/v1alpha/recommendation_service_client.js +79 -100
- package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
- package/build/src/v1alpha/sample_query_service_client.js +144 -301
- package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1alpha/sample_query_set_service_client.js +106 -153
- package/build/src/v1alpha/schema_service_client.d.ts +112 -112
- package/build/src/v1alpha/schema_service_client.js +140 -292
- package/build/src/v1alpha/search_service_client.d.ts +327 -327
- package/build/src/v1alpha/search_service_client.js +88 -112
- package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
- package/build/src/v1alpha/search_tuning_service_client.js +122 -253
- package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
- package/build/src/v1alpha/serving_config_service_client.js +97 -133
- package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1alpha/site_search_engine_service_client.js +184 -387
- package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
- package/build/src/v1alpha/user_event_service_client.js +130 -271
- package/build/src/v1beta/completion_service_client.d.ts +78 -78
- package/build/src/v1beta/completion_service_client.js +136 -279
- package/build/src/v1beta/control_service_client.d.ts +84 -84
- package/build/src/v1beta/control_service_client.js +103 -147
- package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
- package/build/src/v1beta/conversational_search_service_client.js +143 -233
- package/build/src/v1beta/data_store_service_client.d.ts +124 -124
- package/build/src/v1beta/data_store_service_client.js +141 -288
- package/build/src/v1beta/document_service_client.d.ts +124 -124
- package/build/src/v1beta/document_service_client.js +150 -309
- package/build/src/v1beta/engine_service_client.d.ts +106 -106
- package/build/src/v1beta/engine_service_client.js +153 -315
- package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
- package/build/src/v1beta/evaluation_service_client.js +141 -285
- package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
- package/build/src/v1beta/grounded_generation_service_client.js +86 -114
- package/build/src/v1beta/project_service_client.d.ts +76 -76
- package/build/src/v1beta/project_service_client.js +115 -231
- package/build/src/v1beta/rank_service_client.d.ts +47 -47
- package/build/src/v1beta/rank_service_client.js +79 -99
- package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
- package/build/src/v1beta/recommendation_service_client.js +77 -96
- package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
- package/build/src/v1beta/sample_query_service_client.js +142 -291
- package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1beta/sample_query_set_service_client.js +104 -149
- package/build/src/v1beta/schema_service_client.d.ts +111 -111
- package/build/src/v1beta/schema_service_client.js +138 -282
- package/build/src/v1beta/search_service_client.d.ts +665 -665
- package/build/src/v1beta/search_service_client.js +97 -128
- package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
- package/build/src/v1beta/search_tuning_service_client.js +120 -243
- package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
- package/build/src/v1beta/serving_config_service_client.js +95 -129
- package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1beta/site_search_engine_service_client.js +186 -386
- package/build/src/v1beta/user_event_service_client.d.ts +78 -78
- package/build/src/v1beta/user_event_service_client.js +128 -261
- package/package.json +4 -4
@@ -145,7 +145,7 @@ export declare class ServingConfigServiceClient {
|
|
145
145
|
*/
|
146
146
|
updateServingConfig(request?: protos.google.cloud.discoveryengine.v1beta.IUpdateServingConfigRequest, options?: CallOptions): Promise<[
|
147
147
|
protos.google.cloud.discoveryengine.v1beta.IServingConfig,
|
148
|
-
|
148
|
+
protos.google.cloud.discoveryengine.v1beta.IUpdateServingConfigRequest | undefined,
|
149
149
|
{} | undefined
|
150
150
|
]>;
|
151
151
|
updateServingConfig(request: protos.google.cloud.discoveryengine.v1beta.IUpdateServingConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IServingConfig, protos.google.cloud.discoveryengine.v1beta.IUpdateServingConfigRequest | null | undefined, {} | null | undefined>): void;
|
@@ -171,38 +171,38 @@ export declare class ServingConfigServiceClient {
|
|
171
171
|
*/
|
172
172
|
getServingConfig(request?: protos.google.cloud.discoveryengine.v1beta.IGetServingConfigRequest, options?: CallOptions): Promise<[
|
173
173
|
protos.google.cloud.discoveryengine.v1beta.IServingConfig,
|
174
|
-
|
174
|
+
protos.google.cloud.discoveryengine.v1beta.IGetServingConfigRequest | undefined,
|
175
175
|
{} | undefined
|
176
176
|
]>;
|
177
177
|
getServingConfig(request: protos.google.cloud.discoveryengine.v1beta.IGetServingConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IServingConfig, protos.google.cloud.discoveryengine.v1beta.IGetServingConfigRequest | null | undefined, {} | null | undefined>): void;
|
178
178
|
getServingConfig(request: protos.google.cloud.discoveryengine.v1beta.IGetServingConfigRequest, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IServingConfig, protos.google.cloud.discoveryengine.v1beta.IGetServingConfigRequest | null | undefined, {} | null | undefined>): void;
|
179
179
|
/**
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
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}/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.v1beta.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.v1beta.IListServingConfigsRequest, options?: CallOptions): Promise<[
|
207
207
|
protos.google.cloud.discoveryengine.v1beta.IServingConfig[],
|
208
208
|
protos.google.cloud.discoveryengine.v1beta.IListServingConfigsRequest | null,
|
@@ -266,55 +266,55 @@ export declare class ServingConfigServiceClient {
|
|
266
266
|
*/
|
267
267
|
listServingConfigsAsync(request?: protos.google.cloud.discoveryengine.v1beta.IListServingConfigsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.discoveryengine.v1beta.IServingConfig>;
|
268
268
|
/**
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
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
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
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 engine 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
|
-
|
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 = [
|
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
|
}
|
@@ -214,7 +208,7 @@ class ServingConfigServiceClient {
|
|
214
208
|
// (e.g. 50 results at a time, with tokens to get subsequent
|
215
209
|
// pages). Denote the keys used for pagination and results.
|
216
210
|
this.descriptors.page = {
|
217
|
-
listServingConfigs: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'servingConfigs')
|
211
|
+
listServingConfigs: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'servingConfigs')
|
218
212
|
};
|
219
213
|
// Put together the default options sent with requests.
|
220
214
|
this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.ServingConfigService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
@@ -243,18 +237,13 @@ class ServingConfigServiceClient {
|
|
243
237
|
}
|
244
238
|
// Put together the "service stub" for
|
245
239
|
// google.cloud.discoveryengine.v1beta.ServingConfigService.
|
246
|
-
this.servingConfigServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
.ServingConfigService, this._opts, this._providedCustomServicePath);
|
240
|
+
this.servingConfigServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
241
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1beta.ServingConfigService') :
|
242
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
243
|
+
this._protos.google.cloud.discoveryengine.v1beta.ServingConfigService, this._opts, this._providedCustomServicePath);
|
251
244
|
// Iterate over each of the methods that the service provides
|
252
245
|
// and create an API call method for each.
|
253
|
-
const servingConfigServiceStubMethods = [
|
254
|
-
'updateServingConfig',
|
255
|
-
'getServingConfig',
|
256
|
-
'listServingConfigs',
|
257
|
-
];
|
246
|
+
const servingConfigServiceStubMethods = ['updateServingConfig', 'getServingConfig', 'listServingConfigs'];
|
258
247
|
for (const methodName of servingConfigServiceStubMethods) {
|
259
248
|
const callPromise = this.servingConfigServiceStub.then(stub => (...args) => {
|
260
249
|
if (this._terminated) {
|
@@ -265,7 +254,8 @@ class ServingConfigServiceClient {
|
|
265
254
|
}, (err) => () => {
|
266
255
|
throw err;
|
267
256
|
});
|
268
|
-
const descriptor = this.descriptors.page[methodName] ||
|
257
|
+
const descriptor = this.descriptors.page[methodName] ||
|
258
|
+
undefined;
|
269
259
|
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
|
270
260
|
this.innerApiCalls[methodName] = apiCall;
|
271
261
|
}
|
@@ -277,8 +267,7 @@ class ServingConfigServiceClient {
|
|
277
267
|
* @returns {string} The DNS address for this service.
|
278
268
|
*/
|
279
269
|
static get servicePath() {
|
280
|
-
if (typeof process === 'object' &&
|
281
|
-
typeof process.emitWarning === 'function') {
|
270
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
282
271
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
283
272
|
}
|
284
273
|
return 'discoveryengine.googleapis.com';
|
@@ -289,8 +278,7 @@ class ServingConfigServiceClient {
|
|
289
278
|
* @returns {string} The DNS address for this service.
|
290
279
|
*/
|
291
280
|
static get apiEndpoint() {
|
292
|
-
if (typeof process === 'object' &&
|
293
|
-
typeof process.emitWarning === 'function') {
|
281
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
294
282
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
295
283
|
}
|
296
284
|
return 'discoveryengine.googleapis.com';
|
@@ -318,7 +306,9 @@ class ServingConfigServiceClient {
|
|
318
306
|
* @returns {string[]} List of default scopes.
|
319
307
|
*/
|
320
308
|
static get scopes() {
|
321
|
-
return [
|
309
|
+
return [
|
310
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
311
|
+
];
|
322
312
|
}
|
323
313
|
/**
|
324
314
|
* Return the project ID used by this class.
|
@@ -344,13 +334,10 @@ class ServingConfigServiceClient {
|
|
344
334
|
options = options || {};
|
345
335
|
options.otherArgs = options.otherArgs || {};
|
346
336
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
347
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
348
|
-
|
349
|
-
'serving_config.name': request.servingConfig.name ?? '',
|
350
|
-
});
|
351
|
-
this.initialize().catch(err => {
|
352
|
-
throw err;
|
337
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
338
|
+
'serving_config.name': request.servingConfig.name ?? '',
|
353
339
|
});
|
340
|
+
this.initialize().catch(err => { throw err; });
|
354
341
|
this._log.info('updateServingConfig request %j', request);
|
355
342
|
const wrappedCallback = callback
|
356
343
|
? (error, response, options, rawResponse) => {
|
@@ -358,8 +345,7 @@ class ServingConfigServiceClient {
|
|
358
345
|
callback(error, response, options, rawResponse); // We verified callback above.
|
359
346
|
}
|
360
347
|
: undefined;
|
361
|
-
return this.innerApiCalls
|
362
|
-
.updateServingConfig(request, options, wrappedCallback)
|
348
|
+
return this.innerApiCalls.updateServingConfig(request, options, wrappedCallback)
|
363
349
|
?.then(([response, options, rawResponse]) => {
|
364
350
|
this._log.info('updateServingConfig response %j', response);
|
365
351
|
return [response, options, rawResponse];
|
@@ -378,13 +364,10 @@ class ServingConfigServiceClient {
|
|
378
364
|
options = options || {};
|
379
365
|
options.otherArgs = options.otherArgs || {};
|
380
366
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
381
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
382
|
-
|
383
|
-
name: request.name ?? '',
|
384
|
-
});
|
385
|
-
this.initialize().catch(err => {
|
386
|
-
throw err;
|
367
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
368
|
+
'name': request.name ?? '',
|
387
369
|
});
|
370
|
+
this.initialize().catch(err => { throw err; });
|
388
371
|
this._log.info('getServingConfig request %j', request);
|
389
372
|
const wrappedCallback = callback
|
390
373
|
? (error, response, options, rawResponse) => {
|
@@ -392,8 +375,7 @@ class ServingConfigServiceClient {
|
|
392
375
|
callback(error, response, options, rawResponse); // We verified callback above.
|
393
376
|
}
|
394
377
|
: undefined;
|
395
|
-
return this.innerApiCalls
|
396
|
-
.getServingConfig(request, options, wrappedCallback)
|
378
|
+
return this.innerApiCalls.getServingConfig(request, options, wrappedCallback)
|
397
379
|
?.then(([response, options, rawResponse]) => {
|
398
380
|
this._log.info('getServingConfig response %j', response);
|
399
381
|
return [response, options, rawResponse];
|
@@ -412,13 +394,10 @@ class ServingConfigServiceClient {
|
|
412
394
|
options = options || {};
|
413
395
|
options.otherArgs = options.otherArgs || {};
|
414
396
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
415
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
416
|
-
|
417
|
-
parent: request.parent ?? '',
|
418
|
-
});
|
419
|
-
this.initialize().catch(err => {
|
420
|
-
throw err;
|
397
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
398
|
+
'parent': request.parent ?? '',
|
421
399
|
});
|
400
|
+
this.initialize().catch(err => { throw err; });
|
422
401
|
const wrappedCallback = callback
|
423
402
|
? (error, values, nextPageRequest, rawResponse) => {
|
424
403
|
this._log.info('listServingConfigs values %j', values);
|
@@ -463,15 +442,12 @@ class ServingConfigServiceClient {
|
|
463
442
|
options = options || {};
|
464
443
|
options.otherArgs = options.otherArgs || {};
|
465
444
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
466
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
467
|
-
|
468
|
-
|
469
|
-
});
|
445
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
446
|
+
'parent': request.parent ?? '',
|
447
|
+
});
|
470
448
|
const defaultCallSettings = this._defaults['listServingConfigs'];
|
471
449
|
const callSettings = defaultCallSettings.merge(options);
|
472
|
-
this.initialize().catch(err => {
|
473
|
-
throw err;
|
474
|
-
});
|
450
|
+
this.initialize().catch(err => { throw err; });
|
475
451
|
this._log.info('listServingConfigs stream %j', request);
|
476
452
|
return this.descriptors.page.listServingConfigs.createStream(this.innerApiCalls.listServingConfigs, request, callSettings);
|
477
453
|
}
|
@@ -508,70 +484,67 @@ class ServingConfigServiceClient {
|
|
508
484
|
options = options || {};
|
509
485
|
options.otherArgs = options.otherArgs || {};
|
510
486
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
511
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
512
|
-
|
513
|
-
|
514
|
-
});
|
487
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
488
|
+
'parent': request.parent ?? '',
|
489
|
+
});
|
515
490
|
const defaultCallSettings = this._defaults['listServingConfigs'];
|
516
491
|
const callSettings = defaultCallSettings.merge(options);
|
517
|
-
this.initialize().catch(err => {
|
518
|
-
throw err;
|
519
|
-
});
|
492
|
+
this.initialize().catch(err => { throw err; });
|
520
493
|
this._log.info('listServingConfigs iterate %j', request);
|
521
494
|
return this.descriptors.page.listServingConfigs.asyncIterate(this.innerApiCalls['listServingConfigs'], request, callSettings);
|
522
495
|
}
|
523
496
|
/**
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
497
|
+
* Gets information about a location.
|
498
|
+
*
|
499
|
+
* @param {Object} request
|
500
|
+
* The request object that will be sent.
|
501
|
+
* @param {string} request.name
|
502
|
+
* Resource name for the location.
|
503
|
+
* @param {object} [options]
|
504
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
505
|
+
* @returns {Promise} - The promise which resolves to an array.
|
506
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
507
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
508
|
+
* for more details and examples.
|
509
|
+
* @example
|
510
|
+
* ```
|
511
|
+
* const [response] = await client.getLocation(request);
|
512
|
+
* ```
|
513
|
+
*/
|
541
514
|
getLocation(request, options, callback) {
|
542
515
|
return this.locationsClient.getLocation(request, options, callback);
|
543
516
|
}
|
544
517
|
/**
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
518
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
519
|
+
*
|
520
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
521
|
+
* @param {Object} request
|
522
|
+
* The request object that will be sent.
|
523
|
+
* @param {string} request.name
|
524
|
+
* The resource that owns the locations collection, if applicable.
|
525
|
+
* @param {string} request.filter
|
526
|
+
* The standard list filter.
|
527
|
+
* @param {number} request.pageSize
|
528
|
+
* The standard list page size.
|
529
|
+
* @param {string} request.pageToken
|
530
|
+
* The standard list page token.
|
531
|
+
* @param {object} [options]
|
532
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
533
|
+
* @returns {Object}
|
534
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
535
|
+
* When you iterate the returned iterable, each element will be an object representing
|
536
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
537
|
+
* so you can stop the iteration when you don't need more results.
|
538
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
539
|
+
* for more details and examples.
|
540
|
+
* @example
|
541
|
+
* ```
|
542
|
+
* const iterable = client.listLocationsAsync(request);
|
543
|
+
* for await (const response of iterable) {
|
544
|
+
* // process response
|
545
|
+
* }
|
546
|
+
* ```
|
547
|
+
*/
|
575
548
|
listLocationsAsync(request, options) {
|
576
549
|
return this.locationsClient.listLocationsAsync(request, options);
|
577
550
|
}
|
@@ -658,8 +631,7 @@ class ServingConfigServiceClient {
|
|
658
631
|
* @returns {string} A string representing the project.
|
659
632
|
*/
|
660
633
|
matchProjectFromEvaluationName(evaluationName) {
|
661
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
662
|
-
.project;
|
634
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
|
663
635
|
}
|
664
636
|
/**
|
665
637
|
* Parse the location from Evaluation resource.
|
@@ -669,8 +641,7 @@ class ServingConfigServiceClient {
|
|
669
641
|
* @returns {string} A string representing the location.
|
670
642
|
*/
|
671
643
|
matchLocationFromEvaluationName(evaluationName) {
|
672
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
673
|
-
.location;
|
644
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
|
674
645
|
}
|
675
646
|
/**
|
676
647
|
* Parse the evaluation from Evaluation resource.
|
@@ -680,8 +651,7 @@ class ServingConfigServiceClient {
|
|
680
651
|
* @returns {string} A string representing the evaluation.
|
681
652
|
*/
|
682
653
|
matchEvaluationFromEvaluationName(evaluationName) {
|
683
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
684
|
-
.evaluation;
|
654
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
|
685
655
|
}
|
686
656
|
/**
|
687
657
|
* Return a fully-qualified groundingConfig resource name string.
|
@@ -2952,8 +2922,7 @@ class ServingConfigServiceClient {
|
|
2952
2922
|
* @returns {string} A string representing the project.
|
2953
2923
|
*/
|
2954
2924
|
matchProjectFromSampleQueryName(sampleQueryName) {
|
2955
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2956
|
-
.project;
|
2925
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
|
2957
2926
|
}
|
2958
2927
|
/**
|
2959
2928
|
* Parse the location from SampleQuery resource.
|
@@ -2963,8 +2932,7 @@ class ServingConfigServiceClient {
|
|
2963
2932
|
* @returns {string} A string representing the location.
|
2964
2933
|
*/
|
2965
2934
|
matchLocationFromSampleQueryName(sampleQueryName) {
|
2966
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2967
|
-
.location;
|
2935
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
|
2968
2936
|
}
|
2969
2937
|
/**
|
2970
2938
|
* Parse the sample_query_set from SampleQuery resource.
|
@@ -2974,8 +2942,7 @@ class ServingConfigServiceClient {
|
|
2974
2942
|
* @returns {string} A string representing the sample_query_set.
|
2975
2943
|
*/
|
2976
2944
|
matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
|
2977
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2978
|
-
.sample_query_set;
|
2945
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
|
2979
2946
|
}
|
2980
2947
|
/**
|
2981
2948
|
* Parse the sample_query from SampleQuery resource.
|
@@ -2985,8 +2952,7 @@ class ServingConfigServiceClient {
|
|
2985
2952
|
* @returns {string} A string representing the sample_query.
|
2986
2953
|
*/
|
2987
2954
|
matchSampleQueryFromSampleQueryName(sampleQueryName) {
|
2988
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2989
|
-
.sample_query;
|
2955
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
|
2990
2956
|
}
|
2991
2957
|
/**
|
2992
2958
|
* Return a fully-qualified sampleQuerySet resource name string.
|
@@ -3045,7 +3011,7 @@ class ServingConfigServiceClient {
|
|
3045
3011
|
this._log.info('ending gRPC channel');
|
3046
3012
|
this._terminated = true;
|
3047
3013
|
stub.close();
|
3048
|
-
this.locationsClient.close();
|
3014
|
+
this.locationsClient.close().catch(err => { throw err; });
|
3049
3015
|
});
|
3050
3016
|
}
|
3051
3017
|
return Promise.resolve();
|