@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.
- package/CHANGELOG.md +7 -0
- package/build/protos/protos.d.ts +31 -316
- package/build/protos/protos.js +146 -593
- package/build/protos/protos.json +25 -1
- package/build/src/index.d.ts +1 -1
- package/build/src/index.js +1 -21
- package/build/src/v1/completion_service_client.d.ts +76 -76
- package/build/src/v1/completion_service_client.js +125 -262
- package/build/src/v1/control_service_client.d.ts +81 -81
- package/build/src/v1/control_service_client.js +96 -132
- package/build/src/v1/conversational_search_service_client.d.ts +143 -143
- package/build/src/v1/conversational_search_service_client.js +138 -226
- package/build/src/v1/data_store_service_client.d.ts +122 -122
- package/build/src/v1/data_store_service_client.js +134 -280
- package/build/src/v1/document_service_client.d.ts +120 -120
- package/build/src/v1/document_service_client.js +143 -300
- package/build/src/v1/engine_service_client.d.ts +103 -103
- package/build/src/v1/engine_service_client.js +134 -279
- package/build/src/v1/grounded_generation_service_client.d.ts +48 -48
- package/build/src/v1/grounded_generation_service_client.js +79 -100
- package/build/src/v1/project_service_client.d.ts +76 -76
- package/build/src/v1/project_service_client.js +108 -222
- package/build/src/v1/rank_service_client.d.ts +47 -47
- package/build/src/v1/rank_service_client.js +72 -85
- package/build/src/v1/recommendation_service_client.d.ts +47 -47
- package/build/src/v1/recommendation_service_client.js +70 -82
- package/build/src/v1/schema_service_client.d.ts +111 -111
- package/build/src/v1/schema_service_client.js +131 -273
- package/build/src/v1/search_service_client.d.ts +545 -545
- package/build/src/v1/search_service_client.js +90 -113
- package/build/src/v1/search_tuning_service_client.d.ts +77 -77
- package/build/src/v1/search_tuning_service_client.js +113 -235
- package/build/src/v1/serving_config_service_client.d.ts +48 -48
- package/build/src/v1/serving_config_service_client.js +69 -80
- package/build/src/v1/site_search_engine_service_client.d.ts +148 -148
- package/build/src/v1/site_search_engine_service_client.js +179 -378
- package/build/src/v1/user_event_service_client.d.ts +77 -77
- package/build/src/v1/user_event_service_client.js +121 -253
- 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 +1 -1
@@ -97,26 +97,17 @@ class RankServiceClient {
|
|
97
97
|
constructor(opts, gaxInstance) {
|
98
98
|
// Ensure that options include all the required fields.
|
99
99
|
const staticMembers = this.constructor;
|
100
|
-
if (opts?.universe_domain &&
|
101
|
-
opts?.universeDomain &&
|
102
|
-
opts?.universe_domain !== opts?.universeDomain) {
|
100
|
+
if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
|
103
101
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
104
102
|
}
|
105
|
-
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
106
|
-
|
107
|
-
: undefined;
|
108
|
-
this._universeDomain =
|
109
|
-
opts?.universeDomain ??
|
110
|
-
opts?.universe_domain ??
|
111
|
-
universeDomainEnvVar ??
|
112
|
-
'googleapis.com';
|
103
|
+
const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
|
104
|
+
this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
|
113
105
|
this._servicePath = 'discoveryengine.' + this._universeDomain;
|
114
106
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
115
107
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
116
108
|
const port = opts?.port || staticMembers.port;
|
117
109
|
const clientConfig = opts?.clientConfig ?? {};
|
118
|
-
const fallback = opts?.fallback ??
|
119
|
-
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
110
|
+
const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
120
111
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
121
112
|
// Request numeric enum values if REST transport is used.
|
122
113
|
opts.numericEnums = true;
|
@@ -146,7 +137,10 @@ class RankServiceClient {
|
|
146
137
|
}
|
147
138
|
this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
|
148
139
|
// Determine the client header string.
|
149
|
-
const clientHeader = [
|
140
|
+
const clientHeader = [
|
141
|
+
`gax/${this._gaxModule.version}`,
|
142
|
+
`gapic/${version}`,
|
143
|
+
];
|
150
144
|
if (typeof process === 'object' && 'versions' in process) {
|
151
145
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
152
146
|
}
|
@@ -232,10 +226,10 @@ class RankServiceClient {
|
|
232
226
|
}
|
233
227
|
// Put together the "service stub" for
|
234
228
|
// google.cloud.discoveryengine.v1.RankService.
|
235
|
-
this.rankServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
236
|
-
|
237
|
-
|
238
|
-
|
229
|
+
this.rankServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
230
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1.RankService') :
|
231
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
232
|
+
this._protos.google.cloud.discoveryengine.v1.RankService, this._opts, this._providedCustomServicePath);
|
239
233
|
// Iterate over each of the methods that the service provides
|
240
234
|
// and create an API call method for each.
|
241
235
|
const rankServiceStubMethods = ['rank'];
|
@@ -261,8 +255,7 @@ class RankServiceClient {
|
|
261
255
|
* @returns {string} The DNS address for this service.
|
262
256
|
*/
|
263
257
|
static get servicePath() {
|
264
|
-
if (typeof process === 'object' &&
|
265
|
-
typeof process.emitWarning === 'function') {
|
258
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
266
259
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
267
260
|
}
|
268
261
|
return 'discoveryengine.googleapis.com';
|
@@ -273,8 +266,7 @@ class RankServiceClient {
|
|
273
266
|
* @returns {string} The DNS address for this service.
|
274
267
|
*/
|
275
268
|
static get apiEndpoint() {
|
276
|
-
if (typeof process === 'object' &&
|
277
|
-
typeof process.emitWarning === 'function') {
|
269
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
278
270
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
279
271
|
}
|
280
272
|
return 'discoveryengine.googleapis.com';
|
@@ -302,7 +294,9 @@ class RankServiceClient {
|
|
302
294
|
* @returns {string[]} List of default scopes.
|
303
295
|
*/
|
304
296
|
static get scopes() {
|
305
|
-
return [
|
297
|
+
return [
|
298
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
299
|
+
];
|
306
300
|
}
|
307
301
|
/**
|
308
302
|
* Return the project ID used by this class.
|
@@ -328,13 +322,10 @@ class RankServiceClient {
|
|
328
322
|
options = options || {};
|
329
323
|
options.otherArgs = options.otherArgs || {};
|
330
324
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
331
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
332
|
-
|
333
|
-
ranking_config: request.rankingConfig ?? '',
|
334
|
-
});
|
335
|
-
this.initialize().catch(err => {
|
336
|
-
throw err;
|
325
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
326
|
+
'ranking_config': request.rankingConfig ?? '',
|
337
327
|
});
|
328
|
+
this.initialize().catch(err => { throw err; });
|
338
329
|
this._log.info('rank request %j', request);
|
339
330
|
const wrappedCallback = callback
|
340
331
|
? (error, response, options, rawResponse) => {
|
@@ -342,65 +333,64 @@ class RankServiceClient {
|
|
342
333
|
callback(error, response, options, rawResponse); // We verified callback above.
|
343
334
|
}
|
344
335
|
: undefined;
|
345
|
-
return this.innerApiCalls
|
346
|
-
.rank(request, options, wrappedCallback)
|
336
|
+
return this.innerApiCalls.rank(request, options, wrappedCallback)
|
347
337
|
?.then(([response, options, rawResponse]) => {
|
348
338
|
this._log.info('rank response %j', response);
|
349
339
|
return [response, options, rawResponse];
|
350
340
|
});
|
351
341
|
}
|
352
342
|
/**
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
343
|
+
* Gets information about a location.
|
344
|
+
*
|
345
|
+
* @param {Object} request
|
346
|
+
* The request object that will be sent.
|
347
|
+
* @param {string} request.name
|
348
|
+
* Resource name for the location.
|
349
|
+
* @param {object} [options]
|
350
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
351
|
+
* @returns {Promise} - The promise which resolves to an array.
|
352
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
353
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
354
|
+
* for more details and examples.
|
355
|
+
* @example
|
356
|
+
* ```
|
357
|
+
* const [response] = await client.getLocation(request);
|
358
|
+
* ```
|
359
|
+
*/
|
370
360
|
getLocation(request, options, callback) {
|
371
361
|
return this.locationsClient.getLocation(request, options, callback);
|
372
362
|
}
|
373
363
|
/**
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
364
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
365
|
+
*
|
366
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
367
|
+
* @param {Object} request
|
368
|
+
* The request object that will be sent.
|
369
|
+
* @param {string} request.name
|
370
|
+
* The resource that owns the locations collection, if applicable.
|
371
|
+
* @param {string} request.filter
|
372
|
+
* The standard list filter.
|
373
|
+
* @param {number} request.pageSize
|
374
|
+
* The standard list page size.
|
375
|
+
* @param {string} request.pageToken
|
376
|
+
* The standard list page token.
|
377
|
+
* @param {object} [options]
|
378
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
379
|
+
* @returns {Object}
|
380
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
381
|
+
* When you iterate the returned iterable, each element will be an object representing
|
382
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
383
|
+
* so you can stop the iteration when you don't need more results.
|
384
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
385
|
+
* for more details and examples.
|
386
|
+
* @example
|
387
|
+
* ```
|
388
|
+
* const iterable = client.listLocationsAsync(request);
|
389
|
+
* for await (const response of iterable) {
|
390
|
+
* // process response
|
391
|
+
* }
|
392
|
+
* ```
|
393
|
+
*/
|
404
394
|
listLocationsAsync(request, options) {
|
405
395
|
return this.locationsClient.listLocationsAsync(request, options);
|
406
396
|
}
|
@@ -2653,8 +2643,7 @@ class RankServiceClient {
|
|
2653
2643
|
* @returns {string} A string representing the project.
|
2654
2644
|
*/
|
2655
2645
|
matchProjectFromRankingConfigName(rankingConfigName) {
|
2656
|
-
return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName)
|
2657
|
-
.project;
|
2646
|
+
return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName).project;
|
2658
2647
|
}
|
2659
2648
|
/**
|
2660
2649
|
* Parse the location from RankingConfig resource.
|
@@ -2664,8 +2653,7 @@ class RankServiceClient {
|
|
2664
2653
|
* @returns {string} A string representing the location.
|
2665
2654
|
*/
|
2666
2655
|
matchLocationFromRankingConfigName(rankingConfigName) {
|
2667
|
-
return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName)
|
2668
|
-
.location;
|
2656
|
+
return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName).location;
|
2669
2657
|
}
|
2670
2658
|
/**
|
2671
2659
|
* Parse the ranking_config from RankingConfig resource.
|
@@ -2675,8 +2663,7 @@ class RankServiceClient {
|
|
2675
2663
|
* @returns {string} A string representing the ranking_config.
|
2676
2664
|
*/
|
2677
2665
|
matchRankingConfigFromRankingConfigName(rankingConfigName) {
|
2678
|
-
return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName)
|
2679
|
-
.ranking_config;
|
2666
|
+
return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName).ranking_config;
|
2680
2667
|
}
|
2681
2668
|
/**
|
2682
2669
|
* Terminate the gRPC channel and close the client.
|
@@ -2690,7 +2677,7 @@ class RankServiceClient {
|
|
2690
2677
|
this._log.info('ending gRPC channel');
|
2691
2678
|
this._terminated = true;
|
2692
2679
|
stub.close();
|
2693
|
-
this.locationsClient.close();
|
2680
|
+
this.locationsClient.close().catch(err => { throw err; });
|
2694
2681
|
});
|
2695
2682
|
}
|
2696
2683
|
return Promise.resolve();
|
@@ -253,55 +253,55 @@ export declare class RecommendationServiceClient {
|
|
253
253
|
recommend(request: protos.google.cloud.discoveryengine.v1.IRecommendRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1.IRecommendResponse, protos.google.cloud.discoveryengine.v1.IRecommendRequest | null | undefined, {} | null | undefined>): void;
|
254
254
|
recommend(request: protos.google.cloud.discoveryengine.v1.IRecommendRequest, callback: Callback<protos.google.cloud.discoveryengine.v1.IRecommendResponse, protos.google.cloud.discoveryengine.v1.IRecommendRequest | null | undefined, {} | null | undefined>): void;
|
255
255
|
/**
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
256
|
+
* Gets information about a location.
|
257
|
+
*
|
258
|
+
* @param {Object} request
|
259
|
+
* The request object that will be sent.
|
260
|
+
* @param {string} request.name
|
261
|
+
* Resource name for the location.
|
262
|
+
* @param {object} [options]
|
263
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
264
|
+
* @returns {Promise} - The promise which resolves to an array.
|
265
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
266
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
267
|
+
* for more details and examples.
|
268
|
+
* @example
|
269
|
+
* ```
|
270
|
+
* const [response] = await client.getLocation(request);
|
271
|
+
* ```
|
272
|
+
*/
|
273
273
|
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>;
|
274
274
|
/**
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
275
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
276
|
+
*
|
277
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
278
|
+
* @param {Object} request
|
279
|
+
* The request object that will be sent.
|
280
|
+
* @param {string} request.name
|
281
|
+
* The resource that owns the locations collection, if applicable.
|
282
|
+
* @param {string} request.filter
|
283
|
+
* The standard list filter.
|
284
|
+
* @param {number} request.pageSize
|
285
|
+
* The standard list page size.
|
286
|
+
* @param {string} request.pageToken
|
287
|
+
* The standard list page token.
|
288
|
+
* @param {object} [options]
|
289
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
290
|
+
* @returns {Object}
|
291
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
292
|
+
* When you iterate the returned iterable, each element will be an object representing
|
293
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
294
|
+
* so you can stop the iteration when you don't need more results.
|
295
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
296
|
+
* for more details and examples.
|
297
|
+
* @example
|
298
|
+
* ```
|
299
|
+
* const iterable = client.listLocationsAsync(request);
|
300
|
+
* for await (const response of iterable) {
|
301
|
+
* // process response
|
302
|
+
* }
|
303
|
+
* ```
|
304
|
+
*/
|
305
305
|
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
|
306
306
|
/**
|
307
307
|
* Return a fully-qualified engine resource name string.
|
@@ -96,28 +96,18 @@ class RecommendationServiceClient {
|
|
96
96
|
*/
|
97
97
|
constructor(opts, gaxInstance) {
|
98
98
|
// Ensure that options include all the required fields.
|
99
|
-
const staticMembers = this
|
100
|
-
|
101
|
-
if (opts?.universe_domain &&
|
102
|
-
opts?.universeDomain &&
|
103
|
-
opts?.universe_domain !== opts?.universeDomain) {
|
99
|
+
const staticMembers = this.constructor;
|
100
|
+
if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
|
104
101
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
105
102
|
}
|
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';
|
103
|
+
const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
|
104
|
+
this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
|
114
105
|
this._servicePath = 'discoveryengine.' + this._universeDomain;
|
115
106
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
116
107
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
117
108
|
const port = opts?.port || staticMembers.port;
|
118
109
|
const clientConfig = opts?.clientConfig ?? {};
|
119
|
-
const fallback = opts?.fallback ??
|
120
|
-
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
110
|
+
const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
121
111
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
122
112
|
// Request numeric enum values if REST transport is used.
|
123
113
|
opts.numericEnums = true;
|
@@ -147,7 +137,10 @@ class RecommendationServiceClient {
|
|
147
137
|
}
|
148
138
|
this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
|
149
139
|
// Determine the client header string.
|
150
|
-
const clientHeader = [
|
140
|
+
const clientHeader = [
|
141
|
+
`gax/${this._gaxModule.version}`,
|
142
|
+
`gapic/${version}`,
|
143
|
+
];
|
151
144
|
if (typeof process === 'object' && 'versions' in process) {
|
152
145
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
153
146
|
}
|
@@ -232,11 +225,10 @@ class RecommendationServiceClient {
|
|
232
225
|
}
|
233
226
|
// Put together the "service stub" for
|
234
227
|
// google.cloud.discoveryengine.v1.RecommendationService.
|
235
|
-
this.recommendationServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
.RecommendationService, this._opts, this._providedCustomServicePath);
|
228
|
+
this.recommendationServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
229
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1.RecommendationService') :
|
230
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
231
|
+
this._protos.google.cloud.discoveryengine.v1.RecommendationService, this._opts, this._providedCustomServicePath);
|
240
232
|
// Iterate over each of the methods that the service provides
|
241
233
|
// and create an API call method for each.
|
242
234
|
const recommendationServiceStubMethods = ['recommend'];
|
@@ -262,8 +254,7 @@ class RecommendationServiceClient {
|
|
262
254
|
* @returns {string} The DNS address for this service.
|
263
255
|
*/
|
264
256
|
static get servicePath() {
|
265
|
-
if (typeof process === 'object' &&
|
266
|
-
typeof process.emitWarning === 'function') {
|
257
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
267
258
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
268
259
|
}
|
269
260
|
return 'discoveryengine.googleapis.com';
|
@@ -274,8 +265,7 @@ class RecommendationServiceClient {
|
|
274
265
|
* @returns {string} The DNS address for this service.
|
275
266
|
*/
|
276
267
|
static get apiEndpoint() {
|
277
|
-
if (typeof process === 'object' &&
|
278
|
-
typeof process.emitWarning === 'function') {
|
268
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
279
269
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
280
270
|
}
|
281
271
|
return 'discoveryengine.googleapis.com';
|
@@ -303,7 +293,9 @@ class RecommendationServiceClient {
|
|
303
293
|
* @returns {string[]} List of default scopes.
|
304
294
|
*/
|
305
295
|
static get scopes() {
|
306
|
-
return [
|
296
|
+
return [
|
297
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
298
|
+
];
|
307
299
|
}
|
308
300
|
/**
|
309
301
|
* Return the project ID used by this class.
|
@@ -329,13 +321,10 @@ class RecommendationServiceClient {
|
|
329
321
|
options = options || {};
|
330
322
|
options.otherArgs = options.otherArgs || {};
|
331
323
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
332
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
333
|
-
|
334
|
-
serving_config: request.servingConfig ?? '',
|
335
|
-
});
|
336
|
-
this.initialize().catch(err => {
|
337
|
-
throw err;
|
324
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
325
|
+
'serving_config': request.servingConfig ?? '',
|
338
326
|
});
|
327
|
+
this.initialize().catch(err => { throw err; });
|
339
328
|
this._log.info('recommend request %j', request);
|
340
329
|
const wrappedCallback = callback
|
341
330
|
? (error, response, options, rawResponse) => {
|
@@ -343,65 +332,64 @@ class RecommendationServiceClient {
|
|
343
332
|
callback(error, response, options, rawResponse); // We verified callback above.
|
344
333
|
}
|
345
334
|
: undefined;
|
346
|
-
return this.innerApiCalls
|
347
|
-
.recommend(request, options, wrappedCallback)
|
335
|
+
return this.innerApiCalls.recommend(request, options, wrappedCallback)
|
348
336
|
?.then(([response, options, rawResponse]) => {
|
349
337
|
this._log.info('recommend response %j', response);
|
350
338
|
return [response, options, rawResponse];
|
351
339
|
});
|
352
340
|
}
|
353
341
|
/**
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
342
|
+
* Gets information about a location.
|
343
|
+
*
|
344
|
+
* @param {Object} request
|
345
|
+
* The request object that will be sent.
|
346
|
+
* @param {string} request.name
|
347
|
+
* Resource name for the location.
|
348
|
+
* @param {object} [options]
|
349
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
350
|
+
* @returns {Promise} - The promise which resolves to an array.
|
351
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
352
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
353
|
+
* for more details and examples.
|
354
|
+
* @example
|
355
|
+
* ```
|
356
|
+
* const [response] = await client.getLocation(request);
|
357
|
+
* ```
|
358
|
+
*/
|
371
359
|
getLocation(request, options, callback) {
|
372
360
|
return this.locationsClient.getLocation(request, options, callback);
|
373
361
|
}
|
374
362
|
/**
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
363
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
364
|
+
*
|
365
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
366
|
+
* @param {Object} request
|
367
|
+
* The request object that will be sent.
|
368
|
+
* @param {string} request.name
|
369
|
+
* The resource that owns the locations collection, if applicable.
|
370
|
+
* @param {string} request.filter
|
371
|
+
* The standard list filter.
|
372
|
+
* @param {number} request.pageSize
|
373
|
+
* The standard list page size.
|
374
|
+
* @param {string} request.pageToken
|
375
|
+
* The standard list page token.
|
376
|
+
* @param {object} [options]
|
377
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
378
|
+
* @returns {Object}
|
379
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
380
|
+
* When you iterate the returned iterable, each element will be an object representing
|
381
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
382
|
+
* so you can stop the iteration when you don't need more results.
|
383
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
384
|
+
* for more details and examples.
|
385
|
+
* @example
|
386
|
+
* ```
|
387
|
+
* const iterable = client.listLocationsAsync(request);
|
388
|
+
* for await (const response of iterable) {
|
389
|
+
* // process response
|
390
|
+
* }
|
391
|
+
* ```
|
392
|
+
*/
|
405
393
|
listLocationsAsync(request, options) {
|
406
394
|
return this.locationsClient.listLocationsAsync(request, options);
|
407
395
|
}
|
@@ -2643,7 +2631,7 @@ class RecommendationServiceClient {
|
|
2643
2631
|
this._log.info('ending gRPC channel');
|
2644
2632
|
this._terminated = true;
|
2645
2633
|
stub.close();
|
2646
|
-
this.locationsClient.close();
|
2634
|
+
this.locationsClient.close().catch(err => { throw err; });
|
2647
2635
|
});
|
2648
2636
|
}
|
2649
2637
|
return Promise.resolve();
|