@google-cloud/discoveryengine 2.0.1 → 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 +14 -0
- package/README.md +7 -2
- package/build/protos/google/cloud/discoveryengine/v1/answer.proto +54 -2
- package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +2 -1
- package/build/protos/google/cloud/discoveryengine/v1/common.proto +35 -6
- package/build/protos/google/cloud/discoveryengine/v1/control.proto +113 -2
- package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +168 -2
- package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +23 -4
- package/build/protos/google/cloud/discoveryengine/v1/document.proto +7 -2
- package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +1 -1
- package/build/protos/google/cloud/discoveryengine/v1/engine.proto +16 -3
- package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +70 -9
- package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +20 -1
- package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +9 -5
- package/build/protos/google/cloud/discoveryengine/v1/rank_service.proto +3 -1
- package/build/protos/google/cloud/discoveryengine/v1/recommendation_service.proto +2 -2
- package/build/protos/google/cloud/discoveryengine/v1/safety.proto +107 -0
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +96 -8
- package/build/protos/google/cloud/discoveryengine/v1/serving_config.proto +271 -0
- package/build/protos/google/cloud/discoveryengine/v1/serving_config_service.proto +75 -0
- package/build/protos/google/cloud/discoveryengine/v1/session.proto +19 -0
- package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +27 -3
- package/build/protos/google/cloud/discoveryengine/v1/site_search_engine_service.proto +184 -5
- package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +34 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +16 -4
- package/build/protos/protos.d.ts +4390 -300
- package/build/protos/protos.js +13785 -2922
- package/build/protos/protos.json +1355 -14
- package/build/src/index.d.ts +4 -1
- package/build/src/index.js +4 -21
- package/build/src/v1/completion_service_client.d.ts +313 -76
- package/build/src/v1/completion_service_client.js +451 -262
- package/build/src/v1/completion_service_proto_list.json +3 -0
- package/build/src/v1/control_service_client.d.ts +318 -81
- package/build/src/v1/control_service_client.js +422 -132
- package/build/src/v1/control_service_proto_list.json +3 -0
- package/build/src/v1/conversational_search_service_client.d.ts +341 -134
- package/build/src/v1/conversational_search_service_client.js +395 -223
- package/build/src/v1/conversational_search_service_client_config.json +5 -0
- package/build/src/v1/conversational_search_service_proto_list.json +3 -0
- package/build/src/v1/data_store_service_client.d.ts +359 -122
- package/build/src/v1/data_store_service_client.js +460 -280
- package/build/src/v1/data_store_service_proto_list.json +3 -0
- package/build/src/v1/document_service_client.d.ts +364 -121
- package/build/src/v1/document_service_client.js +469 -300
- package/build/src/v1/document_service_proto_list.json +3 -0
- package/build/src/v1/engine_service_client.d.ts +340 -103
- package/build/src/v1/engine_service_client.js +460 -279
- package/build/src/v1/engine_service_proto_list.json +3 -0
- package/build/src/v1/gapic_metadata.json +59 -0
- package/build/src/v1/grounded_generation_service_client.d.ts +286 -51
- package/build/src/v1/grounded_generation_service_client.js +405 -100
- package/build/src/v1/grounded_generation_service_proto_list.json +3 -0
- package/build/src/v1/index.d.ts +1 -0
- package/build/src/v1/index.js +3 -1
- package/build/src/v1/project_service_client.d.ts +313 -76
- package/build/src/v1/project_service_client.js +434 -222
- package/build/src/v1/project_service_proto_list.json +3 -0
- package/build/src/v1/rank_service_client.d.ts +285 -48
- package/build/src/v1/rank_service_client.js +398 -85
- package/build/src/v1/rank_service_proto_list.json +3 -0
- package/build/src/v1/recommendation_service_client.d.ts +142 -49
- package/build/src/v1/recommendation_service_client.js +198 -82
- package/build/src/v1/recommendation_service_proto_list.json +3 -0
- package/build/src/v1/schema_service_client.d.ts +348 -111
- package/build/src/v1/schema_service_client.js +457 -273
- package/build/src/v1/schema_service_proto_list.json +3 -0
- package/build/src/v1/search_service_client.d.ts +748 -559
- package/build/src/v1/search_service_client.js +302 -133
- package/build/src/v1/search_service_proto_list.json +3 -0
- package/build/src/v1/search_tuning_service_client.d.ts +314 -77
- package/build/src/v1/search_tuning_service_client.js +439 -235
- package/build/src/v1/search_tuning_service_proto_list.json +3 -0
- package/build/src/v1/serving_config_service_client.d.ts +1851 -0
- package/build/src/v1/serving_config_service_client.js +2642 -0
- package/build/src/v1/serving_config_service_client_config.json +30 -0
- package/build/src/v1/serving_config_service_proto_list.json +39 -0
- package/build/src/v1/site_search_engine_service_client.d.ts +504 -151
- package/build/src/v1/site_search_engine_service_client.js +625 -351
- package/build/src/v1/site_search_engine_service_client_config.json +12 -0
- package/build/src/v1/site_search_engine_service_proto_list.json +3 -0
- package/build/src/v1/user_event_service_client.d.ts +335 -86
- package/build/src/v1/user_event_service_client.js +447 -253
- package/build/src/v1/user_event_service_proto_list.json +3 -0
- 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 +4 -4
@@ -99,26 +99,17 @@ class EngineServiceClient {
|
|
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 EngineServiceClient {
|
|
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
|
}
|
@@ -215,7 +209,7 @@ class EngineServiceClient {
|
|
215
209
|
// (e.g. 50 results at a time, with tokens to get subsequent
|
216
210
|
// pages). Denote the keys used for pagination and results.
|
217
211
|
this.descriptors.page = {
|
218
|
-
listEngines: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'engines')
|
212
|
+
listEngines: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'engines')
|
219
213
|
};
|
220
214
|
const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
221
215
|
// This API contains "long-running operations", which return a
|
@@ -223,115 +217,16 @@ class EngineServiceClient {
|
|
223
217
|
// rather than holding a request open.
|
224
218
|
const lroOptions = {
|
225
219
|
auth: this.auth,
|
226
|
-
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
|
220
|
+
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
|
227
221
|
};
|
228
222
|
if (opts.fallback) {
|
229
223
|
lroOptions.protoJson = protoFilesRoot;
|
230
|
-
lroOptions.httpRules = [
|
231
|
-
{
|
232
|
-
|
233
|
-
|
234
|
-
body: '*',
|
235
|
-
additional_bindings: [
|
236
|
-
{
|
237
|
-
post: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
|
238
|
-
body: '*',
|
239
|
-
},
|
240
|
-
],
|
241
|
-
},
|
242
|
-
{
|
243
|
-
selector: 'google.longrunning.Operations.GetOperation',
|
244
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
|
245
|
-
additional_bindings: [
|
246
|
-
{
|
247
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
|
248
|
-
},
|
249
|
-
{
|
250
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
|
251
|
-
},
|
252
|
-
{
|
253
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
|
254
|
-
},
|
255
|
-
{
|
256
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
|
257
|
-
},
|
258
|
-
{
|
259
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
|
260
|
-
},
|
261
|
-
{
|
262
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
|
263
|
-
},
|
264
|
-
{
|
265
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
|
266
|
-
},
|
267
|
-
{
|
268
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}',
|
269
|
-
},
|
270
|
-
{
|
271
|
-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
|
272
|
-
},
|
273
|
-
{
|
274
|
-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
|
275
|
-
},
|
276
|
-
{
|
277
|
-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}',
|
278
|
-
},
|
279
|
-
{
|
280
|
-
get: '/v1beta/{name=projects/*/locations/*/evaluations/*/operations/*}',
|
281
|
-
},
|
282
|
-
{ get: '/v1beta/{name=projects/*/locations/*/operations/*}' },
|
283
|
-
{
|
284
|
-
get: '/v1beta/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
|
285
|
-
},
|
286
|
-
{ get: '/v1beta/{name=projects/*/operations/*}' },
|
287
|
-
],
|
288
|
-
},
|
289
|
-
{
|
290
|
-
selector: 'google.longrunning.Operations.ListOperations',
|
291
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
|
292
|
-
additional_bindings: [
|
293
|
-
{
|
294
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
|
295
|
-
},
|
296
|
-
{
|
297
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
|
298
|
-
},
|
299
|
-
{
|
300
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
|
301
|
-
},
|
302
|
-
{
|
303
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
|
304
|
-
},
|
305
|
-
{
|
306
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
|
307
|
-
},
|
308
|
-
{
|
309
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
|
310
|
-
},
|
311
|
-
{
|
312
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*/engines/*}/operations',
|
313
|
-
},
|
314
|
-
{
|
315
|
-
get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations',
|
316
|
-
},
|
317
|
-
{
|
318
|
-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
|
319
|
-
},
|
320
|
-
{
|
321
|
-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
|
322
|
-
},
|
323
|
-
{
|
324
|
-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations',
|
325
|
-
},
|
326
|
-
{ get: '/v1beta/{name=projects/*/locations/*}/operations' },
|
327
|
-
{ get: '/v1beta/{name=projects/*}/operations' },
|
328
|
-
],
|
329
|
-
},
|
330
|
-
];
|
224
|
+
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: '*', }],
|
225
|
+
}, { 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/*}', }],
|
226
|
+
}, { 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', }],
|
227
|
+
}];
|
331
228
|
}
|
332
|
-
this.operationsClient = this._gaxModule
|
333
|
-
.lro(lroOptions)
|
334
|
-
.operationsClient(opts);
|
229
|
+
this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
|
335
230
|
const createEngineResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.Engine');
|
336
231
|
const createEngineMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1beta.CreateEngineMetadata');
|
337
232
|
const deleteEngineResponse = protoFilesRoot.lookup('.google.protobuf.Empty');
|
@@ -341,7 +236,7 @@ class EngineServiceClient {
|
|
341
236
|
this.descriptors.longrunning = {
|
342
237
|
createEngine: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createEngineResponse.decode.bind(createEngineResponse), createEngineMetadata.decode.bind(createEngineMetadata)),
|
343
238
|
deleteEngine: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteEngineResponse.decode.bind(deleteEngineResponse), deleteEngineMetadata.decode.bind(deleteEngineMetadata)),
|
344
|
-
tuneEngine: new this._gaxModule.LongrunningDescriptor(this.operationsClient, tuneEngineResponse.decode.bind(tuneEngineResponse), tuneEngineMetadata.decode.bind(tuneEngineMetadata))
|
239
|
+
tuneEngine: new this._gaxModule.LongrunningDescriptor(this.operationsClient, tuneEngineResponse.decode.bind(tuneEngineResponse), tuneEngineMetadata.decode.bind(tuneEngineMetadata))
|
345
240
|
};
|
346
241
|
// Put together the default options sent with requests.
|
347
242
|
this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.EngineService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
@@ -370,23 +265,13 @@ class EngineServiceClient {
|
|
370
265
|
}
|
371
266
|
// Put together the "service stub" for
|
372
267
|
// google.cloud.discoveryengine.v1beta.EngineService.
|
373
|
-
this.engineServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
.EngineService, this._opts, this._providedCustomServicePath);
|
268
|
+
this.engineServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
269
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1beta.EngineService') :
|
270
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
271
|
+
this._protos.google.cloud.discoveryengine.v1beta.EngineService, this._opts, this._providedCustomServicePath);
|
378
272
|
// Iterate over each of the methods that the service provides
|
379
273
|
// and create an API call method for each.
|
380
|
-
const engineServiceStubMethods = [
|
381
|
-
'createEngine',
|
382
|
-
'deleteEngine',
|
383
|
-
'updateEngine',
|
384
|
-
'getEngine',
|
385
|
-
'listEngines',
|
386
|
-
'pauseEngine',
|
387
|
-
'resumeEngine',
|
388
|
-
'tuneEngine',
|
389
|
-
];
|
274
|
+
const engineServiceStubMethods = ['createEngine', 'deleteEngine', 'updateEngine', 'getEngine', 'listEngines', 'pauseEngine', 'resumeEngine', 'tuneEngine'];
|
390
275
|
for (const methodName of engineServiceStubMethods) {
|
391
276
|
const callPromise = this.engineServiceStub.then(stub => (...args) => {
|
392
277
|
if (this._terminated) {
|
@@ -411,8 +296,7 @@ class EngineServiceClient {
|
|
411
296
|
* @returns {string} The DNS address for this service.
|
412
297
|
*/
|
413
298
|
static get servicePath() {
|
414
|
-
if (typeof process === 'object' &&
|
415
|
-
typeof process.emitWarning === 'function') {
|
299
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
416
300
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
417
301
|
}
|
418
302
|
return 'discoveryengine.googleapis.com';
|
@@ -423,8 +307,7 @@ class EngineServiceClient {
|
|
423
307
|
* @returns {string} The DNS address for this service.
|
424
308
|
*/
|
425
309
|
static get apiEndpoint() {
|
426
|
-
if (typeof process === 'object' &&
|
427
|
-
typeof process.emitWarning === 'function') {
|
310
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
428
311
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
429
312
|
}
|
430
313
|
return 'discoveryengine.googleapis.com';
|
@@ -452,7 +335,9 @@ class EngineServiceClient {
|
|
452
335
|
* @returns {string[]} List of default scopes.
|
453
336
|
*/
|
454
337
|
static get scopes() {
|
455
|
-
return [
|
338
|
+
return [
|
339
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
340
|
+
];
|
456
341
|
}
|
457
342
|
/**
|
458
343
|
* Return the project ID used by this class.
|
@@ -478,13 +363,10 @@ class EngineServiceClient {
|
|
478
363
|
options = options || {};
|
479
364
|
options.otherArgs = options.otherArgs || {};
|
480
365
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
481
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
482
|
-
|
483
|
-
'engine.name': request.engine.name ?? '',
|
484
|
-
});
|
485
|
-
this.initialize().catch(err => {
|
486
|
-
throw err;
|
366
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
367
|
+
'engine.name': request.engine.name ?? '',
|
487
368
|
});
|
369
|
+
this.initialize().catch(err => { throw err; });
|
488
370
|
this._log.info('updateEngine request %j', request);
|
489
371
|
const wrappedCallback = callback
|
490
372
|
? (error, response, options, rawResponse) => {
|
@@ -492,8 +374,7 @@ class EngineServiceClient {
|
|
492
374
|
callback(error, response, options, rawResponse); // We verified callback above.
|
493
375
|
}
|
494
376
|
: undefined;
|
495
|
-
return this.innerApiCalls
|
496
|
-
.updateEngine(request, options, wrappedCallback)
|
377
|
+
return this.innerApiCalls.updateEngine(request, options, wrappedCallback)
|
497
378
|
?.then(([response, options, rawResponse]) => {
|
498
379
|
this._log.info('updateEngine response %j', response);
|
499
380
|
return [response, options, rawResponse];
|
@@ -512,13 +393,10 @@ class EngineServiceClient {
|
|
512
393
|
options = options || {};
|
513
394
|
options.otherArgs = options.otherArgs || {};
|
514
395
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
515
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
516
|
-
|
517
|
-
name: request.name ?? '',
|
518
|
-
});
|
519
|
-
this.initialize().catch(err => {
|
520
|
-
throw err;
|
396
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
397
|
+
'name': request.name ?? '',
|
521
398
|
});
|
399
|
+
this.initialize().catch(err => { throw err; });
|
522
400
|
this._log.info('getEngine request %j', request);
|
523
401
|
const wrappedCallback = callback
|
524
402
|
? (error, response, options, rawResponse) => {
|
@@ -526,8 +404,7 @@ class EngineServiceClient {
|
|
526
404
|
callback(error, response, options, rawResponse); // We verified callback above.
|
527
405
|
}
|
528
406
|
: undefined;
|
529
|
-
return this.innerApiCalls
|
530
|
-
.getEngine(request, options, wrappedCallback)
|
407
|
+
return this.innerApiCalls.getEngine(request, options, wrappedCallback)
|
531
408
|
?.then(([response, options, rawResponse]) => {
|
532
409
|
this._log.info('getEngine response %j', response);
|
533
410
|
return [response, options, rawResponse];
|
@@ -546,13 +423,10 @@ class EngineServiceClient {
|
|
546
423
|
options = options || {};
|
547
424
|
options.otherArgs = options.otherArgs || {};
|
548
425
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
549
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
550
|
-
|
551
|
-
name: request.name ?? '',
|
552
|
-
});
|
553
|
-
this.initialize().catch(err => {
|
554
|
-
throw err;
|
426
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
427
|
+
'name': request.name ?? '',
|
555
428
|
});
|
429
|
+
this.initialize().catch(err => { throw err; });
|
556
430
|
this._log.info('pauseEngine request %j', request);
|
557
431
|
const wrappedCallback = callback
|
558
432
|
? (error, response, options, rawResponse) => {
|
@@ -560,8 +434,7 @@ class EngineServiceClient {
|
|
560
434
|
callback(error, response, options, rawResponse); // We verified callback above.
|
561
435
|
}
|
562
436
|
: undefined;
|
563
|
-
return this.innerApiCalls
|
564
|
-
.pauseEngine(request, options, wrappedCallback)
|
437
|
+
return this.innerApiCalls.pauseEngine(request, options, wrappedCallback)
|
565
438
|
?.then(([response, options, rawResponse]) => {
|
566
439
|
this._log.info('pauseEngine response %j', response);
|
567
440
|
return [response, options, rawResponse];
|
@@ -580,13 +453,10 @@ class EngineServiceClient {
|
|
580
453
|
options = options || {};
|
581
454
|
options.otherArgs = options.otherArgs || {};
|
582
455
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
583
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
584
|
-
|
585
|
-
name: request.name ?? '',
|
586
|
-
});
|
587
|
-
this.initialize().catch(err => {
|
588
|
-
throw err;
|
456
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
457
|
+
'name': request.name ?? '',
|
589
458
|
});
|
459
|
+
this.initialize().catch(err => { throw err; });
|
590
460
|
this._log.info('resumeEngine request %j', request);
|
591
461
|
const wrappedCallback = callback
|
592
462
|
? (error, response, options, rawResponse) => {
|
@@ -594,8 +464,7 @@ class EngineServiceClient {
|
|
594
464
|
callback(error, response, options, rawResponse); // We verified callback above.
|
595
465
|
}
|
596
466
|
: undefined;
|
597
|
-
return this.innerApiCalls
|
598
|
-
.resumeEngine(request, options, wrappedCallback)
|
467
|
+
return this.innerApiCalls.resumeEngine(request, options, wrappedCallback)
|
599
468
|
?.then(([response, options, rawResponse]) => {
|
600
469
|
this._log.info('resumeEngine response %j', response);
|
601
470
|
return [response, options, rawResponse];
|
@@ -614,13 +483,10 @@ class EngineServiceClient {
|
|
614
483
|
options = options || {};
|
615
484
|
options.otherArgs = options.otherArgs || {};
|
616
485
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
617
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
618
|
-
|
619
|
-
parent: request.parent ?? '',
|
620
|
-
});
|
621
|
-
this.initialize().catch(err => {
|
622
|
-
throw err;
|
486
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
487
|
+
'parent': request.parent ?? '',
|
623
488
|
});
|
489
|
+
this.initialize().catch(err => { throw err; });
|
624
490
|
const wrappedCallback = callback
|
625
491
|
? (error, response, rawResponse, _) => {
|
626
492
|
this._log.info('createEngine response %j', rawResponse);
|
@@ -628,8 +494,7 @@ class EngineServiceClient {
|
|
628
494
|
}
|
629
495
|
: undefined;
|
630
496
|
this._log.info('createEngine request %j', request);
|
631
|
-
return this.innerApiCalls
|
632
|
-
.createEngine(request, options, wrappedCallback)
|
497
|
+
return this.innerApiCalls.createEngine(request, options, wrappedCallback)
|
633
498
|
?.then(([response, rawResponse, _]) => {
|
634
499
|
this._log.info('createEngine response %j', rawResponse);
|
635
500
|
return [response, rawResponse, _];
|
@@ -666,13 +531,10 @@ class EngineServiceClient {
|
|
666
531
|
options = options || {};
|
667
532
|
options.otherArgs = options.otherArgs || {};
|
668
533
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
669
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
670
|
-
|
671
|
-
name: request.name ?? '',
|
672
|
-
});
|
673
|
-
this.initialize().catch(err => {
|
674
|
-
throw err;
|
534
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
535
|
+
'name': request.name ?? '',
|
675
536
|
});
|
537
|
+
this.initialize().catch(err => { throw err; });
|
676
538
|
const wrappedCallback = callback
|
677
539
|
? (error, response, rawResponse, _) => {
|
678
540
|
this._log.info('deleteEngine response %j', rawResponse);
|
@@ -680,8 +542,7 @@ class EngineServiceClient {
|
|
680
542
|
}
|
681
543
|
: undefined;
|
682
544
|
this._log.info('deleteEngine request %j', request);
|
683
|
-
return this.innerApiCalls
|
684
|
-
.deleteEngine(request, options, wrappedCallback)
|
545
|
+
return this.innerApiCalls.deleteEngine(request, options, wrappedCallback)
|
685
546
|
?.then(([response, rawResponse, _]) => {
|
686
547
|
this._log.info('deleteEngine response %j', rawResponse);
|
687
548
|
return [response, rawResponse, _];
|
@@ -718,13 +579,10 @@ class EngineServiceClient {
|
|
718
579
|
options = options || {};
|
719
580
|
options.otherArgs = options.otherArgs || {};
|
720
581
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
721
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
722
|
-
|
723
|
-
name: request.name ?? '',
|
724
|
-
});
|
725
|
-
this.initialize().catch(err => {
|
726
|
-
throw err;
|
582
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
583
|
+
'name': request.name ?? '',
|
727
584
|
});
|
585
|
+
this.initialize().catch(err => { throw err; });
|
728
586
|
const wrappedCallback = callback
|
729
587
|
? (error, response, rawResponse, _) => {
|
730
588
|
this._log.info('tuneEngine response %j', rawResponse);
|
@@ -732,8 +590,7 @@ class EngineServiceClient {
|
|
732
590
|
}
|
733
591
|
: undefined;
|
734
592
|
this._log.info('tuneEngine request %j', request);
|
735
|
-
return this.innerApiCalls
|
736
|
-
.tuneEngine(request, options, wrappedCallback)
|
593
|
+
return this.innerApiCalls.tuneEngine(request, options, wrappedCallback)
|
737
594
|
?.then(([response, rawResponse, _]) => {
|
738
595
|
this._log.info('tuneEngine response %j', rawResponse);
|
739
596
|
return [response, rawResponse, _];
|
@@ -770,13 +627,10 @@ class EngineServiceClient {
|
|
770
627
|
options = options || {};
|
771
628
|
options.otherArgs = options.otherArgs || {};
|
772
629
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
773
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
774
|
-
|
775
|
-
parent: request.parent ?? '',
|
776
|
-
});
|
777
|
-
this.initialize().catch(err => {
|
778
|
-
throw err;
|
630
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
631
|
+
'parent': request.parent ?? '',
|
779
632
|
});
|
633
|
+
this.initialize().catch(err => { throw err; });
|
780
634
|
const wrappedCallback = callback
|
781
635
|
? (error, values, nextPageRequest, rawResponse) => {
|
782
636
|
this._log.info('listEngines values %j', values);
|
@@ -821,15 +675,12 @@ class EngineServiceClient {
|
|
821
675
|
options = options || {};
|
822
676
|
options.otherArgs = options.otherArgs || {};
|
823
677
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
824
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
825
|
-
|
826
|
-
|
827
|
-
});
|
678
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
679
|
+
'parent': request.parent ?? '',
|
680
|
+
});
|
828
681
|
const defaultCallSettings = this._defaults['listEngines'];
|
829
682
|
const callSettings = defaultCallSettings.merge(options);
|
830
|
-
this.initialize().catch(err => {
|
831
|
-
throw err;
|
832
|
-
});
|
683
|
+
this.initialize().catch(err => { throw err; });
|
833
684
|
this._log.info('listEngines stream %j', request);
|
834
685
|
return this.descriptors.page.listEngines.createStream(this.innerApiCalls.listEngines, request, callSettings);
|
835
686
|
}
|
@@ -866,103 +717,100 @@ class EngineServiceClient {
|
|
866
717
|
options = options || {};
|
867
718
|
options.otherArgs = options.otherArgs || {};
|
868
719
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
869
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
870
|
-
|
871
|
-
|
872
|
-
});
|
720
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
721
|
+
'parent': request.parent ?? '',
|
722
|
+
});
|
873
723
|
const defaultCallSettings = this._defaults['listEngines'];
|
874
724
|
const callSettings = defaultCallSettings.merge(options);
|
875
|
-
this.initialize().catch(err => {
|
876
|
-
throw err;
|
877
|
-
});
|
725
|
+
this.initialize().catch(err => { throw err; });
|
878
726
|
this._log.info('listEngines iterate %j', request);
|
879
727
|
return this.descriptors.page.listEngines.asyncIterate(this.innerApiCalls['listEngines'], request, callSettings);
|
880
728
|
}
|
881
729
|
/**
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
730
|
+
* Gets information about a location.
|
731
|
+
*
|
732
|
+
* @param {Object} request
|
733
|
+
* The request object that will be sent.
|
734
|
+
* @param {string} request.name
|
735
|
+
* Resource name for the location.
|
736
|
+
* @param {object} [options]
|
737
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
738
|
+
* @returns {Promise} - The promise which resolves to an array.
|
739
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
740
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
741
|
+
* for more details and examples.
|
742
|
+
* @example
|
743
|
+
* ```
|
744
|
+
* const [response] = await client.getLocation(request);
|
745
|
+
* ```
|
746
|
+
*/
|
899
747
|
getLocation(request, options, callback) {
|
900
748
|
return this.locationsClient.getLocation(request, options, callback);
|
901
749
|
}
|
902
750
|
/**
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
751
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
752
|
+
*
|
753
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
754
|
+
* @param {Object} request
|
755
|
+
* The request object that will be sent.
|
756
|
+
* @param {string} request.name
|
757
|
+
* The resource that owns the locations collection, if applicable.
|
758
|
+
* @param {string} request.filter
|
759
|
+
* The standard list filter.
|
760
|
+
* @param {number} request.pageSize
|
761
|
+
* The standard list page size.
|
762
|
+
* @param {string} request.pageToken
|
763
|
+
* The standard list page token.
|
764
|
+
* @param {object} [options]
|
765
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
766
|
+
* @returns {Object}
|
767
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
768
|
+
* When you iterate the returned iterable, each element will be an object representing
|
769
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
770
|
+
* so you can stop the iteration when you don't need more results.
|
771
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
772
|
+
* for more details and examples.
|
773
|
+
* @example
|
774
|
+
* ```
|
775
|
+
* const iterable = client.listLocationsAsync(request);
|
776
|
+
* for await (const response of iterable) {
|
777
|
+
* // process response
|
778
|
+
* }
|
779
|
+
* ```
|
780
|
+
*/
|
933
781
|
listLocationsAsync(request, options) {
|
934
782
|
return this.locationsClient.listLocationsAsync(request, options);
|
935
783
|
}
|
936
784
|
/**
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
785
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
786
|
+
* method to poll the operation result at intervals as recommended by the API
|
787
|
+
* service.
|
788
|
+
*
|
789
|
+
* @param {Object} request - The request object that will be sent.
|
790
|
+
* @param {string} request.name - The name of the operation resource.
|
791
|
+
* @param {Object=} options
|
792
|
+
* Optional parameters. You can override the default settings for this call,
|
793
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
794
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
795
|
+
* for the details.
|
796
|
+
* @param {function(?Error, ?Object)=} callback
|
797
|
+
* The function which will be called with the result of the API call.
|
798
|
+
*
|
799
|
+
* The second parameter to the callback is an object representing
|
800
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
801
|
+
* @return {Promise} - The promise which resolves to an array.
|
802
|
+
* The first element of the array is an object representing
|
803
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
804
|
+
* The promise has a method named "cancel" which cancels the ongoing API call.
|
805
|
+
*
|
806
|
+
* @example
|
807
|
+
* ```
|
808
|
+
* const client = longrunning.operationsClient();
|
809
|
+
* const name = '';
|
810
|
+
* const [response] = await client.getOperation({name});
|
811
|
+
* // doThingsWith(response)
|
812
|
+
* ```
|
813
|
+
*/
|
966
814
|
getOperation(request, optionsOrCallback, callback) {
|
967
815
|
let options;
|
968
816
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
@@ -1139,8 +987,7 @@ class EngineServiceClient {
|
|
1139
987
|
* @returns {string} A string representing the project.
|
1140
988
|
*/
|
1141
989
|
matchProjectFromCollectionName(collectionName) {
|
1142
|
-
return this.pathTemplates.collectionPathTemplate.match(collectionName)
|
1143
|
-
.project;
|
990
|
+
return this.pathTemplates.collectionPathTemplate.match(collectionName).project;
|
1144
991
|
}
|
1145
992
|
/**
|
1146
993
|
* Parse the location from Collection resource.
|
@@ -1150,8 +997,7 @@ class EngineServiceClient {
|
|
1150
997
|
* @returns {string} A string representing the location.
|
1151
998
|
*/
|
1152
999
|
matchLocationFromCollectionName(collectionName) {
|
1153
|
-
return this.pathTemplates.collectionPathTemplate.match(collectionName)
|
1154
|
-
.location;
|
1000
|
+
return this.pathTemplates.collectionPathTemplate.match(collectionName).location;
|
1155
1001
|
}
|
1156
1002
|
/**
|
1157
1003
|
* Parse the collection from Collection resource.
|
@@ -1161,8 +1007,7 @@ class EngineServiceClient {
|
|
1161
1007
|
* @returns {string} A string representing the collection.
|
1162
1008
|
*/
|
1163
1009
|
matchCollectionFromCollectionName(collectionName) {
|
1164
|
-
return this.pathTemplates.collectionPathTemplate.match(collectionName)
|
1165
|
-
.collection;
|
1010
|
+
return this.pathTemplates.collectionPathTemplate.match(collectionName).collection;
|
1166
1011
|
}
|
1167
1012
|
/**
|
1168
1013
|
* Return a fully-qualified engine resource name string.
|
@@ -1244,8 +1089,7 @@ class EngineServiceClient {
|
|
1244
1089
|
* @returns {string} A string representing the project.
|
1245
1090
|
*/
|
1246
1091
|
matchProjectFromEvaluationName(evaluationName) {
|
1247
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
1248
|
-
.project;
|
1092
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
|
1249
1093
|
}
|
1250
1094
|
/**
|
1251
1095
|
* Parse the location from Evaluation resource.
|
@@ -1255,8 +1099,7 @@ class EngineServiceClient {
|
|
1255
1099
|
* @returns {string} A string representing the location.
|
1256
1100
|
*/
|
1257
1101
|
matchLocationFromEvaluationName(evaluationName) {
|
1258
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
1259
|
-
.location;
|
1102
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
|
1260
1103
|
}
|
1261
1104
|
/**
|
1262
1105
|
* Parse the evaluation from Evaluation resource.
|
@@ -1266,8 +1109,7 @@ class EngineServiceClient {
|
|
1266
1109
|
* @returns {string} A string representing the evaluation.
|
1267
1110
|
*/
|
1268
1111
|
matchEvaluationFromEvaluationName(evaluationName) {
|
1269
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
1270
|
-
.evaluation;
|
1112
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
|
1271
1113
|
}
|
1272
1114
|
/**
|
1273
1115
|
* Return a fully-qualified groundingConfig resource name string.
|
@@ -3505,8 +3347,7 @@ class EngineServiceClient {
|
|
3505
3347
|
* @returns {string} A string representing the project.
|
3506
3348
|
*/
|
3507
3349
|
matchProjectFromSampleQueryName(sampleQueryName) {
|
3508
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3509
|
-
.project;
|
3350
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
|
3510
3351
|
}
|
3511
3352
|
/**
|
3512
3353
|
* Parse the location from SampleQuery resource.
|
@@ -3516,8 +3357,7 @@ class EngineServiceClient {
|
|
3516
3357
|
* @returns {string} A string representing the location.
|
3517
3358
|
*/
|
3518
3359
|
matchLocationFromSampleQueryName(sampleQueryName) {
|
3519
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3520
|
-
.location;
|
3360
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
|
3521
3361
|
}
|
3522
3362
|
/**
|
3523
3363
|
* Parse the sample_query_set from SampleQuery resource.
|
@@ -3527,8 +3367,7 @@ class EngineServiceClient {
|
|
3527
3367
|
* @returns {string} A string representing the sample_query_set.
|
3528
3368
|
*/
|
3529
3369
|
matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
|
3530
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3531
|
-
.sample_query_set;
|
3370
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
|
3532
3371
|
}
|
3533
3372
|
/**
|
3534
3373
|
* Parse the sample_query from SampleQuery resource.
|
@@ -3538,8 +3377,7 @@ class EngineServiceClient {
|
|
3538
3377
|
* @returns {string} A string representing the sample_query.
|
3539
3378
|
*/
|
3540
3379
|
matchSampleQueryFromSampleQueryName(sampleQueryName) {
|
3541
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3542
|
-
.sample_query;
|
3380
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
|
3543
3381
|
}
|
3544
3382
|
/**
|
3545
3383
|
* Return a fully-qualified sampleQuerySet resource name string.
|
@@ -3598,8 +3436,8 @@ class EngineServiceClient {
|
|
3598
3436
|
this._log.info('ending gRPC channel');
|
3599
3437
|
this._terminated = true;
|
3600
3438
|
stub.close();
|
3601
|
-
this.locationsClient.close();
|
3602
|
-
this.operationsClient.close();
|
3439
|
+
this.locationsClient.close().catch(err => { throw err; });
|
3440
|
+
void this.operationsClient.close();
|
3603
3441
|
});
|
3604
3442
|
}
|
3605
3443
|
return Promise.resolve();
|