@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
@@ -98,26 +98,17 @@ class SchemaServiceClient {
|
|
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 SchemaServiceClient {
|
|
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,7 +203,7 @@ class SchemaServiceClient {
|
|
209
203
|
// (e.g. 50 results at a time, with tokens to get subsequent
|
210
204
|
// pages). Denote the keys used for pagination and results.
|
211
205
|
this.descriptors.page = {
|
212
|
-
listSchemas: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schemas')
|
206
|
+
listSchemas: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schemas')
|
213
207
|
};
|
214
208
|
const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
215
209
|
// This API contains "long-running operations", which return a
|
@@ -217,121 +211,16 @@ class SchemaServiceClient {
|
|
217
211
|
// rather than holding a request open.
|
218
212
|
const lroOptions = {
|
219
213
|
auth: this.auth,
|
220
|
-
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
|
214
|
+
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
|
221
215
|
};
|
222
216
|
if (opts.fallback) {
|
223
217
|
lroOptions.protoJson = protoFilesRoot;
|
224
|
-
lroOptions.httpRules = [
|
225
|
-
{
|
226
|
-
|
227
|
-
|
228
|
-
body: '*',
|
229
|
-
additional_bindings: [
|
230
|
-
{
|
231
|
-
post: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
|
232
|
-
body: '*',
|
233
|
-
},
|
234
|
-
{
|
235
|
-
post: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
|
236
|
-
body: '*',
|
237
|
-
},
|
238
|
-
],
|
239
|
-
},
|
240
|
-
{
|
241
|
-
selector: 'google.longrunning.Operations.GetOperation',
|
242
|
-
get: '/v1/{name=projects/*/operations/*}',
|
243
|
-
additional_bindings: [
|
244
|
-
{
|
245
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
|
246
|
-
},
|
247
|
-
{
|
248
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
|
249
|
-
},
|
250
|
-
{
|
251
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
|
252
|
-
},
|
253
|
-
{
|
254
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
|
255
|
-
},
|
256
|
-
{
|
257
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
|
258
|
-
},
|
259
|
-
{
|
260
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
|
261
|
-
},
|
262
|
-
{
|
263
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
|
264
|
-
},
|
265
|
-
{
|
266
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
|
267
|
-
},
|
268
|
-
{
|
269
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}',
|
270
|
-
},
|
271
|
-
{
|
272
|
-
get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
|
273
|
-
},
|
274
|
-
{
|
275
|
-
get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
|
276
|
-
},
|
277
|
-
{
|
278
|
-
get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}',
|
279
|
-
},
|
280
|
-
{
|
281
|
-
get: '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}',
|
282
|
-
},
|
283
|
-
{ get: '/v1/{name=projects/*/locations/*/operations/*}' },
|
284
|
-
{ get: '/v1/{name=projects/*/operations/*}' },
|
285
|
-
],
|
286
|
-
},
|
287
|
-
{
|
288
|
-
selector: 'google.longrunning.Operations.ListOperations',
|
289
|
-
get: '/v1/{name=projects/*}/operations',
|
290
|
-
additional_bindings: [
|
291
|
-
{
|
292
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
|
293
|
-
},
|
294
|
-
{
|
295
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
|
296
|
-
},
|
297
|
-
{
|
298
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
|
299
|
-
},
|
300
|
-
{
|
301
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
|
302
|
-
},
|
303
|
-
{
|
304
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
|
305
|
-
},
|
306
|
-
{
|
307
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
|
308
|
-
},
|
309
|
-
{
|
310
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
|
311
|
-
},
|
312
|
-
{
|
313
|
-
get: '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations',
|
314
|
-
},
|
315
|
-
{ get: '/v1/{name=projects/*/locations/*/collections/*}/operations' },
|
316
|
-
{
|
317
|
-
get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
|
318
|
-
},
|
319
|
-
{
|
320
|
-
get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
|
321
|
-
},
|
322
|
-
{ get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations' },
|
323
|
-
{
|
324
|
-
get: '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations',
|
325
|
-
},
|
326
|
-
{ get: '/v1/{name=projects/*/locations/*}/operations' },
|
327
|
-
{ get: '/v1/{name=projects/*}/operations' },
|
328
|
-
],
|
329
|
-
},
|
330
|
-
];
|
218
|
+
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: '*', }],
|
219
|
+
}, { 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/*}', }],
|
220
|
+
}, { 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', }],
|
221
|
+
}];
|
331
222
|
}
|
332
|
-
this.operationsClient = this._gaxModule
|
333
|
-
.lro(lroOptions)
|
334
|
-
.operationsClient(opts);
|
223
|
+
this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
|
335
224
|
const createSchemaResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.Schema');
|
336
225
|
const createSchemaMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.CreateSchemaMetadata');
|
337
226
|
const updateSchemaResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.Schema');
|
@@ -341,7 +230,7 @@ class SchemaServiceClient {
|
|
341
230
|
this.descriptors.longrunning = {
|
342
231
|
createSchema: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createSchemaResponse.decode.bind(createSchemaResponse), createSchemaMetadata.decode.bind(createSchemaMetadata)),
|
343
232
|
updateSchema: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateSchemaResponse.decode.bind(updateSchemaResponse), updateSchemaMetadata.decode.bind(updateSchemaMetadata)),
|
344
|
-
deleteSchema: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteSchemaResponse.decode.bind(deleteSchemaResponse), deleteSchemaMetadata.decode.bind(deleteSchemaMetadata))
|
233
|
+
deleteSchema: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteSchemaResponse.decode.bind(deleteSchemaResponse), deleteSchemaMetadata.decode.bind(deleteSchemaMetadata))
|
345
234
|
};
|
346
235
|
// Put together the default options sent with requests.
|
347
236
|
this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.SchemaService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
@@ -370,19 +259,13 @@ class SchemaServiceClient {
|
|
370
259
|
}
|
371
260
|
// Put together the "service stub" for
|
372
261
|
// google.cloud.discoveryengine.v1.SchemaService.
|
373
|
-
this.schemaServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
374
|
-
|
375
|
-
|
376
|
-
|
262
|
+
this.schemaServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
263
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1.SchemaService') :
|
264
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
265
|
+
this._protos.google.cloud.discoveryengine.v1.SchemaService, this._opts, this._providedCustomServicePath);
|
377
266
|
// Iterate over each of the methods that the service provides
|
378
267
|
// and create an API call method for each.
|
379
|
-
const schemaServiceStubMethods = [
|
380
|
-
'getSchema',
|
381
|
-
'listSchemas',
|
382
|
-
'createSchema',
|
383
|
-
'updateSchema',
|
384
|
-
'deleteSchema',
|
385
|
-
];
|
268
|
+
const schemaServiceStubMethods = ['getSchema', 'listSchemas', 'createSchema', 'updateSchema', 'deleteSchema'];
|
386
269
|
for (const methodName of schemaServiceStubMethods) {
|
387
270
|
const callPromise = this.schemaServiceStub.then(stub => (...args) => {
|
388
271
|
if (this._terminated) {
|
@@ -407,8 +290,7 @@ class SchemaServiceClient {
|
|
407
290
|
* @returns {string} The DNS address for this service.
|
408
291
|
*/
|
409
292
|
static get servicePath() {
|
410
|
-
if (typeof process === 'object' &&
|
411
|
-
typeof process.emitWarning === 'function') {
|
293
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
412
294
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
413
295
|
}
|
414
296
|
return 'discoveryengine.googleapis.com';
|
@@ -419,8 +301,7 @@ class SchemaServiceClient {
|
|
419
301
|
* @returns {string} The DNS address for this service.
|
420
302
|
*/
|
421
303
|
static get apiEndpoint() {
|
422
|
-
if (typeof process === 'object' &&
|
423
|
-
typeof process.emitWarning === 'function') {
|
304
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
424
305
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
425
306
|
}
|
426
307
|
return 'discoveryengine.googleapis.com';
|
@@ -448,7 +329,9 @@ class SchemaServiceClient {
|
|
448
329
|
* @returns {string[]} List of default scopes.
|
449
330
|
*/
|
450
331
|
static get scopes() {
|
451
|
-
return [
|
332
|
+
return [
|
333
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
334
|
+
];
|
452
335
|
}
|
453
336
|
/**
|
454
337
|
* Return the project ID used by this class.
|
@@ -474,13 +357,10 @@ class SchemaServiceClient {
|
|
474
357
|
options = options || {};
|
475
358
|
options.otherArgs = options.otherArgs || {};
|
476
359
|
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;
|
360
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
361
|
+
'name': request.name ?? '',
|
483
362
|
});
|
363
|
+
this.initialize().catch(err => { throw err; });
|
484
364
|
this._log.info('getSchema request %j', request);
|
485
365
|
const wrappedCallback = callback
|
486
366
|
? (error, response, options, rawResponse) => {
|
@@ -488,8 +368,7 @@ class SchemaServiceClient {
|
|
488
368
|
callback(error, response, options, rawResponse); // We verified callback above.
|
489
369
|
}
|
490
370
|
: undefined;
|
491
|
-
return this.innerApiCalls
|
492
|
-
.getSchema(request, options, wrappedCallback)
|
371
|
+
return this.innerApiCalls.getSchema(request, options, wrappedCallback)
|
493
372
|
?.then(([response, options, rawResponse]) => {
|
494
373
|
this._log.info('getSchema response %j', response);
|
495
374
|
return [response, options, rawResponse];
|
@@ -508,13 +387,10 @@ class SchemaServiceClient {
|
|
508
387
|
options = options || {};
|
509
388
|
options.otherArgs = options.otherArgs || {};
|
510
389
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
511
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
512
|
-
|
513
|
-
parent: request.parent ?? '',
|
514
|
-
});
|
515
|
-
this.initialize().catch(err => {
|
516
|
-
throw err;
|
390
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
391
|
+
'parent': request.parent ?? '',
|
517
392
|
});
|
393
|
+
this.initialize().catch(err => { throw err; });
|
518
394
|
const wrappedCallback = callback
|
519
395
|
? (error, response, rawResponse, _) => {
|
520
396
|
this._log.info('createSchema response %j', rawResponse);
|
@@ -522,8 +398,7 @@ class SchemaServiceClient {
|
|
522
398
|
}
|
523
399
|
: undefined;
|
524
400
|
this._log.info('createSchema request %j', request);
|
525
|
-
return this.innerApiCalls
|
526
|
-
.createSchema(request, options, wrappedCallback)
|
401
|
+
return this.innerApiCalls.createSchema(request, options, wrappedCallback)
|
527
402
|
?.then(([response, rawResponse, _]) => {
|
528
403
|
this._log.info('createSchema response %j', rawResponse);
|
529
404
|
return [response, rawResponse, _];
|
@@ -560,13 +435,10 @@ class SchemaServiceClient {
|
|
560
435
|
options = options || {};
|
561
436
|
options.otherArgs = options.otherArgs || {};
|
562
437
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
563
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
564
|
-
|
565
|
-
'schema.name': request.schema.name ?? '',
|
566
|
-
});
|
567
|
-
this.initialize().catch(err => {
|
568
|
-
throw err;
|
438
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
439
|
+
'schema.name': request.schema.name ?? '',
|
569
440
|
});
|
441
|
+
this.initialize().catch(err => { throw err; });
|
570
442
|
const wrappedCallback = callback
|
571
443
|
? (error, response, rawResponse, _) => {
|
572
444
|
this._log.info('updateSchema response %j', rawResponse);
|
@@ -574,8 +446,7 @@ class SchemaServiceClient {
|
|
574
446
|
}
|
575
447
|
: undefined;
|
576
448
|
this._log.info('updateSchema request %j', request);
|
577
|
-
return this.innerApiCalls
|
578
|
-
.updateSchema(request, options, wrappedCallback)
|
449
|
+
return this.innerApiCalls.updateSchema(request, options, wrappedCallback)
|
579
450
|
?.then(([response, rawResponse, _]) => {
|
580
451
|
this._log.info('updateSchema response %j', rawResponse);
|
581
452
|
return [response, rawResponse, _];
|
@@ -612,13 +483,10 @@ class SchemaServiceClient {
|
|
612
483
|
options = options || {};
|
613
484
|
options.otherArgs = options.otherArgs || {};
|
614
485
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
615
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
616
|
-
|
617
|
-
name: request.name ?? '',
|
618
|
-
});
|
619
|
-
this.initialize().catch(err => {
|
620
|
-
throw err;
|
486
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
487
|
+
'name': request.name ?? '',
|
621
488
|
});
|
489
|
+
this.initialize().catch(err => { throw err; });
|
622
490
|
const wrappedCallback = callback
|
623
491
|
? (error, response, rawResponse, _) => {
|
624
492
|
this._log.info('deleteSchema response %j', rawResponse);
|
@@ -626,8 +494,7 @@ class SchemaServiceClient {
|
|
626
494
|
}
|
627
495
|
: undefined;
|
628
496
|
this._log.info('deleteSchema request %j', request);
|
629
|
-
return this.innerApiCalls
|
630
|
-
.deleteSchema(request, options, wrappedCallback)
|
497
|
+
return this.innerApiCalls.deleteSchema(request, options, wrappedCallback)
|
631
498
|
?.then(([response, rawResponse, _]) => {
|
632
499
|
this._log.info('deleteSchema response %j', rawResponse);
|
633
500
|
return [response, rawResponse, _];
|
@@ -664,13 +531,10 @@ class SchemaServiceClient {
|
|
664
531
|
options = options || {};
|
665
532
|
options.otherArgs = options.otherArgs || {};
|
666
533
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
667
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
668
|
-
|
669
|
-
parent: request.parent ?? '',
|
670
|
-
});
|
671
|
-
this.initialize().catch(err => {
|
672
|
-
throw err;
|
534
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
535
|
+
'parent': request.parent ?? '',
|
673
536
|
});
|
537
|
+
this.initialize().catch(err => { throw err; });
|
674
538
|
const wrappedCallback = callback
|
675
539
|
? (error, values, nextPageRequest, rawResponse) => {
|
676
540
|
this._log.info('listSchemas values %j', values);
|
@@ -724,15 +588,12 @@ class SchemaServiceClient {
|
|
724
588
|
options = options || {};
|
725
589
|
options.otherArgs = options.otherArgs || {};
|
726
590
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
727
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
728
|
-
|
729
|
-
|
730
|
-
});
|
591
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
592
|
+
'parent': request.parent ?? '',
|
593
|
+
});
|
731
594
|
const defaultCallSettings = this._defaults['listSchemas'];
|
732
595
|
const callSettings = defaultCallSettings.merge(options);
|
733
|
-
this.initialize().catch(err => {
|
734
|
-
throw err;
|
735
|
-
});
|
596
|
+
this.initialize().catch(err => { throw err; });
|
736
597
|
this._log.info('listSchemas stream %j', request);
|
737
598
|
return this.descriptors.page.listSchemas.createStream(this.innerApiCalls.listSchemas, request, callSettings);
|
738
599
|
}
|
@@ -778,103 +639,100 @@ class SchemaServiceClient {
|
|
778
639
|
options = options || {};
|
779
640
|
options.otherArgs = options.otherArgs || {};
|
780
641
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
781
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
782
|
-
|
783
|
-
|
784
|
-
});
|
642
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
643
|
+
'parent': request.parent ?? '',
|
644
|
+
});
|
785
645
|
const defaultCallSettings = this._defaults['listSchemas'];
|
786
646
|
const callSettings = defaultCallSettings.merge(options);
|
787
|
-
this.initialize().catch(err => {
|
788
|
-
throw err;
|
789
|
-
});
|
647
|
+
this.initialize().catch(err => { throw err; });
|
790
648
|
this._log.info('listSchemas iterate %j', request);
|
791
649
|
return this.descriptors.page.listSchemas.asyncIterate(this.innerApiCalls['listSchemas'], request, callSettings);
|
792
650
|
}
|
793
651
|
/**
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
652
|
+
* Gets information about a location.
|
653
|
+
*
|
654
|
+
* @param {Object} request
|
655
|
+
* The request object that will be sent.
|
656
|
+
* @param {string} request.name
|
657
|
+
* Resource name for the location.
|
658
|
+
* @param {object} [options]
|
659
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
660
|
+
* @returns {Promise} - The promise which resolves to an array.
|
661
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
662
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
663
|
+
* for more details and examples.
|
664
|
+
* @example
|
665
|
+
* ```
|
666
|
+
* const [response] = await client.getLocation(request);
|
667
|
+
* ```
|
668
|
+
*/
|
811
669
|
getLocation(request, options, callback) {
|
812
670
|
return this.locationsClient.getLocation(request, options, callback);
|
813
671
|
}
|
814
672
|
/**
|
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
|
-
|
673
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
674
|
+
*
|
675
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
676
|
+
* @param {Object} request
|
677
|
+
* The request object that will be sent.
|
678
|
+
* @param {string} request.name
|
679
|
+
* The resource that owns the locations collection, if applicable.
|
680
|
+
* @param {string} request.filter
|
681
|
+
* The standard list filter.
|
682
|
+
* @param {number} request.pageSize
|
683
|
+
* The standard list page size.
|
684
|
+
* @param {string} request.pageToken
|
685
|
+
* The standard list page token.
|
686
|
+
* @param {object} [options]
|
687
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
688
|
+
* @returns {Object}
|
689
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
690
|
+
* When you iterate the returned iterable, each element will be an object representing
|
691
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
692
|
+
* so you can stop the iteration when you don't need more results.
|
693
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
694
|
+
* for more details and examples.
|
695
|
+
* @example
|
696
|
+
* ```
|
697
|
+
* const iterable = client.listLocationsAsync(request);
|
698
|
+
* for await (const response of iterable) {
|
699
|
+
* // process response
|
700
|
+
* }
|
701
|
+
* ```
|
702
|
+
*/
|
845
703
|
listLocationsAsync(request, options) {
|
846
704
|
return this.locationsClient.listLocationsAsync(request, options);
|
847
705
|
}
|
848
706
|
/**
|
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
|
-
|
707
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
708
|
+
* method to poll the operation result at intervals as recommended by the API
|
709
|
+
* service.
|
710
|
+
*
|
711
|
+
* @param {Object} request - The request object that will be sent.
|
712
|
+
* @param {string} request.name - The name of the operation resource.
|
713
|
+
* @param {Object=} options
|
714
|
+
* Optional parameters. You can override the default settings for this call,
|
715
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
716
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
717
|
+
* for the details.
|
718
|
+
* @param {function(?Error, ?Object)=} callback
|
719
|
+
* The function which will be called with the result of the API call.
|
720
|
+
*
|
721
|
+
* The second parameter to the callback is an object representing
|
722
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
723
|
+
* @return {Promise} - The promise which resolves to an array.
|
724
|
+
* The first element of the array is an object representing
|
725
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
726
|
+
* The promise has a method named "cancel" which cancels the ongoing API call.
|
727
|
+
*
|
728
|
+
* @example
|
729
|
+
* ```
|
730
|
+
* const client = longrunning.operationsClient();
|
731
|
+
* const name = '';
|
732
|
+
* const [response] = await client.getOperation({name});
|
733
|
+
* // doThingsWith(response)
|
734
|
+
* ```
|
735
|
+
*/
|
878
736
|
getOperation(request, optionsOrCallback, callback) {
|
879
737
|
let options;
|
880
738
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
@@ -3263,8 +3121,8 @@ class SchemaServiceClient {
|
|
3263
3121
|
this._log.info('ending gRPC channel');
|
3264
3122
|
this._terminated = true;
|
3265
3123
|
stub.close();
|
3266
|
-
this.locationsClient.close();
|
3267
|
-
this.operationsClient.close();
|
3124
|
+
this.locationsClient.close().catch(err => { throw err; });
|
3125
|
+
void this.operationsClient.close();
|
3268
3126
|
});
|
3269
3127
|
}
|
3270
3128
|
return Promise.resolve();
|