@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
@@ -100,26 +100,17 @@ class DocumentServiceClient {
|
|
100
100
|
constructor(opts, gaxInstance) {
|
101
101
|
// Ensure that options include all the required fields.
|
102
102
|
const staticMembers = this.constructor;
|
103
|
-
if (opts?.universe_domain &&
|
104
|
-
opts?.universeDomain &&
|
105
|
-
opts?.universe_domain !== opts?.universeDomain) {
|
103
|
+
if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
|
106
104
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
107
105
|
}
|
108
|
-
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
109
|
-
|
110
|
-
: undefined;
|
111
|
-
this._universeDomain =
|
112
|
-
opts?.universeDomain ??
|
113
|
-
opts?.universe_domain ??
|
114
|
-
universeDomainEnvVar ??
|
115
|
-
'googleapis.com';
|
106
|
+
const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
|
107
|
+
this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
|
116
108
|
this._servicePath = 'discoveryengine.' + this._universeDomain;
|
117
109
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
118
110
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
119
111
|
const port = opts?.port || staticMembers.port;
|
120
112
|
const clientConfig = opts?.clientConfig ?? {};
|
121
|
-
const fallback = opts?.fallback ??
|
122
|
-
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
113
|
+
const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
123
114
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
124
115
|
// Request numeric enum values if REST transport is used.
|
125
116
|
opts.numericEnums = true;
|
@@ -149,7 +140,10 @@ class DocumentServiceClient {
|
|
149
140
|
}
|
150
141
|
this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
|
151
142
|
// Determine the client header string.
|
152
|
-
const clientHeader = [
|
143
|
+
const clientHeader = [
|
144
|
+
`gax/${this._gaxModule.version}`,
|
145
|
+
`gapic/${version}`,
|
146
|
+
];
|
153
147
|
if (typeof process === 'object' && 'versions' in process) {
|
154
148
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
155
149
|
}
|
@@ -215,7 +209,7 @@ class DocumentServiceClient {
|
|
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
|
-
listDocuments: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documents')
|
212
|
+
listDocuments: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documents')
|
219
213
|
};
|
220
214
|
const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
221
215
|
// This API contains "long-running operations", which return a
|
@@ -223,128 +217,23 @@ class DocumentServiceClient {
|
|
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: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
|
238
|
-
body: '*',
|
239
|
-
},
|
240
|
-
],
|
241
|
-
},
|
242
|
-
{
|
243
|
-
selector: 'google.longrunning.Operations.GetOperation',
|
244
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
|
245
|
-
additional_bindings: [
|
246
|
-
{
|
247
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
|
248
|
-
},
|
249
|
-
{
|
250
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
|
251
|
-
},
|
252
|
-
{
|
253
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
|
254
|
-
},
|
255
|
-
{
|
256
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
|
257
|
-
},
|
258
|
-
{
|
259
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
|
260
|
-
},
|
261
|
-
{
|
262
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
|
263
|
-
},
|
264
|
-
{
|
265
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
|
266
|
-
},
|
267
|
-
{
|
268
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}',
|
269
|
-
},
|
270
|
-
{
|
271
|
-
get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
|
272
|
-
},
|
273
|
-
{
|
274
|
-
get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
|
275
|
-
},
|
276
|
-
{
|
277
|
-
get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}',
|
278
|
-
},
|
279
|
-
{
|
280
|
-
get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}',
|
281
|
-
},
|
282
|
-
{
|
283
|
-
get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}',
|
284
|
-
},
|
285
|
-
{ get: '/v1alpha/{name=projects/*/locations/*/operations/*}' },
|
286
|
-
{
|
287
|
-
get: '/v1alpha/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}',
|
288
|
-
},
|
289
|
-
{ get: '/v1alpha/{name=projects/*/operations/*}' },
|
290
|
-
],
|
291
|
-
},
|
292
|
-
{
|
293
|
-
selector: 'google.longrunning.Operations.ListOperations',
|
294
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
|
295
|
-
additional_bindings: [
|
296
|
-
{
|
297
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
|
298
|
-
},
|
299
|
-
{
|
300
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
|
301
|
-
},
|
302
|
-
{
|
303
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
|
304
|
-
},
|
305
|
-
{
|
306
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
|
307
|
-
},
|
308
|
-
{
|
309
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
|
310
|
-
},
|
311
|
-
{
|
312
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
|
313
|
-
},
|
314
|
-
{
|
315
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations',
|
316
|
-
},
|
317
|
-
{
|
318
|
-
get: '/v1alpha/{name=projects/*/locations/*/collections/*}/operations',
|
319
|
-
},
|
320
|
-
{
|
321
|
-
get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
|
322
|
-
},
|
323
|
-
{
|
324
|
-
get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
|
325
|
-
},
|
326
|
-
{
|
327
|
-
get: '/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations',
|
328
|
-
},
|
329
|
-
{
|
330
|
-
get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*}/operations',
|
331
|
-
},
|
332
|
-
{ get: '/v1alpha/{name=projects/*/locations/*}/operations' },
|
333
|
-
{ get: '/v1alpha/{name=projects/*}/operations' },
|
334
|
-
],
|
335
|
-
},
|
336
|
-
];
|
224
|
+
lroOptions.httpRules = [{ selector: 'google.longrunning.Operations.CancelOperation', post: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', additional_bindings: [{ post: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }],
|
225
|
+
}, { selector: 'google.longrunning.Operations.GetOperation', get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', additional_bindings: [{ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/locations/*/sampleQuerySets/*/operations/*}', }, { get: '/v1alpha/{name=projects/*/operations/*}', }],
|
226
|
+
}, { selector: 'google.longrunning.Operations.ListOperations', get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}/operations', additional_bindings: [{ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/collections/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', }, { get: '/v1alpha/{name=projects/*/locations/*}/operations', }, { get: '/v1alpha/{name=projects/*}/operations', }],
|
227
|
+
}];
|
337
228
|
}
|
338
|
-
this.operationsClient = this._gaxModule
|
339
|
-
.lro(lroOptions)
|
340
|
-
.operationsClient(opts);
|
229
|
+
this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
|
341
230
|
const importDocumentsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse');
|
342
231
|
const importDocumentsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata');
|
343
232
|
const purgeDocumentsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse');
|
344
233
|
const purgeDocumentsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata');
|
345
234
|
this.descriptors.longrunning = {
|
346
235
|
importDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importDocumentsResponse.decode.bind(importDocumentsResponse), importDocumentsMetadata.decode.bind(importDocumentsMetadata)),
|
347
|
-
purgeDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeDocumentsResponse.decode.bind(purgeDocumentsResponse), purgeDocumentsMetadata.decode.bind(purgeDocumentsMetadata))
|
236
|
+
purgeDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeDocumentsResponse.decode.bind(purgeDocumentsResponse), purgeDocumentsMetadata.decode.bind(purgeDocumentsMetadata))
|
348
237
|
};
|
349
238
|
// Put together the default options sent with requests.
|
350
239
|
this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1alpha.DocumentService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
@@ -373,24 +262,13 @@ class DocumentServiceClient {
|
|
373
262
|
}
|
374
263
|
// Put together the "service stub" for
|
375
264
|
// google.cloud.discoveryengine.v1alpha.DocumentService.
|
376
|
-
this.documentServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
.DocumentService, this._opts, this._providedCustomServicePath);
|
265
|
+
this.documentServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
266
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1alpha.DocumentService') :
|
267
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
268
|
+
this._protos.google.cloud.discoveryengine.v1alpha.DocumentService, this._opts, this._providedCustomServicePath);
|
381
269
|
// Iterate over each of the methods that the service provides
|
382
270
|
// and create an API call method for each.
|
383
|
-
const documentServiceStubMethods = [
|
384
|
-
'getDocument',
|
385
|
-
'listDocuments',
|
386
|
-
'createDocument',
|
387
|
-
'updateDocument',
|
388
|
-
'deleteDocument',
|
389
|
-
'importDocuments',
|
390
|
-
'purgeDocuments',
|
391
|
-
'getProcessedDocument',
|
392
|
-
'batchGetDocumentsMetadata',
|
393
|
-
];
|
271
|
+
const documentServiceStubMethods = ['getDocument', 'listDocuments', 'createDocument', 'updateDocument', 'deleteDocument', 'importDocuments', 'purgeDocuments', 'getProcessedDocument', 'batchGetDocumentsMetadata'];
|
394
272
|
for (const methodName of documentServiceStubMethods) {
|
395
273
|
const callPromise = this.documentServiceStub.then(stub => (...args) => {
|
396
274
|
if (this._terminated) {
|
@@ -415,8 +293,7 @@ class DocumentServiceClient {
|
|
415
293
|
* @returns {string} The DNS address for this service.
|
416
294
|
*/
|
417
295
|
static get servicePath() {
|
418
|
-
if (typeof process === 'object' &&
|
419
|
-
typeof process.emitWarning === 'function') {
|
296
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
420
297
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
421
298
|
}
|
422
299
|
return 'discoveryengine.googleapis.com';
|
@@ -427,8 +304,7 @@ class DocumentServiceClient {
|
|
427
304
|
* @returns {string} The DNS address for this service.
|
428
305
|
*/
|
429
306
|
static get apiEndpoint() {
|
430
|
-
if (typeof process === 'object' &&
|
431
|
-
typeof process.emitWarning === 'function') {
|
307
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
432
308
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
433
309
|
}
|
434
310
|
return 'discoveryengine.googleapis.com';
|
@@ -456,7 +332,9 @@ class DocumentServiceClient {
|
|
456
332
|
* @returns {string[]} List of default scopes.
|
457
333
|
*/
|
458
334
|
static get scopes() {
|
459
|
-
return [
|
335
|
+
return [
|
336
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
337
|
+
];
|
460
338
|
}
|
461
339
|
/**
|
462
340
|
* Return the project ID used by this class.
|
@@ -482,13 +360,10 @@ class DocumentServiceClient {
|
|
482
360
|
options = options || {};
|
483
361
|
options.otherArgs = options.otherArgs || {};
|
484
362
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
485
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
486
|
-
|
487
|
-
name: request.name ?? '',
|
488
|
-
});
|
489
|
-
this.initialize().catch(err => {
|
490
|
-
throw err;
|
363
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
364
|
+
'name': request.name ?? '',
|
491
365
|
});
|
366
|
+
this.initialize().catch(err => { throw err; });
|
492
367
|
this._log.info('getDocument request %j', request);
|
493
368
|
const wrappedCallback = callback
|
494
369
|
? (error, response, options, rawResponse) => {
|
@@ -496,8 +371,7 @@ class DocumentServiceClient {
|
|
496
371
|
callback(error, response, options, rawResponse); // We verified callback above.
|
497
372
|
}
|
498
373
|
: undefined;
|
499
|
-
return this.innerApiCalls
|
500
|
-
.getDocument(request, options, wrappedCallback)
|
374
|
+
return this.innerApiCalls.getDocument(request, options, wrappedCallback)
|
501
375
|
?.then(([response, options, rawResponse]) => {
|
502
376
|
this._log.info('getDocument response %j', response);
|
503
377
|
return [response, options, rawResponse];
|
@@ -516,13 +390,10 @@ class DocumentServiceClient {
|
|
516
390
|
options = options || {};
|
517
391
|
options.otherArgs = options.otherArgs || {};
|
518
392
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
519
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
520
|
-
|
521
|
-
parent: request.parent ?? '',
|
522
|
-
});
|
523
|
-
this.initialize().catch(err => {
|
524
|
-
throw err;
|
393
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
394
|
+
'parent': request.parent ?? '',
|
525
395
|
});
|
396
|
+
this.initialize().catch(err => { throw err; });
|
526
397
|
this._log.info('createDocument request %j', request);
|
527
398
|
const wrappedCallback = callback
|
528
399
|
? (error, response, options, rawResponse) => {
|
@@ -530,8 +401,7 @@ class DocumentServiceClient {
|
|
530
401
|
callback(error, response, options, rawResponse); // We verified callback above.
|
531
402
|
}
|
532
403
|
: undefined;
|
533
|
-
return this.innerApiCalls
|
534
|
-
.createDocument(request, options, wrappedCallback)
|
404
|
+
return this.innerApiCalls.createDocument(request, options, wrappedCallback)
|
535
405
|
?.then(([response, options, rawResponse]) => {
|
536
406
|
this._log.info('createDocument response %j', response);
|
537
407
|
return [response, options, rawResponse];
|
@@ -550,13 +420,10 @@ class DocumentServiceClient {
|
|
550
420
|
options = options || {};
|
551
421
|
options.otherArgs = options.otherArgs || {};
|
552
422
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
553
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
554
|
-
|
555
|
-
'document.name': request.document.name ?? '',
|
556
|
-
});
|
557
|
-
this.initialize().catch(err => {
|
558
|
-
throw err;
|
423
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
424
|
+
'document.name': request.document.name ?? '',
|
559
425
|
});
|
426
|
+
this.initialize().catch(err => { throw err; });
|
560
427
|
this._log.info('updateDocument request %j', request);
|
561
428
|
const wrappedCallback = callback
|
562
429
|
? (error, response, options, rawResponse) => {
|
@@ -564,8 +431,7 @@ class DocumentServiceClient {
|
|
564
431
|
callback(error, response, options, rawResponse); // We verified callback above.
|
565
432
|
}
|
566
433
|
: undefined;
|
567
|
-
return this.innerApiCalls
|
568
|
-
.updateDocument(request, options, wrappedCallback)
|
434
|
+
return this.innerApiCalls.updateDocument(request, options, wrappedCallback)
|
569
435
|
?.then(([response, options, rawResponse]) => {
|
570
436
|
this._log.info('updateDocument response %j', response);
|
571
437
|
return [response, options, rawResponse];
|
@@ -584,13 +450,10 @@ class DocumentServiceClient {
|
|
584
450
|
options = options || {};
|
585
451
|
options.otherArgs = options.otherArgs || {};
|
586
452
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
587
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
588
|
-
|
589
|
-
name: request.name ?? '',
|
590
|
-
});
|
591
|
-
this.initialize().catch(err => {
|
592
|
-
throw err;
|
453
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
454
|
+
'name': request.name ?? '',
|
593
455
|
});
|
456
|
+
this.initialize().catch(err => { throw err; });
|
594
457
|
this._log.info('deleteDocument request %j', request);
|
595
458
|
const wrappedCallback = callback
|
596
459
|
? (error, response, options, rawResponse) => {
|
@@ -598,8 +461,7 @@ class DocumentServiceClient {
|
|
598
461
|
callback(error, response, options, rawResponse); // We verified callback above.
|
599
462
|
}
|
600
463
|
: undefined;
|
601
|
-
return this.innerApiCalls
|
602
|
-
.deleteDocument(request, options, wrappedCallback)
|
464
|
+
return this.innerApiCalls.deleteDocument(request, options, wrappedCallback)
|
603
465
|
?.then(([response, options, rawResponse]) => {
|
604
466
|
this._log.info('deleteDocument response %j', response);
|
605
467
|
return [response, options, rawResponse];
|
@@ -618,13 +480,10 @@ class DocumentServiceClient {
|
|
618
480
|
options = options || {};
|
619
481
|
options.otherArgs = options.otherArgs || {};
|
620
482
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
621
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
622
|
-
|
623
|
-
name: request.name ?? '',
|
624
|
-
});
|
625
|
-
this.initialize().catch(err => {
|
626
|
-
throw err;
|
483
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
484
|
+
'name': request.name ?? '',
|
627
485
|
});
|
486
|
+
this.initialize().catch(err => { throw err; });
|
628
487
|
this._log.info('getProcessedDocument request %j', request);
|
629
488
|
const wrappedCallback = callback
|
630
489
|
? (error, response, options, rawResponse) => {
|
@@ -632,8 +491,7 @@ class DocumentServiceClient {
|
|
632
491
|
callback(error, response, options, rawResponse); // We verified callback above.
|
633
492
|
}
|
634
493
|
: undefined;
|
635
|
-
return this.innerApiCalls
|
636
|
-
.getProcessedDocument(request, options, wrappedCallback)
|
494
|
+
return this.innerApiCalls.getProcessedDocument(request, options, wrappedCallback)
|
637
495
|
?.then(([response, options, rawResponse]) => {
|
638
496
|
this._log.info('getProcessedDocument response %j', response);
|
639
497
|
return [response, options, rawResponse];
|
@@ -652,13 +510,10 @@ class DocumentServiceClient {
|
|
652
510
|
options = options || {};
|
653
511
|
options.otherArgs = options.otherArgs || {};
|
654
512
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
655
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
656
|
-
|
657
|
-
parent: request.parent ?? '',
|
658
|
-
});
|
659
|
-
this.initialize().catch(err => {
|
660
|
-
throw err;
|
513
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
514
|
+
'parent': request.parent ?? '',
|
661
515
|
});
|
516
|
+
this.initialize().catch(err => { throw err; });
|
662
517
|
this._log.info('batchGetDocumentsMetadata request %j', request);
|
663
518
|
const wrappedCallback = callback
|
664
519
|
? (error, response, options, rawResponse) => {
|
@@ -666,8 +521,7 @@ class DocumentServiceClient {
|
|
666
521
|
callback(error, response, options, rawResponse); // We verified callback above.
|
667
522
|
}
|
668
523
|
: undefined;
|
669
|
-
return this.innerApiCalls
|
670
|
-
.batchGetDocumentsMetadata(request, options, wrappedCallback)
|
524
|
+
return this.innerApiCalls.batchGetDocumentsMetadata(request, options, wrappedCallback)
|
671
525
|
?.then(([response, options, rawResponse]) => {
|
672
526
|
this._log.info('batchGetDocumentsMetadata response %j', response);
|
673
527
|
return [response, options, rawResponse];
|
@@ -686,13 +540,10 @@ class DocumentServiceClient {
|
|
686
540
|
options = options || {};
|
687
541
|
options.otherArgs = options.otherArgs || {};
|
688
542
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
689
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
690
|
-
|
691
|
-
parent: request.parent ?? '',
|
692
|
-
});
|
693
|
-
this.initialize().catch(err => {
|
694
|
-
throw err;
|
543
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
544
|
+
'parent': request.parent ?? '',
|
695
545
|
});
|
546
|
+
this.initialize().catch(err => { throw err; });
|
696
547
|
const wrappedCallback = callback
|
697
548
|
? (error, response, rawResponse, _) => {
|
698
549
|
this._log.info('importDocuments response %j', rawResponse);
|
@@ -700,8 +551,7 @@ class DocumentServiceClient {
|
|
700
551
|
}
|
701
552
|
: undefined;
|
702
553
|
this._log.info('importDocuments request %j', request);
|
703
|
-
return this.innerApiCalls
|
704
|
-
.importDocuments(request, options, wrappedCallback)
|
554
|
+
return this.innerApiCalls.importDocuments(request, options, wrappedCallback)
|
705
555
|
?.then(([response, rawResponse, _]) => {
|
706
556
|
this._log.info('importDocuments response %j', rawResponse);
|
707
557
|
return [response, rawResponse, _];
|
@@ -738,13 +588,10 @@ class DocumentServiceClient {
|
|
738
588
|
options = options || {};
|
739
589
|
options.otherArgs = options.otherArgs || {};
|
740
590
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
741
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
742
|
-
|
743
|
-
parent: request.parent ?? '',
|
744
|
-
});
|
745
|
-
this.initialize().catch(err => {
|
746
|
-
throw err;
|
591
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
592
|
+
'parent': request.parent ?? '',
|
747
593
|
});
|
594
|
+
this.initialize().catch(err => { throw err; });
|
748
595
|
const wrappedCallback = callback
|
749
596
|
? (error, response, rawResponse, _) => {
|
750
597
|
this._log.info('purgeDocuments response %j', rawResponse);
|
@@ -752,8 +599,7 @@ class DocumentServiceClient {
|
|
752
599
|
}
|
753
600
|
: undefined;
|
754
601
|
this._log.info('purgeDocuments request %j', request);
|
755
|
-
return this.innerApiCalls
|
756
|
-
.purgeDocuments(request, options, wrappedCallback)
|
602
|
+
return this.innerApiCalls.purgeDocuments(request, options, wrappedCallback)
|
757
603
|
?.then(([response, rawResponse, _]) => {
|
758
604
|
this._log.info('purgeDocuments response %j', rawResponse);
|
759
605
|
return [response, rawResponse, _];
|
@@ -790,13 +636,10 @@ class DocumentServiceClient {
|
|
790
636
|
options = options || {};
|
791
637
|
options.otherArgs = options.otherArgs || {};
|
792
638
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
793
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
794
|
-
|
795
|
-
parent: request.parent ?? '',
|
796
|
-
});
|
797
|
-
this.initialize().catch(err => {
|
798
|
-
throw err;
|
639
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
640
|
+
'parent': request.parent ?? '',
|
799
641
|
});
|
642
|
+
this.initialize().catch(err => { throw err; });
|
800
643
|
const wrappedCallback = callback
|
801
644
|
? (error, values, nextPageRequest, rawResponse) => {
|
802
645
|
this._log.info('listDocuments values %j', values);
|
@@ -859,15 +702,12 @@ class DocumentServiceClient {
|
|
859
702
|
options = options || {};
|
860
703
|
options.otherArgs = options.otherArgs || {};
|
861
704
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
862
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
863
|
-
|
864
|
-
|
865
|
-
});
|
705
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
706
|
+
'parent': request.parent ?? '',
|
707
|
+
});
|
866
708
|
const defaultCallSettings = this._defaults['listDocuments'];
|
867
709
|
const callSettings = defaultCallSettings.merge(options);
|
868
|
-
this.initialize().catch(err => {
|
869
|
-
throw err;
|
870
|
-
});
|
710
|
+
this.initialize().catch(err => { throw err; });
|
871
711
|
this._log.info('listDocuments stream %j', request);
|
872
712
|
return this.descriptors.page.listDocuments.createStream(this.innerApiCalls.listDocuments, request, callSettings);
|
873
713
|
}
|
@@ -922,103 +762,100 @@ class DocumentServiceClient {
|
|
922
762
|
options = options || {};
|
923
763
|
options.otherArgs = options.otherArgs || {};
|
924
764
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
925
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
926
|
-
|
927
|
-
|
928
|
-
});
|
765
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
766
|
+
'parent': request.parent ?? '',
|
767
|
+
});
|
929
768
|
const defaultCallSettings = this._defaults['listDocuments'];
|
930
769
|
const callSettings = defaultCallSettings.merge(options);
|
931
|
-
this.initialize().catch(err => {
|
932
|
-
throw err;
|
933
|
-
});
|
770
|
+
this.initialize().catch(err => { throw err; });
|
934
771
|
this._log.info('listDocuments iterate %j', request);
|
935
772
|
return this.descriptors.page.listDocuments.asyncIterate(this.innerApiCalls['listDocuments'], request, callSettings);
|
936
773
|
}
|
937
774
|
/**
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
775
|
+
* Gets information about a location.
|
776
|
+
*
|
777
|
+
* @param {Object} request
|
778
|
+
* The request object that will be sent.
|
779
|
+
* @param {string} request.name
|
780
|
+
* Resource name for the location.
|
781
|
+
* @param {object} [options]
|
782
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
783
|
+
* @returns {Promise} - The promise which resolves to an array.
|
784
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
785
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
786
|
+
* for more details and examples.
|
787
|
+
* @example
|
788
|
+
* ```
|
789
|
+
* const [response] = await client.getLocation(request);
|
790
|
+
* ```
|
791
|
+
*/
|
955
792
|
getLocation(request, options, callback) {
|
956
793
|
return this.locationsClient.getLocation(request, options, callback);
|
957
794
|
}
|
958
795
|
/**
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
796
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
797
|
+
*
|
798
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
799
|
+
* @param {Object} request
|
800
|
+
* The request object that will be sent.
|
801
|
+
* @param {string} request.name
|
802
|
+
* The resource that owns the locations collection, if applicable.
|
803
|
+
* @param {string} request.filter
|
804
|
+
* The standard list filter.
|
805
|
+
* @param {number} request.pageSize
|
806
|
+
* The standard list page size.
|
807
|
+
* @param {string} request.pageToken
|
808
|
+
* The standard list page token.
|
809
|
+
* @param {object} [options]
|
810
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
811
|
+
* @returns {Object}
|
812
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
813
|
+
* When you iterate the returned iterable, each element will be an object representing
|
814
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
815
|
+
* so you can stop the iteration when you don't need more results.
|
816
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
817
|
+
* for more details and examples.
|
818
|
+
* @example
|
819
|
+
* ```
|
820
|
+
* const iterable = client.listLocationsAsync(request);
|
821
|
+
* for await (const response of iterable) {
|
822
|
+
* // process response
|
823
|
+
* }
|
824
|
+
* ```
|
825
|
+
*/
|
989
826
|
listLocationsAsync(request, options) {
|
990
827
|
return this.locationsClient.listLocationsAsync(request, options);
|
991
828
|
}
|
992
829
|
/**
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
830
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
831
|
+
* method to poll the operation result at intervals as recommended by the API
|
832
|
+
* service.
|
833
|
+
*
|
834
|
+
* @param {Object} request - The request object that will be sent.
|
835
|
+
* @param {string} request.name - The name of the operation resource.
|
836
|
+
* @param {Object=} options
|
837
|
+
* Optional parameters. You can override the default settings for this call,
|
838
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
839
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
840
|
+
* for the details.
|
841
|
+
* @param {function(?Error, ?Object)=} callback
|
842
|
+
* The function which will be called with the result of the API call.
|
843
|
+
*
|
844
|
+
* The second parameter to the callback is an object representing
|
845
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
846
|
+
* @return {Promise} - The promise which resolves to an array.
|
847
|
+
* The first element of the array is an object representing
|
848
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
849
|
+
* The promise has a method named "cancel" which cancels the ongoing API call.
|
850
|
+
*
|
851
|
+
* @example
|
852
|
+
* ```
|
853
|
+
* const client = longrunning.operationsClient();
|
854
|
+
* const name = '';
|
855
|
+
* const [response] = await client.getOperation({name});
|
856
|
+
* // doThingsWith(response)
|
857
|
+
* ```
|
858
|
+
*/
|
1022
859
|
getOperation(request, optionsOrCallback, callback) {
|
1023
860
|
let options;
|
1024
861
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
@@ -1193,8 +1030,7 @@ class DocumentServiceClient {
|
|
1193
1030
|
* @returns {string} A string representing the project.
|
1194
1031
|
*/
|
1195
1032
|
matchProjectFromAclConfigName(aclConfigName) {
|
1196
|
-
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
|
1197
|
-
.project;
|
1033
|
+
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
|
1198
1034
|
}
|
1199
1035
|
/**
|
1200
1036
|
* Parse the location from AclConfig resource.
|
@@ -1204,8 +1040,7 @@ class DocumentServiceClient {
|
|
1204
1040
|
* @returns {string} A string representing the location.
|
1205
1041
|
*/
|
1206
1042
|
matchLocationFromAclConfigName(aclConfigName) {
|
1207
|
-
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
|
1208
|
-
.location;
|
1043
|
+
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
|
1209
1044
|
}
|
1210
1045
|
/**
|
1211
1046
|
* Return a fully-qualified engine resource name string.
|
@@ -1287,8 +1122,7 @@ class DocumentServiceClient {
|
|
1287
1122
|
* @returns {string} A string representing the project.
|
1288
1123
|
*/
|
1289
1124
|
matchProjectFromEvaluationName(evaluationName) {
|
1290
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
1291
|
-
.project;
|
1125
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
|
1292
1126
|
}
|
1293
1127
|
/**
|
1294
1128
|
* Parse the location from Evaluation resource.
|
@@ -1298,8 +1132,7 @@ class DocumentServiceClient {
|
|
1298
1132
|
* @returns {string} A string representing the location.
|
1299
1133
|
*/
|
1300
1134
|
matchLocationFromEvaluationName(evaluationName) {
|
1301
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
1302
|
-
.location;
|
1135
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
|
1303
1136
|
}
|
1304
1137
|
/**
|
1305
1138
|
* Parse the evaluation from Evaluation resource.
|
@@ -1309,8 +1142,7 @@ class DocumentServiceClient {
|
|
1309
1142
|
* @returns {string} A string representing the evaluation.
|
1310
1143
|
*/
|
1311
1144
|
matchEvaluationFromEvaluationName(evaluationName) {
|
1312
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
1313
|
-
.evaluation;
|
1145
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
|
1314
1146
|
}
|
1315
1147
|
/**
|
1316
1148
|
* Return a fully-qualified project resource name string.
|
@@ -3503,8 +3335,7 @@ class DocumentServiceClient {
|
|
3503
3335
|
* @returns {string} A string representing the project.
|
3504
3336
|
*/
|
3505
3337
|
matchProjectFromSampleQueryName(sampleQueryName) {
|
3506
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3507
|
-
.project;
|
3338
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
|
3508
3339
|
}
|
3509
3340
|
/**
|
3510
3341
|
* Parse the location from SampleQuery resource.
|
@@ -3514,8 +3345,7 @@ class DocumentServiceClient {
|
|
3514
3345
|
* @returns {string} A string representing the location.
|
3515
3346
|
*/
|
3516
3347
|
matchLocationFromSampleQueryName(sampleQueryName) {
|
3517
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3518
|
-
.location;
|
3348
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
|
3519
3349
|
}
|
3520
3350
|
/**
|
3521
3351
|
* Parse the sample_query_set from SampleQuery resource.
|
@@ -3525,8 +3355,7 @@ class DocumentServiceClient {
|
|
3525
3355
|
* @returns {string} A string representing the sample_query_set.
|
3526
3356
|
*/
|
3527
3357
|
matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
|
3528
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3529
|
-
.sample_query_set;
|
3358
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
|
3530
3359
|
}
|
3531
3360
|
/**
|
3532
3361
|
* Parse the sample_query from SampleQuery resource.
|
@@ -3536,8 +3365,7 @@ class DocumentServiceClient {
|
|
3536
3365
|
* @returns {string} A string representing the sample_query.
|
3537
3366
|
*/
|
3538
3367
|
matchSampleQueryFromSampleQueryName(sampleQueryName) {
|
3539
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3540
|
-
.sample_query;
|
3368
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
|
3541
3369
|
}
|
3542
3370
|
/**
|
3543
3371
|
* Return a fully-qualified sampleQuerySet resource name string.
|
@@ -3596,8 +3424,8 @@ class DocumentServiceClient {
|
|
3596
3424
|
this._log.info('ending gRPC channel');
|
3597
3425
|
this._terminated = true;
|
3598
3426
|
stub.close();
|
3599
|
-
this.locationsClient.close();
|
3600
|
-
this.operationsClient.close();
|
3427
|
+
this.locationsClient.close().catch(err => { throw err; });
|
3428
|
+
void this.operationsClient.close();
|
3601
3429
|
});
|
3602
3430
|
}
|
3603
3431
|
return Promise.resolve();
|