@google-cloud/discoveryengine 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/build/protos/google/cloud/discoveryengine/v1/answer.proto +17 -0
- package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +52 -0
- package/build/protos/google/cloud/discoveryengine/v1/cmek_config_service.proto +300 -0
- package/build/protos/google/cloud/discoveryengine/v1/common.proto +67 -0
- package/build/protos/google/cloud/discoveryengine/v1/control.proto +1 -3
- package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +3 -0
- package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +54 -2
- package/build/protos/google/cloud/discoveryengine/v1/data_store_service.proto +14 -0
- package/build/protos/google/cloud/discoveryengine/v1/document.proto +95 -4
- package/build/protos/google/cloud/discoveryengine/v1/document_processing_config.proto +28 -1
- package/build/protos/google/cloud/discoveryengine/v1/engine.proto +131 -6
- package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +8 -0
- package/build/protos/google/cloud/discoveryengine/v1/grounding.proto +9 -0
- package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store.proto +84 -0
- package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store_service.proto +375 -0
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +6 -0
- package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +6 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_license.proto +98 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_license_service.proto +191 -0
- package/build/protos/protos.d.ts +5415 -578
- package/build/protos/protos.js +77830 -63391
- package/build/protos/protos.json +1537 -92
- package/build/src/index.d.ts +10 -1
- package/build/src/index.js +8 -22
- package/build/src/v1/cmek_config_service_client.d.ts +2287 -0
- package/build/src/v1/cmek_config_service_client.js +3274 -0
- package/build/src/v1/cmek_config_service_client_config.json +42 -0
- package/build/src/v1/cmek_config_service_proto_list.json +44 -0
- package/build/src/v1/completion_service_client.d.ts +166 -76
- package/build/src/v1/completion_service_client.js +258 -263
- package/build/src/v1/completion_service_proto_list.json +6 -1
- package/build/src/v1/control_service_client.d.ts +171 -81
- package/build/src/v1/control_service_client.js +246 -132
- package/build/src/v1/control_service_proto_list.json +6 -1
- package/build/src/v1/conversational_search_service_client.d.ts +233 -143
- package/build/src/v1/conversational_search_service_client.js +330 -226
- package/build/src/v1/conversational_search_service_proto_list.json +6 -1
- package/build/src/v1/data_store_service_client.d.ts +218 -122
- package/build/src/v1/data_store_service_client.js +273 -281
- package/build/src/v1/data_store_service_proto_list.json +6 -1
- package/build/src/v1/document_service_client.d.ts +210 -120
- package/build/src/v1/document_service_client.js +300 -301
- package/build/src/v1/document_service_proto_list.json +6 -1
- package/build/src/v1/engine_service_client.d.ts +193 -103
- package/build/src/v1/engine_service_client.js +273 -280
- package/build/src/v1/engine_service_proto_list.json +6 -1
- package/build/src/v1/gapic_metadata.json +184 -0
- package/build/src/v1/grounded_generation_service_client.d.ts +138 -48
- package/build/src/v1/grounded_generation_service_client.js +217 -100
- package/build/src/v1/grounded_generation_service_proto_list.json +6 -1
- package/build/src/v1/identity_mapping_store_service_client.d.ts +2470 -0
- package/build/src/v1/identity_mapping_store_service_client.js +3449 -0
- package/build/src/v1/identity_mapping_store_service_client_config.json +54 -0
- package/build/src/v1/identity_mapping_store_service_proto_list.json +44 -0
- package/build/src/v1/index.d.ts +3 -0
- package/build/src/v1/index.js +7 -1
- package/build/src/v1/project_service_client.d.ts +166 -76
- package/build/src/v1/project_service_client.js +235 -223
- package/build/src/v1/project_service_proto_list.json +6 -1
- package/build/src/v1/rank_service_client.d.ts +137 -47
- package/build/src/v1/rank_service_client.js +204 -85
- package/build/src/v1/rank_service_proto_list.json +6 -1
- package/build/src/v1/recommendation_service_client.d.ts +137 -47
- package/build/src/v1/recommendation_service_client.js +202 -82
- package/build/src/v1/recommendation_service_proto_list.json +6 -1
- package/build/src/v1/schema_service_client.d.ts +201 -111
- package/build/src/v1/schema_service_client.js +264 -274
- package/build/src/v1/schema_service_proto_list.json +6 -1
- package/build/src/v1/search_service_client.d.ts +661 -571
- package/build/src/v1/search_service_client.js +216 -113
- package/build/src/v1/search_service_proto_list.json +6 -1
- package/build/src/v1/search_tuning_service_client.d.ts +167 -77
- package/build/src/v1/search_tuning_service_client.js +246 -236
- package/build/src/v1/search_tuning_service_proto_list.json +6 -1
- package/build/src/v1/serving_config_service_client.d.ts +138 -48
- package/build/src/v1/serving_config_service_client.js +201 -80
- package/build/src/v1/serving_config_service_proto_list.json +6 -1
- package/build/src/v1/site_search_engine_service_client.d.ts +238 -148
- package/build/src/v1/site_search_engine_service_client.js +324 -379
- package/build/src/v1/site_search_engine_service_proto_list.json +6 -1
- package/build/src/v1/user_event_service_client.d.ts +167 -77
- package/build/src/v1/user_event_service_client.js +260 -254
- package/build/src/v1/user_event_service_proto_list.json +6 -1
- package/build/src/v1/user_license_service_client.d.ts +2256 -0
- package/build/src/v1/user_license_service_client.js +3194 -0
- package/build/src/v1/user_license_service_client_config.json +34 -0
- package/build/src/v1/user_license_service_proto_list.json +44 -0
- package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
- package/build/src/v1alpha/acl_config_service_client.js +94 -106
- package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
- package/build/src/v1alpha/chunk_service_client.js +98 -120
- package/build/src/v1alpha/completion_service_client.d.ts +77 -77
- package/build/src/v1alpha/completion_service_client.js +141 -281
- package/build/src/v1alpha/control_service_client.d.ts +85 -85
- package/build/src/v1alpha/control_service_client.js +129 -151
- package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
- package/build/src/v1alpha/conversational_search_service_client.js +211 -237
- package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
- package/build/src/v1alpha/data_store_service_client.js +176 -317
- package/build/src/v1alpha/document_service_client.d.ts +126 -126
- package/build/src/v1alpha/document_service_client.js +193 -329
- package/build/src/v1alpha/engine_service_client.d.ts +106 -106
- package/build/src/v1alpha/engine_service_client.js +180 -326
- package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
- package/build/src/v1alpha/estimate_billing_service_client.js +119 -244
- package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
- package/build/src/v1alpha/evaluation_service_client.js +150 -296
- package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
- package/build/src/v1alpha/grounded_generation_service_client.js +85 -100
- package/build/src/v1alpha/project_service_client.d.ts +78 -78
- package/build/src/v1alpha/project_service_client.js +139 -263
- package/build/src/v1alpha/rank_service_client.d.ts +47 -47
- package/build/src/v1alpha/rank_service_client.js +87 -104
- package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
- package/build/src/v1alpha/recommendation_service_client.js +85 -100
- package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
- package/build/src/v1alpha/sample_query_service_client.js +169 -302
- package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1alpha/sample_query_set_service_client.js +130 -153
- package/build/src/v1alpha/schema_service_client.d.ts +112 -112
- package/build/src/v1alpha/schema_service_client.js +147 -293
- 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 +129 -254
- package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
- package/build/src/v1alpha/serving_config_service_client.js +109 -133
- package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1alpha/site_search_engine_service_client.js +203 -388
- package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
- package/build/src/v1alpha/user_event_service_client.js +143 -272
- package/build/src/v1beta/completion_service_client.d.ts +78 -78
- package/build/src/v1beta/completion_service_client.js +149 -280
- package/build/src/v1beta/control_service_client.d.ts +84 -84
- package/build/src/v1beta/control_service_client.js +127 -147
- package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
- package/build/src/v1beta/conversational_search_service_client.js +209 -233
- package/build/src/v1beta/data_store_service_client.d.ts +124 -124
- package/build/src/v1beta/data_store_service_client.js +154 -289
- package/build/src/v1beta/document_service_client.d.ts +124 -124
- package/build/src/v1beta/document_service_client.js +181 -310
- package/build/src/v1beta/engine_service_client.d.ts +106 -106
- package/build/src/v1beta/engine_service_client.js +178 -316
- package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
- package/build/src/v1beta/evaluation_service_client.js +148 -286
- package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
- package/build/src/v1beta/grounded_generation_service_client.js +98 -114
- package/build/src/v1beta/project_service_client.d.ts +76 -76
- package/build/src/v1beta/project_service_client.js +116 -232
- package/build/src/v1beta/rank_service_client.d.ts +47 -47
- package/build/src/v1beta/rank_service_client.js +85 -99
- package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
- package/build/src/v1beta/recommendation_service_client.js +83 -96
- package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
- package/build/src/v1beta/sample_query_service_client.js +167 -292
- package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1beta/sample_query_set_service_client.js +128 -149
- package/build/src/v1beta/schema_service_client.d.ts +111 -111
- package/build/src/v1beta/schema_service_client.js +145 -283
- 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 +127 -244
- package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
- package/build/src/v1beta/serving_config_service_client.js +107 -129
- package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1beta/site_search_engine_service_client.js +205 -387
- package/build/src/v1beta/user_event_service_client.d.ts +78 -78
- package/build/src/v1beta/user_event_service_client.js +141 -262
- package/package.json +7 -7
- package/CHANGELOG.md +0 -267
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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_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
|
-
|
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 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
|
-
|
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
|
}
|
@@ -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
|
-
|
246
|
-
|
247
|
-
|
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] ||
|
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 [
|
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
|
-
|
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,11 +343,16 @@ 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];
|
350
|
+
}).catch((error) => {
|
351
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
352
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
353
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
354
|
+
}
|
355
|
+
throw error;
|
364
356
|
});
|
365
357
|
}
|
366
358
|
getServingConfig(request, optionsOrCallback, callback) {
|
@@ -376,13 +368,10 @@ class ServingConfigServiceClient {
|
|
376
368
|
options = options || {};
|
377
369
|
options.otherArgs = options.otherArgs || {};
|
378
370
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
379
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
380
|
-
|
381
|
-
name: request.name ?? '',
|
382
|
-
});
|
383
|
-
this.initialize().catch(err => {
|
384
|
-
throw err;
|
371
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
372
|
+
'name': request.name ?? '',
|
385
373
|
});
|
374
|
+
this.initialize().catch(err => { throw err; });
|
386
375
|
this._log.info('getServingConfig request %j', request);
|
387
376
|
const wrappedCallback = callback
|
388
377
|
? (error, response, options, rawResponse) => {
|
@@ -390,11 +379,16 @@ class ServingConfigServiceClient {
|
|
390
379
|
callback(error, response, options, rawResponse); // We verified callback above.
|
391
380
|
}
|
392
381
|
: undefined;
|
393
|
-
return this.innerApiCalls
|
394
|
-
.getServingConfig(request, options, wrappedCallback)
|
382
|
+
return this.innerApiCalls.getServingConfig(request, options, wrappedCallback)
|
395
383
|
?.then(([response, options, rawResponse]) => {
|
396
384
|
this._log.info('getServingConfig response %j', response);
|
397
385
|
return [response, options, rawResponse];
|
386
|
+
}).catch((error) => {
|
387
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
388
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
389
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
390
|
+
}
|
391
|
+
throw error;
|
398
392
|
});
|
399
393
|
}
|
400
394
|
listServingConfigs(request, optionsOrCallback, callback) {
|
@@ -410,13 +404,10 @@ class ServingConfigServiceClient {
|
|
410
404
|
options = options || {};
|
411
405
|
options.otherArgs = options.otherArgs || {};
|
412
406
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
413
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
414
|
-
|
415
|
-
parent: request.parent ?? '',
|
416
|
-
});
|
417
|
-
this.initialize().catch(err => {
|
418
|
-
throw err;
|
407
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
408
|
+
'parent': request.parent ?? '',
|
419
409
|
});
|
410
|
+
this.initialize().catch(err => { throw err; });
|
420
411
|
const wrappedCallback = callback
|
421
412
|
? (error, values, nextPageRequest, rawResponse) => {
|
422
413
|
this._log.info('listServingConfigs values %j', values);
|
@@ -461,15 +452,12 @@ class ServingConfigServiceClient {
|
|
461
452
|
options = options || {};
|
462
453
|
options.otherArgs = options.otherArgs || {};
|
463
454
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
464
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
465
|
-
|
466
|
-
|
467
|
-
});
|
455
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
456
|
+
'parent': request.parent ?? '',
|
457
|
+
});
|
468
458
|
const defaultCallSettings = this._defaults['listServingConfigs'];
|
469
459
|
const callSettings = defaultCallSettings.merge(options);
|
470
|
-
this.initialize().catch(err => {
|
471
|
-
throw err;
|
472
|
-
});
|
460
|
+
this.initialize().catch(err => { throw err; });
|
473
461
|
this._log.info('listServingConfigs stream %j', request);
|
474
462
|
return this.descriptors.page.listServingConfigs.createStream(this.innerApiCalls.listServingConfigs, request, callSettings);
|
475
463
|
}
|
@@ -506,70 +494,67 @@ class ServingConfigServiceClient {
|
|
506
494
|
options = options || {};
|
507
495
|
options.otherArgs = options.otherArgs || {};
|
508
496
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
509
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
510
|
-
|
511
|
-
|
512
|
-
});
|
497
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
498
|
+
'parent': request.parent ?? '',
|
499
|
+
});
|
513
500
|
const defaultCallSettings = this._defaults['listServingConfigs'];
|
514
501
|
const callSettings = defaultCallSettings.merge(options);
|
515
|
-
this.initialize().catch(err => {
|
516
|
-
throw err;
|
517
|
-
});
|
502
|
+
this.initialize().catch(err => { throw err; });
|
518
503
|
this._log.info('listServingConfigs iterate %j', request);
|
519
504
|
return this.descriptors.page.listServingConfigs.asyncIterate(this.innerApiCalls['listServingConfigs'], request, callSettings);
|
520
505
|
}
|
521
506
|
/**
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
507
|
+
* Gets information about a location.
|
508
|
+
*
|
509
|
+
* @param {Object} request
|
510
|
+
* The request object that will be sent.
|
511
|
+
* @param {string} request.name
|
512
|
+
* Resource name for the location.
|
513
|
+
* @param {object} [options]
|
514
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
515
|
+
* @returns {Promise} - The promise which resolves to an array.
|
516
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
517
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
518
|
+
* for more details and examples.
|
519
|
+
* @example
|
520
|
+
* ```
|
521
|
+
* const [response] = await client.getLocation(request);
|
522
|
+
* ```
|
523
|
+
*/
|
539
524
|
getLocation(request, options, callback) {
|
540
525
|
return this.locationsClient.getLocation(request, options, callback);
|
541
526
|
}
|
542
527
|
/**
|
543
|
-
|
544
|
-
|
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
|
-
|
528
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
529
|
+
*
|
530
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
531
|
+
* @param {Object} request
|
532
|
+
* The request object that will be sent.
|
533
|
+
* @param {string} request.name
|
534
|
+
* The resource that owns the locations collection, if applicable.
|
535
|
+
* @param {string} request.filter
|
536
|
+
* The standard list filter.
|
537
|
+
* @param {number} request.pageSize
|
538
|
+
* The standard list page size.
|
539
|
+
* @param {string} request.pageToken
|
540
|
+
* The standard list page token.
|
541
|
+
* @param {object} [options]
|
542
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
543
|
+
* @returns {Object}
|
544
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
545
|
+
* When you iterate the returned iterable, each element will be an object representing
|
546
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
547
|
+
* so you can stop the iteration when you don't need more results.
|
548
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
549
|
+
* for more details and examples.
|
550
|
+
* @example
|
551
|
+
* ```
|
552
|
+
* const iterable = client.listLocationsAsync(request);
|
553
|
+
* for await (const response of iterable) {
|
554
|
+
* // process response
|
555
|
+
* }
|
556
|
+
* ```
|
557
|
+
*/
|
573
558
|
listLocationsAsync(request, options) {
|
574
559
|
return this.locationsClient.listLocationsAsync(request, options);
|
575
560
|
}
|
@@ -597,8 +582,7 @@ class ServingConfigServiceClient {
|
|
597
582
|
* @returns {string} A string representing the project.
|
598
583
|
*/
|
599
584
|
matchProjectFromAclConfigName(aclConfigName) {
|
600
|
-
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
|
601
|
-
.project;
|
585
|
+
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
|
602
586
|
}
|
603
587
|
/**
|
604
588
|
* Parse the location from AclConfig resource.
|
@@ -608,8 +592,7 @@ class ServingConfigServiceClient {
|
|
608
592
|
* @returns {string} A string representing the location.
|
609
593
|
*/
|
610
594
|
matchLocationFromAclConfigName(aclConfigName) {
|
611
|
-
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
|
612
|
-
.location;
|
595
|
+
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
|
613
596
|
}
|
614
597
|
/**
|
615
598
|
* Return a fully-qualified engine resource name string.
|
@@ -691,8 +674,7 @@ class ServingConfigServiceClient {
|
|
691
674
|
* @returns {string} A string representing the project.
|
692
675
|
*/
|
693
676
|
matchProjectFromEvaluationName(evaluationName) {
|
694
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
695
|
-
.project;
|
677
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
|
696
678
|
}
|
697
679
|
/**
|
698
680
|
* Parse the location from Evaluation resource.
|
@@ -702,8 +684,7 @@ class ServingConfigServiceClient {
|
|
702
684
|
* @returns {string} A string representing the location.
|
703
685
|
*/
|
704
686
|
matchLocationFromEvaluationName(evaluationName) {
|
705
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
706
|
-
.location;
|
687
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
|
707
688
|
}
|
708
689
|
/**
|
709
690
|
* Parse the evaluation from Evaluation resource.
|
@@ -713,8 +694,7 @@ class ServingConfigServiceClient {
|
|
713
694
|
* @returns {string} A string representing the evaluation.
|
714
695
|
*/
|
715
696
|
matchEvaluationFromEvaluationName(evaluationName) {
|
716
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
717
|
-
.evaluation;
|
697
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
|
718
698
|
}
|
719
699
|
/**
|
720
700
|
* Return a fully-qualified location resource name string.
|
@@ -2814,8 +2794,7 @@ class ServingConfigServiceClient {
|
|
2814
2794
|
* @returns {string} A string representing the project.
|
2815
2795
|
*/
|
2816
2796
|
matchProjectFromSampleQueryName(sampleQueryName) {
|
2817
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2818
|
-
.project;
|
2797
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
|
2819
2798
|
}
|
2820
2799
|
/**
|
2821
2800
|
* Parse the location from SampleQuery resource.
|
@@ -2825,8 +2804,7 @@ class ServingConfigServiceClient {
|
|
2825
2804
|
* @returns {string} A string representing the location.
|
2826
2805
|
*/
|
2827
2806
|
matchLocationFromSampleQueryName(sampleQueryName) {
|
2828
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2829
|
-
.location;
|
2807
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
|
2830
2808
|
}
|
2831
2809
|
/**
|
2832
2810
|
* Parse the sample_query_set from SampleQuery resource.
|
@@ -2836,8 +2814,7 @@ class ServingConfigServiceClient {
|
|
2836
2814
|
* @returns {string} A string representing the sample_query_set.
|
2837
2815
|
*/
|
2838
2816
|
matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
|
2839
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2840
|
-
.sample_query_set;
|
2817
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
|
2841
2818
|
}
|
2842
2819
|
/**
|
2843
2820
|
* Parse the sample_query from SampleQuery resource.
|
@@ -2847,8 +2824,7 @@ class ServingConfigServiceClient {
|
|
2847
2824
|
* @returns {string} A string representing the sample_query.
|
2848
2825
|
*/
|
2849
2826
|
matchSampleQueryFromSampleQueryName(sampleQueryName) {
|
2850
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2851
|
-
.sample_query;
|
2827
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
|
2852
2828
|
}
|
2853
2829
|
/**
|
2854
2830
|
* Return a fully-qualified sampleQuerySet resource name string.
|
@@ -2907,7 +2883,7 @@ class ServingConfigServiceClient {
|
|
2907
2883
|
this._log.info('ending gRPC channel');
|
2908
2884
|
this._terminated = true;
|
2909
2885
|
stub.close();
|
2910
|
-
this.locationsClient.close();
|
2886
|
+
this.locationsClient.close().catch(err => { throw err; });
|
2911
2887
|
});
|
2912
2888
|
}
|
2913
2889
|
return Promise.resolve();
|