@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
@@ -98,26 +98,17 @@ class SearchTuningServiceClient {
|
|
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 SearchTuningServiceClient {
|
|
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
|
}
|
@@ -209,125 +203,26 @@ class SearchTuningServiceClient {
|
|
209
203
|
sampleQueryPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}'),
|
210
204
|
sampleQuerySetPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}'),
|
211
205
|
};
|
212
|
-
const protoFilesRoot = this._gaxModule.
|
206
|
+
const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
|
213
207
|
// This API contains "long-running operations", which return a
|
214
208
|
// an Operation object that allows for tracking of the operation,
|
215
209
|
// rather than holding a request open.
|
216
210
|
const lroOptions = {
|
217
211
|
auth: this.auth,
|
218
|
-
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
|
212
|
+
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
|
219
213
|
};
|
220
214
|
if (opts.fallback) {
|
221
215
|
lroOptions.protoJson = protoFilesRoot;
|
222
|
-
lroOptions.httpRules = [
|
223
|
-
{
|
224
|
-
|
225
|
-
|
226
|
-
body: '*',
|
227
|
-
additional_bindings: [
|
228
|
-
{
|
229
|
-
post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
|
230
|
-
body: '*',
|
231
|
-
},
|
232
|
-
],
|
233
|
-
},
|
234
|
-
{
|
235
|
-
selector: 'google.longrunning.Operations.GetOperation',
|
236
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
|
237
|
-
additional_bindings: [
|
238
|
-
{
|
239
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
|
240
|
-
},
|
241
|
-
{
|
242
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
|
243
|
-
},
|
244
|
-
{
|
245
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
|
246
|
-
},
|
247
|
-
{
|
248
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
|
249
|
-
},
|
250
|
-
{
|
251
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
|
252
|
-
},
|
253
|
-
{
|
254
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
|
255
|
-
},
|
256
|
-
{
|
257
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
|
258
|
-
},
|
259
|
-
{
|
260
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}',
|
261
|
-
},
|
262
|
-
{
|
263
|
-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
|
264
|
-
},
|
265
|
-
{
|
266
|
-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
|
267
|
-
},
|
268
|
-
{
|
269
|
-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}',
|
270
|
-
},
|
271
|
-
{
|
272
|
-
get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}',
|
273
|
-
},
|
274
|
-
{ get: '/v1beta/{name=projects/*/locations/*/operations/*}' },
|
275
|
-
{
|
276
|
-
get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
|
277
|
-
},
|
278
|
-
{ get: '/v1beta/{name=projects/*/operations/*}' },
|
279
|
-
],
|
280
|
-
},
|
281
|
-
{
|
282
|
-
selector: 'google.longrunning.Operations.ListOperations',
|
283
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
|
284
|
-
additional_bindings: [
|
285
|
-
{
|
286
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
|
287
|
-
},
|
288
|
-
{
|
289
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
|
290
|
-
},
|
291
|
-
{
|
292
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
|
293
|
-
},
|
294
|
-
{
|
295
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
|
296
|
-
},
|
297
|
-
{
|
298
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
|
299
|
-
},
|
300
|
-
{
|
301
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
|
302
|
-
},
|
303
|
-
{
|
304
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations',
|
305
|
-
},
|
306
|
-
{
|
307
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations',
|
308
|
-
},
|
309
|
-
{
|
310
|
-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
|
311
|
-
},
|
312
|
-
{
|
313
|
-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
|
314
|
-
},
|
315
|
-
{
|
316
|
-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations',
|
317
|
-
},
|
318
|
-
{ get: '/v1beta/{name=projects/*/locations/*}/operations' },
|
319
|
-
{ get: '/v1beta/{name=projects/*}/operations' },
|
320
|
-
],
|
321
|
-
},
|
322
|
-
];
|
216
|
+
lroOptions.httpRules = [{ selector: 'google.longrunning.Operations.CancelOperation', post: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', additional_bindings: [{ post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }],
|
217
|
+
}, { selector: 'google.longrunning.Operations.GetOperation', get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', additional_bindings: [{ get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/operations/*}', }, { get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}', }, { get: '/v1beta/{name=projects/*/operations/*}', }],
|
218
|
+
}, { selector: 'google.longrunning.Operations.ListOperations', get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations', additional_bindings: [{ get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations', }, { get: '/v1beta/{name=projects/*/locations/*}/operations', }, { get: '/v1beta/{name=projects/*}/operations', }],
|
219
|
+
}];
|
323
220
|
}
|
324
|
-
this.operationsClient = this._gaxModule
|
325
|
-
.lro(lroOptions)
|
326
|
-
.operationsClient(opts);
|
221
|
+
this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
|
327
222
|
const trainCustomModelResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.TrainCustomModelResponse');
|
328
223
|
const trainCustomModelMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.TrainCustomModelMetadata');
|
329
224
|
this.descriptors.longrunning = {
|
330
|
-
trainCustomModel: new this._gaxModule.LongrunningDescriptor(this.operationsClient, trainCustomModelResponse.decode.bind(trainCustomModelResponse), trainCustomModelMetadata.decode.bind(trainCustomModelMetadata))
|
225
|
+
trainCustomModel: new this._gaxModule.LongrunningDescriptor(this.operationsClient, trainCustomModelResponse.decode.bind(trainCustomModelResponse), trainCustomModelMetadata.decode.bind(trainCustomModelMetadata))
|
331
226
|
};
|
332
227
|
// Put together the default options sent with requests.
|
333
228
|
this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.SearchTuningService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
@@ -356,17 +251,13 @@ class SearchTuningServiceClient {
|
|
356
251
|
}
|
357
252
|
// Put together the "service stub" for
|
358
253
|
// google.cloud.discoveryengine.v1beta.SearchTuningService.
|
359
|
-
this.searchTuningServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
.SearchTuningService, this._opts, this._providedCustomServicePath);
|
254
|
+
this.searchTuningServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
255
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1beta.SearchTuningService') :
|
256
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
257
|
+
this._protos.google.cloud.discoveryengine.v1beta.SearchTuningService, this._opts, this._providedCustomServicePath);
|
364
258
|
// Iterate over each of the methods that the service provides
|
365
259
|
// and create an API call method for each.
|
366
|
-
const searchTuningServiceStubMethods = [
|
367
|
-
'trainCustomModel',
|
368
|
-
'listCustomModels',
|
369
|
-
];
|
260
|
+
const searchTuningServiceStubMethods = ['trainCustomModel', 'listCustomModels'];
|
370
261
|
for (const methodName of searchTuningServiceStubMethods) {
|
371
262
|
const callPromise = this.searchTuningServiceStub.then(stub => (...args) => {
|
372
263
|
if (this._terminated) {
|
@@ -377,7 +268,8 @@ class SearchTuningServiceClient {
|
|
377
268
|
}, (err) => () => {
|
378
269
|
throw err;
|
379
270
|
});
|
380
|
-
const descriptor = this.descriptors.longrunning[methodName] ||
|
271
|
+
const descriptor = this.descriptors.longrunning[methodName] ||
|
272
|
+
undefined;
|
381
273
|
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
|
382
274
|
this.innerApiCalls[methodName] = apiCall;
|
383
275
|
}
|
@@ -389,8 +281,7 @@ class SearchTuningServiceClient {
|
|
389
281
|
* @returns {string} The DNS address for this service.
|
390
282
|
*/
|
391
283
|
static get servicePath() {
|
392
|
-
if (typeof process === 'object' &&
|
393
|
-
typeof process.emitWarning === 'function') {
|
284
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
394
285
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
395
286
|
}
|
396
287
|
return 'discoveryengine.googleapis.com';
|
@@ -401,8 +292,7 @@ class SearchTuningServiceClient {
|
|
401
292
|
* @returns {string} The DNS address for this service.
|
402
293
|
*/
|
403
294
|
static get apiEndpoint() {
|
404
|
-
if (typeof process === 'object' &&
|
405
|
-
typeof process.emitWarning === 'function') {
|
295
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
406
296
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
407
297
|
}
|
408
298
|
return 'discoveryengine.googleapis.com';
|
@@ -430,7 +320,9 @@ class SearchTuningServiceClient {
|
|
430
320
|
* @returns {string[]} List of default scopes.
|
431
321
|
*/
|
432
322
|
static get scopes() {
|
433
|
-
return [
|
323
|
+
return [
|
324
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
325
|
+
];
|
434
326
|
}
|
435
327
|
/**
|
436
328
|
* Return the project ID used by this class.
|
@@ -456,13 +348,10 @@ class SearchTuningServiceClient {
|
|
456
348
|
options = options || {};
|
457
349
|
options.otherArgs = options.otherArgs || {};
|
458
350
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
459
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
460
|
-
|
461
|
-
data_store: request.dataStore ?? '',
|
462
|
-
});
|
463
|
-
this.initialize().catch(err => {
|
464
|
-
throw err;
|
351
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
352
|
+
'data_store': request.dataStore ?? '',
|
465
353
|
});
|
354
|
+
this.initialize().catch(err => { throw err; });
|
466
355
|
this._log.info('listCustomModels request %j', request);
|
467
356
|
const wrappedCallback = callback
|
468
357
|
? (error, response, options, rawResponse) => {
|
@@ -470,11 +359,16 @@ class SearchTuningServiceClient {
|
|
470
359
|
callback(error, response, options, rawResponse); // We verified callback above.
|
471
360
|
}
|
472
361
|
: undefined;
|
473
|
-
return this.innerApiCalls
|
474
|
-
.listCustomModels(request, options, wrappedCallback)
|
362
|
+
return this.innerApiCalls.listCustomModels(request, options, wrappedCallback)
|
475
363
|
?.then(([response, options, rawResponse]) => {
|
476
364
|
this._log.info('listCustomModels response %j', response);
|
477
365
|
return [response, options, rawResponse];
|
366
|
+
}).catch((error) => {
|
367
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
368
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
369
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
370
|
+
}
|
371
|
+
throw error;
|
478
372
|
});
|
479
373
|
}
|
480
374
|
trainCustomModel(request, optionsOrCallback, callback) {
|
@@ -490,13 +384,10 @@ class SearchTuningServiceClient {
|
|
490
384
|
options = options || {};
|
491
385
|
options.otherArgs = options.otherArgs || {};
|
492
386
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
493
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
494
|
-
|
495
|
-
data_store: request.dataStore ?? '',
|
496
|
-
});
|
497
|
-
this.initialize().catch(err => {
|
498
|
-
throw err;
|
387
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
388
|
+
'data_store': request.dataStore ?? '',
|
499
389
|
});
|
390
|
+
this.initialize().catch(err => { throw err; });
|
500
391
|
const wrappedCallback = callback
|
501
392
|
? (error, response, rawResponse, _) => {
|
502
393
|
this._log.info('trainCustomModel response %j', rawResponse);
|
@@ -504,8 +395,7 @@ class SearchTuningServiceClient {
|
|
504
395
|
}
|
505
396
|
: undefined;
|
506
397
|
this._log.info('trainCustomModel request %j', request);
|
507
|
-
return this.innerApiCalls
|
508
|
-
.trainCustomModel(request, options, wrappedCallback)
|
398
|
+
return this.innerApiCalls.trainCustomModel(request, options, wrappedCallback)
|
509
399
|
?.then(([response, rawResponse, _]) => {
|
510
400
|
this._log.info('trainCustomModel response %j', rawResponse);
|
511
401
|
return [response, rawResponse, _];
|
@@ -530,90 +420,90 @@ class SearchTuningServiceClient {
|
|
530
420
|
return decodeOperation;
|
531
421
|
}
|
532
422
|
/**
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
423
|
+
* Gets information about a location.
|
424
|
+
*
|
425
|
+
* @param {Object} request
|
426
|
+
* The request object that will be sent.
|
427
|
+
* @param {string} request.name
|
428
|
+
* Resource name for the location.
|
429
|
+
* @param {object} [options]
|
430
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
431
|
+
* @returns {Promise} - The promise which resolves to an array.
|
432
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
433
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
434
|
+
* for more details and examples.
|
435
|
+
* @example
|
436
|
+
* ```
|
437
|
+
* const [response] = await client.getLocation(request);
|
438
|
+
* ```
|
439
|
+
*/
|
550
440
|
getLocation(request, options, callback) {
|
551
441
|
return this.locationsClient.getLocation(request, options, callback);
|
552
442
|
}
|
553
443
|
/**
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
444
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
445
|
+
*
|
446
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
447
|
+
* @param {Object} request
|
448
|
+
* The request object that will be sent.
|
449
|
+
* @param {string} request.name
|
450
|
+
* The resource that owns the locations collection, if applicable.
|
451
|
+
* @param {string} request.filter
|
452
|
+
* The standard list filter.
|
453
|
+
* @param {number} request.pageSize
|
454
|
+
* The standard list page size.
|
455
|
+
* @param {string} request.pageToken
|
456
|
+
* The standard list page token.
|
457
|
+
* @param {object} [options]
|
458
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
459
|
+
* @returns {Object}
|
460
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
461
|
+
* When you iterate the returned iterable, each element will be an object representing
|
462
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
463
|
+
* so you can stop the iteration when you don't need more results.
|
464
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
465
|
+
* for more details and examples.
|
466
|
+
* @example
|
467
|
+
* ```
|
468
|
+
* const iterable = client.listLocationsAsync(request);
|
469
|
+
* for await (const response of iterable) {
|
470
|
+
* // process response
|
471
|
+
* }
|
472
|
+
* ```
|
473
|
+
*/
|
584
474
|
listLocationsAsync(request, options) {
|
585
475
|
return this.locationsClient.listLocationsAsync(request, options);
|
586
476
|
}
|
587
477
|
/**
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
478
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
479
|
+
* method to poll the operation result at intervals as recommended by the API
|
480
|
+
* service.
|
481
|
+
*
|
482
|
+
* @param {Object} request - The request object that will be sent.
|
483
|
+
* @param {string} request.name - The name of the operation resource.
|
484
|
+
* @param {Object=} options
|
485
|
+
* Optional parameters. You can override the default settings for this call,
|
486
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
487
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
488
|
+
* for the details.
|
489
|
+
* @param {function(?Error, ?Object)=} callback
|
490
|
+
* The function which will be called with the result of the API call.
|
491
|
+
*
|
492
|
+
* The second parameter to the callback is an object representing
|
493
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
494
|
+
* @return {Promise} - The promise which resolves to an array.
|
495
|
+
* The first element of the array is an object representing
|
496
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
497
|
+
* The promise has a method named "cancel" which cancels the ongoing API call.
|
498
|
+
*
|
499
|
+
* @example
|
500
|
+
* ```
|
501
|
+
* const client = longrunning.operationsClient();
|
502
|
+
* const name = '';
|
503
|
+
* const [response] = await client.getOperation({name});
|
504
|
+
* // doThingsWith(response)
|
505
|
+
* ```
|
506
|
+
*/
|
617
507
|
getOperation(request, optionsOrCallback, callback) {
|
618
508
|
let options;
|
619
509
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
@@ -847,8 +737,7 @@ class SearchTuningServiceClient {
|
|
847
737
|
* @returns {string} A string representing the project.
|
848
738
|
*/
|
849
739
|
matchProjectFromEvaluationName(evaluationName) {
|
850
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
851
|
-
.project;
|
740
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
|
852
741
|
}
|
853
742
|
/**
|
854
743
|
* Parse the location from Evaluation resource.
|
@@ -858,8 +747,7 @@ class SearchTuningServiceClient {
|
|
858
747
|
* @returns {string} A string representing the location.
|
859
748
|
*/
|
860
749
|
matchLocationFromEvaluationName(evaluationName) {
|
861
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
862
|
-
.location;
|
750
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
|
863
751
|
}
|
864
752
|
/**
|
865
753
|
* Parse the evaluation from Evaluation resource.
|
@@ -869,8 +757,7 @@ class SearchTuningServiceClient {
|
|
869
757
|
* @returns {string} A string representing the evaluation.
|
870
758
|
*/
|
871
759
|
matchEvaluationFromEvaluationName(evaluationName) {
|
872
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
873
|
-
.evaluation;
|
760
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
|
874
761
|
}
|
875
762
|
/**
|
876
763
|
* Return a fully-qualified groundingConfig resource name string.
|
@@ -3108,8 +2995,7 @@ class SearchTuningServiceClient {
|
|
3108
2995
|
* @returns {string} A string representing the project.
|
3109
2996
|
*/
|
3110
2997
|
matchProjectFromSampleQueryName(sampleQueryName) {
|
3111
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3112
|
-
.project;
|
2998
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
|
3113
2999
|
}
|
3114
3000
|
/**
|
3115
3001
|
* Parse the location from SampleQuery resource.
|
@@ -3119,8 +3005,7 @@ class SearchTuningServiceClient {
|
|
3119
3005
|
* @returns {string} A string representing the location.
|
3120
3006
|
*/
|
3121
3007
|
matchLocationFromSampleQueryName(sampleQueryName) {
|
3122
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3123
|
-
.location;
|
3008
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
|
3124
3009
|
}
|
3125
3010
|
/**
|
3126
3011
|
* Parse the sample_query_set from SampleQuery resource.
|
@@ -3130,8 +3015,7 @@ class SearchTuningServiceClient {
|
|
3130
3015
|
* @returns {string} A string representing the sample_query_set.
|
3131
3016
|
*/
|
3132
3017
|
matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
|
3133
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3134
|
-
.sample_query_set;
|
3018
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
|
3135
3019
|
}
|
3136
3020
|
/**
|
3137
3021
|
* Parse the sample_query from SampleQuery resource.
|
@@ -3141,8 +3025,7 @@ class SearchTuningServiceClient {
|
|
3141
3025
|
* @returns {string} A string representing the sample_query.
|
3142
3026
|
*/
|
3143
3027
|
matchSampleQueryFromSampleQueryName(sampleQueryName) {
|
3144
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3145
|
-
.sample_query;
|
3028
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
|
3146
3029
|
}
|
3147
3030
|
/**
|
3148
3031
|
* Return a fully-qualified sampleQuerySet resource name string.
|
@@ -3201,8 +3084,8 @@ class SearchTuningServiceClient {
|
|
3201
3084
|
this._log.info('ending gRPC channel');
|
3202
3085
|
this._terminated = true;
|
3203
3086
|
stub.close();
|
3204
|
-
this.locationsClient.close();
|
3205
|
-
this.operationsClient.close();
|
3087
|
+
this.locationsClient.close().catch(err => { throw err; });
|
3088
|
+
void this.operationsClient.close();
|
3206
3089
|
});
|
3207
3090
|
}
|
3208
3091
|
return Promise.resolve();
|