@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
@@ -99,26 +99,17 @@ class DataStoreServiceClient {
|
|
99
99
|
constructor(opts, gaxInstance) {
|
100
100
|
// Ensure that options include all the required fields.
|
101
101
|
const staticMembers = this.constructor;
|
102
|
-
if (opts?.universe_domain &&
|
103
|
-
opts?.universeDomain &&
|
104
|
-
opts?.universe_domain !== opts?.universeDomain) {
|
102
|
+
if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
|
105
103
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
106
104
|
}
|
107
|
-
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
108
|
-
|
109
|
-
: undefined;
|
110
|
-
this._universeDomain =
|
111
|
-
opts?.universeDomain ??
|
112
|
-
opts?.universe_domain ??
|
113
|
-
universeDomainEnvVar ??
|
114
|
-
'googleapis.com';
|
105
|
+
const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
|
106
|
+
this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
|
115
107
|
this._servicePath = 'discoveryengine.' + this._universeDomain;
|
116
108
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
117
109
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
118
110
|
const port = opts?.port || staticMembers.port;
|
119
111
|
const clientConfig = opts?.clientConfig ?? {};
|
120
|
-
const fallback = opts?.fallback ??
|
121
|
-
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
112
|
+
const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
122
113
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
123
114
|
// Request numeric enum values if REST transport is used.
|
124
115
|
opts.numericEnums = true;
|
@@ -148,7 +139,10 @@ class DataStoreServiceClient {
|
|
148
139
|
}
|
149
140
|
this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
|
150
141
|
// Determine the client header string.
|
151
|
-
const clientHeader = [
|
142
|
+
const clientHeader = [
|
143
|
+
`gax/${this._gaxModule.version}`,
|
144
|
+
`gapic/${version}`,
|
145
|
+
];
|
152
146
|
if (typeof process === 'object' && 'versions' in process) {
|
153
147
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
154
148
|
}
|
@@ -211,7 +205,7 @@ class DataStoreServiceClient {
|
|
211
205
|
// (e.g. 50 results at a time, with tokens to get subsequent
|
212
206
|
// pages). Denote the keys used for pagination and results.
|
213
207
|
this.descriptors.page = {
|
214
|
-
listDataStores: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataStores')
|
208
|
+
listDataStores: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataStores')
|
215
209
|
};
|
216
210
|
const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
217
211
|
// This API contains "long-running operations", which return a
|
@@ -219,128 +213,23 @@ class DataStoreServiceClient {
|
|
219
213
|
// rather than holding a request open.
|
220
214
|
const lroOptions = {
|
221
215
|
auth: this.auth,
|
222
|
-
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
|
216
|
+
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
|
223
217
|
};
|
224
218
|
if (opts.fallback) {
|
225
219
|
lroOptions.protoJson = protoFilesRoot;
|
226
|
-
lroOptions.httpRules = [
|
227
|
-
{
|
228
|
-
|
229
|
-
|
230
|
-
body: '*',
|
231
|
-
additional_bindings: [
|
232
|
-
{
|
233
|
-
post: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
|
234
|
-
body: '*',
|
235
|
-
},
|
236
|
-
{
|
237
|
-
post: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
|
238
|
-
body: '*',
|
239
|
-
},
|
240
|
-
],
|
241
|
-
},
|
242
|
-
{
|
243
|
-
selector: 'google.longrunning.Operations.GetOperation',
|
244
|
-
get: '/v1/{name=projects/*/operations/*}',
|
245
|
-
additional_bindings: [
|
246
|
-
{
|
247
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
|
248
|
-
},
|
249
|
-
{
|
250
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
|
251
|
-
},
|
252
|
-
{
|
253
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
|
254
|
-
},
|
255
|
-
{
|
256
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
|
257
|
-
},
|
258
|
-
{
|
259
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
|
260
|
-
},
|
261
|
-
{
|
262
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
|
263
|
-
},
|
264
|
-
{
|
265
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
|
266
|
-
},
|
267
|
-
{
|
268
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
|
269
|
-
},
|
270
|
-
{
|
271
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}',
|
272
|
-
},
|
273
|
-
{
|
274
|
-
get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
|
275
|
-
},
|
276
|
-
{
|
277
|
-
get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
|
278
|
-
},
|
279
|
-
{
|
280
|
-
get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}',
|
281
|
-
},
|
282
|
-
{
|
283
|
-
get: '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}',
|
284
|
-
},
|
285
|
-
{ get: '/v1/{name=projects/*/locations/*/operations/*}' },
|
286
|
-
{ get: '/v1/{name=projects/*/operations/*}' },
|
287
|
-
],
|
288
|
-
},
|
289
|
-
{
|
290
|
-
selector: 'google.longrunning.Operations.ListOperations',
|
291
|
-
get: '/v1/{name=projects/*}/operations',
|
292
|
-
additional_bindings: [
|
293
|
-
{
|
294
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
|
295
|
-
},
|
296
|
-
{
|
297
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
|
298
|
-
},
|
299
|
-
{
|
300
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
|
301
|
-
},
|
302
|
-
{
|
303
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
|
304
|
-
},
|
305
|
-
{
|
306
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
|
307
|
-
},
|
308
|
-
{
|
309
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
|
310
|
-
},
|
311
|
-
{
|
312
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
|
313
|
-
},
|
314
|
-
{
|
315
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations',
|
316
|
-
},
|
317
|
-
{ get: '/v1/{name=projects/*/locations/*/collections/*}/operations' },
|
318
|
-
{
|
319
|
-
get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
|
320
|
-
},
|
321
|
-
{
|
322
|
-
get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
|
323
|
-
},
|
324
|
-
{ get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations' },
|
325
|
-
{
|
326
|
-
get: '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations',
|
327
|
-
},
|
328
|
-
{ get: '/v1/{name=projects/*/locations/*}/operations' },
|
329
|
-
{ get: '/v1/{name=projects/*}/operations' },
|
330
|
-
],
|
331
|
-
},
|
332
|
-
];
|
220
|
+
lroOptions.httpRules = [{ selector: 'google.longrunning.Operations.CancelOperation', post: '/v1/{name=projects/*/operations/*}:cancel', body: '*', additional_bindings: [{ post: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }, { post: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }],
|
221
|
+
}, { selector: 'google.longrunning.Operations.GetOperation', get: '/v1/{name=projects/*/operations/*}', additional_bindings: [{ get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/operations/*}', }, { get: '/v1/{name=projects/*/operations/*}', }],
|
222
|
+
}, { selector: 'google.longrunning.Operations.ListOperations', get: '/v1/{name=projects/*}/operations', additional_bindings: [{ get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', }, { get: '/v1/{name=projects/*/locations/*}/operations', }, { get: '/v1/{name=projects/*}/operations', }],
|
223
|
+
}];
|
333
224
|
}
|
334
|
-
this.operationsClient = this._gaxModule
|
335
|
-
.lro(lroOptions)
|
336
|
-
.operationsClient(opts);
|
225
|
+
this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
|
337
226
|
const createDataStoreResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.DataStore');
|
338
227
|
const createDataStoreMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.CreateDataStoreMetadata');
|
339
228
|
const deleteDataStoreResponse = protoFilesRoot.lookup('.google.protobuf.Empty');
|
340
229
|
const deleteDataStoreMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.DeleteDataStoreMetadata');
|
341
230
|
this.descriptors.longrunning = {
|
342
231
|
createDataStore: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createDataStoreResponse.decode.bind(createDataStoreResponse), createDataStoreMetadata.decode.bind(createDataStoreMetadata)),
|
343
|
-
deleteDataStore: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteDataStoreResponse.decode.bind(deleteDataStoreResponse), deleteDataStoreMetadata.decode.bind(deleteDataStoreMetadata))
|
232
|
+
deleteDataStore: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteDataStoreResponse.decode.bind(deleteDataStoreResponse), deleteDataStoreMetadata.decode.bind(deleteDataStoreMetadata))
|
344
233
|
};
|
345
234
|
// Put together the default options sent with requests.
|
346
235
|
this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.DataStoreService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
@@ -369,20 +258,13 @@ class DataStoreServiceClient {
|
|
369
258
|
}
|
370
259
|
// Put together the "service stub" for
|
371
260
|
// google.cloud.discoveryengine.v1.DataStoreService.
|
372
|
-
this.dataStoreServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
.DataStoreService, this._opts, this._providedCustomServicePath);
|
261
|
+
this.dataStoreServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
262
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1.DataStoreService') :
|
263
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
264
|
+
this._protos.google.cloud.discoveryengine.v1.DataStoreService, this._opts, this._providedCustomServicePath);
|
377
265
|
// Iterate over each of the methods that the service provides
|
378
266
|
// and create an API call method for each.
|
379
|
-
const dataStoreServiceStubMethods = [
|
380
|
-
'createDataStore',
|
381
|
-
'getDataStore',
|
382
|
-
'listDataStores',
|
383
|
-
'deleteDataStore',
|
384
|
-
'updateDataStore',
|
385
|
-
];
|
267
|
+
const dataStoreServiceStubMethods = ['createDataStore', 'getDataStore', 'listDataStores', 'deleteDataStore', 'updateDataStore'];
|
386
268
|
for (const methodName of dataStoreServiceStubMethods) {
|
387
269
|
const callPromise = this.dataStoreServiceStub.then(stub => (...args) => {
|
388
270
|
if (this._terminated) {
|
@@ -407,8 +289,7 @@ class DataStoreServiceClient {
|
|
407
289
|
* @returns {string} The DNS address for this service.
|
408
290
|
*/
|
409
291
|
static get servicePath() {
|
410
|
-
if (typeof process === 'object' &&
|
411
|
-
typeof process.emitWarning === 'function') {
|
292
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
412
293
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
413
294
|
}
|
414
295
|
return 'discoveryengine.googleapis.com';
|
@@ -419,8 +300,7 @@ class DataStoreServiceClient {
|
|
419
300
|
* @returns {string} The DNS address for this service.
|
420
301
|
*/
|
421
302
|
static get apiEndpoint() {
|
422
|
-
if (typeof process === 'object' &&
|
423
|
-
typeof process.emitWarning === 'function') {
|
303
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
424
304
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
425
305
|
}
|
426
306
|
return 'discoveryengine.googleapis.com';
|
@@ -448,7 +328,9 @@ class DataStoreServiceClient {
|
|
448
328
|
* @returns {string[]} List of default scopes.
|
449
329
|
*/
|
450
330
|
static get scopes() {
|
451
|
-
return [
|
331
|
+
return [
|
332
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
333
|
+
];
|
452
334
|
}
|
453
335
|
/**
|
454
336
|
* Return the project ID used by this class.
|
@@ -474,13 +356,10 @@ class DataStoreServiceClient {
|
|
474
356
|
options = options || {};
|
475
357
|
options.otherArgs = options.otherArgs || {};
|
476
358
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
477
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
478
|
-
|
479
|
-
name: request.name ?? '',
|
480
|
-
});
|
481
|
-
this.initialize().catch(err => {
|
482
|
-
throw err;
|
359
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
360
|
+
'name': request.name ?? '',
|
483
361
|
});
|
362
|
+
this.initialize().catch(err => { throw err; });
|
484
363
|
this._log.info('getDataStore request %j', request);
|
485
364
|
const wrappedCallback = callback
|
486
365
|
? (error, response, options, rawResponse) => {
|
@@ -488,8 +367,7 @@ class DataStoreServiceClient {
|
|
488
367
|
callback(error, response, options, rawResponse); // We verified callback above.
|
489
368
|
}
|
490
369
|
: undefined;
|
491
|
-
return this.innerApiCalls
|
492
|
-
.getDataStore(request, options, wrappedCallback)
|
370
|
+
return this.innerApiCalls.getDataStore(request, options, wrappedCallback)
|
493
371
|
?.then(([response, options, rawResponse]) => {
|
494
372
|
this._log.info('getDataStore response %j', response);
|
495
373
|
return [response, options, rawResponse];
|
@@ -508,13 +386,10 @@ class DataStoreServiceClient {
|
|
508
386
|
options = options || {};
|
509
387
|
options.otherArgs = options.otherArgs || {};
|
510
388
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
511
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
512
|
-
|
513
|
-
'data_store.name': request.dataStore.name ?? '',
|
514
|
-
});
|
515
|
-
this.initialize().catch(err => {
|
516
|
-
throw err;
|
389
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
390
|
+
'data_store.name': request.dataStore.name ?? '',
|
517
391
|
});
|
392
|
+
this.initialize().catch(err => { throw err; });
|
518
393
|
this._log.info('updateDataStore request %j', request);
|
519
394
|
const wrappedCallback = callback
|
520
395
|
? (error, response, options, rawResponse) => {
|
@@ -522,8 +397,7 @@ class DataStoreServiceClient {
|
|
522
397
|
callback(error, response, options, rawResponse); // We verified callback above.
|
523
398
|
}
|
524
399
|
: undefined;
|
525
|
-
return this.innerApiCalls
|
526
|
-
.updateDataStore(request, options, wrappedCallback)
|
400
|
+
return this.innerApiCalls.updateDataStore(request, options, wrappedCallback)
|
527
401
|
?.then(([response, options, rawResponse]) => {
|
528
402
|
this._log.info('updateDataStore response %j', response);
|
529
403
|
return [response, options, rawResponse];
|
@@ -542,13 +416,10 @@ class DataStoreServiceClient {
|
|
542
416
|
options = options || {};
|
543
417
|
options.otherArgs = options.otherArgs || {};
|
544
418
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
545
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
546
|
-
|
547
|
-
parent: request.parent ?? '',
|
548
|
-
});
|
549
|
-
this.initialize().catch(err => {
|
550
|
-
throw err;
|
419
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
420
|
+
'parent': request.parent ?? '',
|
551
421
|
});
|
422
|
+
this.initialize().catch(err => { throw err; });
|
552
423
|
const wrappedCallback = callback
|
553
424
|
? (error, response, rawResponse, _) => {
|
554
425
|
this._log.info('createDataStore response %j', rawResponse);
|
@@ -556,8 +427,7 @@ class DataStoreServiceClient {
|
|
556
427
|
}
|
557
428
|
: undefined;
|
558
429
|
this._log.info('createDataStore request %j', request);
|
559
|
-
return this.innerApiCalls
|
560
|
-
.createDataStore(request, options, wrappedCallback)
|
430
|
+
return this.innerApiCalls.createDataStore(request, options, wrappedCallback)
|
561
431
|
?.then(([response, rawResponse, _]) => {
|
562
432
|
this._log.info('createDataStore response %j', rawResponse);
|
563
433
|
return [response, rawResponse, _];
|
@@ -594,13 +464,10 @@ class DataStoreServiceClient {
|
|
594
464
|
options = options || {};
|
595
465
|
options.otherArgs = options.otherArgs || {};
|
596
466
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
597
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
598
|
-
|
599
|
-
name: request.name ?? '',
|
600
|
-
});
|
601
|
-
this.initialize().catch(err => {
|
602
|
-
throw err;
|
467
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
468
|
+
'name': request.name ?? '',
|
603
469
|
});
|
470
|
+
this.initialize().catch(err => { throw err; });
|
604
471
|
const wrappedCallback = callback
|
605
472
|
? (error, response, rawResponse, _) => {
|
606
473
|
this._log.info('deleteDataStore response %j', rawResponse);
|
@@ -608,8 +475,7 @@ class DataStoreServiceClient {
|
|
608
475
|
}
|
609
476
|
: undefined;
|
610
477
|
this._log.info('deleteDataStore request %j', request);
|
611
|
-
return this.innerApiCalls
|
612
|
-
.deleteDataStore(request, options, wrappedCallback)
|
478
|
+
return this.innerApiCalls.deleteDataStore(request, options, wrappedCallback)
|
613
479
|
?.then(([response, rawResponse, _]) => {
|
614
480
|
this._log.info('deleteDataStore response %j', rawResponse);
|
615
481
|
return [response, rawResponse, _];
|
@@ -646,13 +512,10 @@ class DataStoreServiceClient {
|
|
646
512
|
options = options || {};
|
647
513
|
options.otherArgs = options.otherArgs || {};
|
648
514
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
649
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
650
|
-
|
651
|
-
parent: request.parent ?? '',
|
652
|
-
});
|
653
|
-
this.initialize().catch(err => {
|
654
|
-
throw err;
|
515
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
516
|
+
'parent': request.parent ?? '',
|
655
517
|
});
|
518
|
+
this.initialize().catch(err => { throw err; });
|
656
519
|
const wrappedCallback = callback
|
657
520
|
? (error, values, nextPageRequest, rawResponse) => {
|
658
521
|
this._log.info('listDataStores values %j', values);
|
@@ -715,15 +578,12 @@ class DataStoreServiceClient {
|
|
715
578
|
options = options || {};
|
716
579
|
options.otherArgs = options.otherArgs || {};
|
717
580
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
718
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
719
|
-
|
720
|
-
|
721
|
-
});
|
581
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
582
|
+
'parent': request.parent ?? '',
|
583
|
+
});
|
722
584
|
const defaultCallSettings = this._defaults['listDataStores'];
|
723
585
|
const callSettings = defaultCallSettings.merge(options);
|
724
|
-
this.initialize().catch(err => {
|
725
|
-
throw err;
|
726
|
-
});
|
586
|
+
this.initialize().catch(err => { throw err; });
|
727
587
|
this._log.info('listDataStores stream %j', request);
|
728
588
|
return this.descriptors.page.listDataStores.createStream(this.innerApiCalls.listDataStores, request, callSettings);
|
729
589
|
}
|
@@ -778,103 +638,100 @@ class DataStoreServiceClient {
|
|
778
638
|
options = options || {};
|
779
639
|
options.otherArgs = options.otherArgs || {};
|
780
640
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
781
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
782
|
-
|
783
|
-
|
784
|
-
});
|
641
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
642
|
+
'parent': request.parent ?? '',
|
643
|
+
});
|
785
644
|
const defaultCallSettings = this._defaults['listDataStores'];
|
786
645
|
const callSettings = defaultCallSettings.merge(options);
|
787
|
-
this.initialize().catch(err => {
|
788
|
-
throw err;
|
789
|
-
});
|
646
|
+
this.initialize().catch(err => { throw err; });
|
790
647
|
this._log.info('listDataStores iterate %j', request);
|
791
648
|
return this.descriptors.page.listDataStores.asyncIterate(this.innerApiCalls['listDataStores'], request, callSettings);
|
792
649
|
}
|
793
650
|
/**
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
651
|
+
* Gets information about a location.
|
652
|
+
*
|
653
|
+
* @param {Object} request
|
654
|
+
* The request object that will be sent.
|
655
|
+
* @param {string} request.name
|
656
|
+
* Resource name for the location.
|
657
|
+
* @param {object} [options]
|
658
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
659
|
+
* @returns {Promise} - The promise which resolves to an array.
|
660
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
661
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
662
|
+
* for more details and examples.
|
663
|
+
* @example
|
664
|
+
* ```
|
665
|
+
* const [response] = await client.getLocation(request);
|
666
|
+
* ```
|
667
|
+
*/
|
811
668
|
getLocation(request, options, callback) {
|
812
669
|
return this.locationsClient.getLocation(request, options, callback);
|
813
670
|
}
|
814
671
|
/**
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
672
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
673
|
+
*
|
674
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
675
|
+
* @param {Object} request
|
676
|
+
* The request object that will be sent.
|
677
|
+
* @param {string} request.name
|
678
|
+
* The resource that owns the locations collection, if applicable.
|
679
|
+
* @param {string} request.filter
|
680
|
+
* The standard list filter.
|
681
|
+
* @param {number} request.pageSize
|
682
|
+
* The standard list page size.
|
683
|
+
* @param {string} request.pageToken
|
684
|
+
* The standard list page token.
|
685
|
+
* @param {object} [options]
|
686
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
687
|
+
* @returns {Object}
|
688
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
689
|
+
* When you iterate the returned iterable, each element will be an object representing
|
690
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
691
|
+
* so you can stop the iteration when you don't need more results.
|
692
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
693
|
+
* for more details and examples.
|
694
|
+
* @example
|
695
|
+
* ```
|
696
|
+
* const iterable = client.listLocationsAsync(request);
|
697
|
+
* for await (const response of iterable) {
|
698
|
+
* // process response
|
699
|
+
* }
|
700
|
+
* ```
|
701
|
+
*/
|
845
702
|
listLocationsAsync(request, options) {
|
846
703
|
return this.locationsClient.listLocationsAsync(request, options);
|
847
704
|
}
|
848
705
|
/**
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
706
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
707
|
+
* method to poll the operation result at intervals as recommended by the API
|
708
|
+
* service.
|
709
|
+
*
|
710
|
+
* @param {Object} request - The request object that will be sent.
|
711
|
+
* @param {string} request.name - The name of the operation resource.
|
712
|
+
* @param {Object=} options
|
713
|
+
* Optional parameters. You can override the default settings for this call,
|
714
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
715
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
716
|
+
* for the details.
|
717
|
+
* @param {function(?Error, ?Object)=} callback
|
718
|
+
* The function which will be called with the result of the API call.
|
719
|
+
*
|
720
|
+
* The second parameter to the callback is an object representing
|
721
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
722
|
+
* @return {Promise} - The promise which resolves to an array.
|
723
|
+
* The first element of the array is an object representing
|
724
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
725
|
+
* The promise has a method named "cancel" which cancels the ongoing API call.
|
726
|
+
*
|
727
|
+
* @example
|
728
|
+
* ```
|
729
|
+
* const client = longrunning.operationsClient();
|
730
|
+
* const name = '';
|
731
|
+
* const [response] = await client.getOperation({name});
|
732
|
+
* // doThingsWith(response)
|
733
|
+
* ```
|
734
|
+
*/
|
878
735
|
getOperation(request, optionsOrCallback, callback) {
|
879
736
|
let options;
|
880
737
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
@@ -1051,8 +908,7 @@ class DataStoreServiceClient {
|
|
1051
908
|
* @returns {string} A string representing the project.
|
1052
909
|
*/
|
1053
910
|
matchProjectFromCollectionName(collectionName) {
|
1054
|
-
return this.pathTemplates.collectionPathTemplate.match(collectionName)
|
1055
|
-
.project;
|
911
|
+
return this.pathTemplates.collectionPathTemplate.match(collectionName).project;
|
1056
912
|
}
|
1057
913
|
/**
|
1058
914
|
* Parse the location from Collection resource.
|
@@ -1062,8 +918,7 @@ class DataStoreServiceClient {
|
|
1062
918
|
* @returns {string} A string representing the location.
|
1063
919
|
*/
|
1064
920
|
matchLocationFromCollectionName(collectionName) {
|
1065
|
-
return this.pathTemplates.collectionPathTemplate.match(collectionName)
|
1066
|
-
.location;
|
921
|
+
return this.pathTemplates.collectionPathTemplate.match(collectionName).location;
|
1067
922
|
}
|
1068
923
|
/**
|
1069
924
|
* Parse the collection from Collection resource.
|
@@ -1073,8 +928,7 @@ class DataStoreServiceClient {
|
|
1073
928
|
* @returns {string} A string representing the collection.
|
1074
929
|
*/
|
1075
930
|
matchCollectionFromCollectionName(collectionName) {
|
1076
|
-
return this.pathTemplates.collectionPathTemplate.match(collectionName)
|
1077
|
-
.collection;
|
931
|
+
return this.pathTemplates.collectionPathTemplate.match(collectionName).collection;
|
1078
932
|
}
|
1079
933
|
/**
|
1080
934
|
* Return a fully-qualified engine resource name string.
|
@@ -3311,8 +3165,8 @@ class DataStoreServiceClient {
|
|
3311
3165
|
this._log.info('ending gRPC channel');
|
3312
3166
|
this._terminated = true;
|
3313
3167
|
stub.close();
|
3314
|
-
this.locationsClient.close();
|
3315
|
-
this.operationsClient.close();
|
3168
|
+
this.locationsClient.close().catch(err => { throw err; });
|
3169
|
+
void this.operationsClient.close();
|
3316
3170
|
});
|
3317
3171
|
}
|
3318
3172
|
return Promise.resolve();
|