@google-cloud/discoveryengine 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/build/protos/google/cloud/discoveryengine/v1/answer.proto +17 -0
- package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +52 -0
- package/build/protos/google/cloud/discoveryengine/v1/cmek_config_service.proto +300 -0
- package/build/protos/google/cloud/discoveryengine/v1/common.proto +67 -0
- package/build/protos/google/cloud/discoveryengine/v1/control.proto +1 -3
- package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +3 -0
- package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +54 -2
- package/build/protos/google/cloud/discoveryengine/v1/data_store_service.proto +14 -0
- package/build/protos/google/cloud/discoveryengine/v1/document.proto +95 -4
- package/build/protos/google/cloud/discoveryengine/v1/document_processing_config.proto +28 -1
- package/build/protos/google/cloud/discoveryengine/v1/engine.proto +131 -6
- package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +8 -0
- package/build/protos/google/cloud/discoveryengine/v1/grounding.proto +9 -0
- package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store.proto +84 -0
- package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store_service.proto +375 -0
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +6 -0
- package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +6 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_license.proto +98 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_license_service.proto +191 -0
- package/build/protos/protos.d.ts +5415 -578
- package/build/protos/protos.js +77830 -63391
- package/build/protos/protos.json +1537 -92
- package/build/src/index.d.ts +10 -1
- package/build/src/index.js +8 -22
- package/build/src/v1/cmek_config_service_client.d.ts +2287 -0
- package/build/src/v1/cmek_config_service_client.js +3274 -0
- package/build/src/v1/cmek_config_service_client_config.json +42 -0
- package/build/src/v1/cmek_config_service_proto_list.json +44 -0
- package/build/src/v1/completion_service_client.d.ts +166 -76
- package/build/src/v1/completion_service_client.js +258 -263
- package/build/src/v1/completion_service_proto_list.json +6 -1
- package/build/src/v1/control_service_client.d.ts +171 -81
- package/build/src/v1/control_service_client.js +246 -132
- package/build/src/v1/control_service_proto_list.json +6 -1
- package/build/src/v1/conversational_search_service_client.d.ts +233 -143
- package/build/src/v1/conversational_search_service_client.js +330 -226
- package/build/src/v1/conversational_search_service_proto_list.json +6 -1
- package/build/src/v1/data_store_service_client.d.ts +218 -122
- package/build/src/v1/data_store_service_client.js +273 -281
- package/build/src/v1/data_store_service_proto_list.json +6 -1
- package/build/src/v1/document_service_client.d.ts +210 -120
- package/build/src/v1/document_service_client.js +300 -301
- package/build/src/v1/document_service_proto_list.json +6 -1
- package/build/src/v1/engine_service_client.d.ts +193 -103
- package/build/src/v1/engine_service_client.js +273 -280
- package/build/src/v1/engine_service_proto_list.json +6 -1
- package/build/src/v1/gapic_metadata.json +184 -0
- package/build/src/v1/grounded_generation_service_client.d.ts +138 -48
- package/build/src/v1/grounded_generation_service_client.js +217 -100
- package/build/src/v1/grounded_generation_service_proto_list.json +6 -1
- package/build/src/v1/identity_mapping_store_service_client.d.ts +2470 -0
- package/build/src/v1/identity_mapping_store_service_client.js +3449 -0
- package/build/src/v1/identity_mapping_store_service_client_config.json +54 -0
- package/build/src/v1/identity_mapping_store_service_proto_list.json +44 -0
- package/build/src/v1/index.d.ts +3 -0
- package/build/src/v1/index.js +7 -1
- package/build/src/v1/project_service_client.d.ts +166 -76
- package/build/src/v1/project_service_client.js +235 -223
- package/build/src/v1/project_service_proto_list.json +6 -1
- package/build/src/v1/rank_service_client.d.ts +137 -47
- package/build/src/v1/rank_service_client.js +204 -85
- package/build/src/v1/rank_service_proto_list.json +6 -1
- package/build/src/v1/recommendation_service_client.d.ts +137 -47
- package/build/src/v1/recommendation_service_client.js +202 -82
- package/build/src/v1/recommendation_service_proto_list.json +6 -1
- package/build/src/v1/schema_service_client.d.ts +201 -111
- package/build/src/v1/schema_service_client.js +264 -274
- package/build/src/v1/schema_service_proto_list.json +6 -1
- package/build/src/v1/search_service_client.d.ts +661 -571
- package/build/src/v1/search_service_client.js +216 -113
- package/build/src/v1/search_service_proto_list.json +6 -1
- package/build/src/v1/search_tuning_service_client.d.ts +167 -77
- package/build/src/v1/search_tuning_service_client.js +246 -236
- package/build/src/v1/search_tuning_service_proto_list.json +6 -1
- package/build/src/v1/serving_config_service_client.d.ts +138 -48
- package/build/src/v1/serving_config_service_client.js +201 -80
- package/build/src/v1/serving_config_service_proto_list.json +6 -1
- package/build/src/v1/site_search_engine_service_client.d.ts +238 -148
- package/build/src/v1/site_search_engine_service_client.js +324 -379
- package/build/src/v1/site_search_engine_service_proto_list.json +6 -1
- package/build/src/v1/user_event_service_client.d.ts +167 -77
- package/build/src/v1/user_event_service_client.js +260 -254
- package/build/src/v1/user_event_service_proto_list.json +6 -1
- package/build/src/v1/user_license_service_client.d.ts +2256 -0
- package/build/src/v1/user_license_service_client.js +3194 -0
- package/build/src/v1/user_license_service_client_config.json +34 -0
- package/build/src/v1/user_license_service_proto_list.json +44 -0
- package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
- package/build/src/v1alpha/acl_config_service_client.js +94 -106
- package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
- package/build/src/v1alpha/chunk_service_client.js +98 -120
- package/build/src/v1alpha/completion_service_client.d.ts +77 -77
- package/build/src/v1alpha/completion_service_client.js +141 -281
- package/build/src/v1alpha/control_service_client.d.ts +85 -85
- package/build/src/v1alpha/control_service_client.js +129 -151
- package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
- package/build/src/v1alpha/conversational_search_service_client.js +211 -237
- package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
- package/build/src/v1alpha/data_store_service_client.js +176 -317
- package/build/src/v1alpha/document_service_client.d.ts +126 -126
- package/build/src/v1alpha/document_service_client.js +193 -329
- package/build/src/v1alpha/engine_service_client.d.ts +106 -106
- package/build/src/v1alpha/engine_service_client.js +180 -326
- package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
- package/build/src/v1alpha/estimate_billing_service_client.js +119 -244
- package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
- package/build/src/v1alpha/evaluation_service_client.js +150 -296
- package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
- package/build/src/v1alpha/grounded_generation_service_client.js +85 -100
- package/build/src/v1alpha/project_service_client.d.ts +78 -78
- package/build/src/v1alpha/project_service_client.js +139 -263
- package/build/src/v1alpha/rank_service_client.d.ts +47 -47
- package/build/src/v1alpha/rank_service_client.js +87 -104
- package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
- package/build/src/v1alpha/recommendation_service_client.js +85 -100
- package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
- package/build/src/v1alpha/sample_query_service_client.js +169 -302
- package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1alpha/sample_query_set_service_client.js +130 -153
- package/build/src/v1alpha/schema_service_client.d.ts +112 -112
- package/build/src/v1alpha/schema_service_client.js +147 -293
- package/build/src/v1alpha/search_service_client.d.ts +327 -327
- package/build/src/v1alpha/search_service_client.js +88 -112
- package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
- package/build/src/v1alpha/search_tuning_service_client.js +129 -254
- package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
- package/build/src/v1alpha/serving_config_service_client.js +109 -133
- package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1alpha/site_search_engine_service_client.js +203 -388
- package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
- package/build/src/v1alpha/user_event_service_client.js +143 -272
- package/build/src/v1beta/completion_service_client.d.ts +78 -78
- package/build/src/v1beta/completion_service_client.js +149 -280
- package/build/src/v1beta/control_service_client.d.ts +84 -84
- package/build/src/v1beta/control_service_client.js +127 -147
- package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
- package/build/src/v1beta/conversational_search_service_client.js +209 -233
- package/build/src/v1beta/data_store_service_client.d.ts +124 -124
- package/build/src/v1beta/data_store_service_client.js +154 -289
- package/build/src/v1beta/document_service_client.d.ts +124 -124
- package/build/src/v1beta/document_service_client.js +181 -310
- package/build/src/v1beta/engine_service_client.d.ts +106 -106
- package/build/src/v1beta/engine_service_client.js +178 -316
- package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
- package/build/src/v1beta/evaluation_service_client.js +148 -286
- package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
- package/build/src/v1beta/grounded_generation_service_client.js +98 -114
- package/build/src/v1beta/project_service_client.d.ts +76 -76
- package/build/src/v1beta/project_service_client.js +116 -232
- package/build/src/v1beta/rank_service_client.d.ts +47 -47
- package/build/src/v1beta/rank_service_client.js +85 -99
- package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
- package/build/src/v1beta/recommendation_service_client.js +83 -96
- package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
- package/build/src/v1beta/sample_query_service_client.js +167 -292
- package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1beta/sample_query_set_service_client.js +128 -149
- package/build/src/v1beta/schema_service_client.d.ts +111 -111
- package/build/src/v1beta/schema_service_client.js +145 -283
- package/build/src/v1beta/search_service_client.d.ts +665 -665
- package/build/src/v1beta/search_service_client.js +97 -128
- package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
- package/build/src/v1beta/search_tuning_service_client.js +127 -244
- package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
- package/build/src/v1beta/serving_config_service_client.js +107 -129
- package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1beta/site_search_engine_service_client.js +205 -387
- package/build/src/v1beta/user_event_service_client.d.ts +78 -78
- package/build/src/v1beta/user_event_service_client.js +141 -262
- package/package.json +7 -7
- package/CHANGELOG.md +0 -267
@@ -100,26 +100,17 @@ class ControlServiceClient {
|
|
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 ControlServiceClient {
|
|
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
|
}
|
@@ -216,7 +210,7 @@ class ControlServiceClient {
|
|
216
210
|
// (e.g. 50 results at a time, with tokens to get subsequent
|
217
211
|
// pages). Denote the keys used for pagination and results.
|
218
212
|
this.descriptors.page = {
|
219
|
-
listControls: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'controls')
|
213
|
+
listControls: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'controls')
|
220
214
|
};
|
221
215
|
// Put together the default options sent with requests.
|
222
216
|
this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.ControlService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
@@ -245,20 +239,13 @@ class ControlServiceClient {
|
|
245
239
|
}
|
246
240
|
// Put together the "service stub" for
|
247
241
|
// google.cloud.discoveryengine.v1beta.ControlService.
|
248
|
-
this.controlServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
.ControlService, this._opts, this._providedCustomServicePath);
|
242
|
+
this.controlServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
243
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1beta.ControlService') :
|
244
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
245
|
+
this._protos.google.cloud.discoveryengine.v1beta.ControlService, this._opts, this._providedCustomServicePath);
|
253
246
|
// Iterate over each of the methods that the service provides
|
254
247
|
// and create an API call method for each.
|
255
|
-
const controlServiceStubMethods = [
|
256
|
-
'createControl',
|
257
|
-
'deleteControl',
|
258
|
-
'updateControl',
|
259
|
-
'getControl',
|
260
|
-
'listControls',
|
261
|
-
];
|
248
|
+
const controlServiceStubMethods = ['createControl', 'deleteControl', 'updateControl', 'getControl', 'listControls'];
|
262
249
|
for (const methodName of controlServiceStubMethods) {
|
263
250
|
const callPromise = this.controlServiceStub.then(stub => (...args) => {
|
264
251
|
if (this._terminated) {
|
@@ -269,7 +256,8 @@ class ControlServiceClient {
|
|
269
256
|
}, (err) => () => {
|
270
257
|
throw err;
|
271
258
|
});
|
272
|
-
const descriptor = this.descriptors.page[methodName] ||
|
259
|
+
const descriptor = this.descriptors.page[methodName] ||
|
260
|
+
undefined;
|
273
261
|
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
|
274
262
|
this.innerApiCalls[methodName] = apiCall;
|
275
263
|
}
|
@@ -281,8 +269,7 @@ class ControlServiceClient {
|
|
281
269
|
* @returns {string} The DNS address for this service.
|
282
270
|
*/
|
283
271
|
static get servicePath() {
|
284
|
-
if (typeof process === 'object' &&
|
285
|
-
typeof process.emitWarning === 'function') {
|
272
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
286
273
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
287
274
|
}
|
288
275
|
return 'discoveryengine.googleapis.com';
|
@@ -293,8 +280,7 @@ class ControlServiceClient {
|
|
293
280
|
* @returns {string} The DNS address for this service.
|
294
281
|
*/
|
295
282
|
static get apiEndpoint() {
|
296
|
-
if (typeof process === 'object' &&
|
297
|
-
typeof process.emitWarning === 'function') {
|
283
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
298
284
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
299
285
|
}
|
300
286
|
return 'discoveryengine.googleapis.com';
|
@@ -322,7 +308,9 @@ class ControlServiceClient {
|
|
322
308
|
* @returns {string[]} List of default scopes.
|
323
309
|
*/
|
324
310
|
static get scopes() {
|
325
|
-
return [
|
311
|
+
return [
|
312
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
313
|
+
];
|
326
314
|
}
|
327
315
|
/**
|
328
316
|
* Return the project ID used by this class.
|
@@ -348,13 +336,10 @@ class ControlServiceClient {
|
|
348
336
|
options = options || {};
|
349
337
|
options.otherArgs = options.otherArgs || {};
|
350
338
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
351
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
352
|
-
|
353
|
-
parent: request.parent ?? '',
|
354
|
-
});
|
355
|
-
this.initialize().catch(err => {
|
356
|
-
throw err;
|
339
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
340
|
+
'parent': request.parent ?? '',
|
357
341
|
});
|
342
|
+
this.initialize().catch(err => { throw err; });
|
358
343
|
this._log.info('createControl request %j', request);
|
359
344
|
const wrappedCallback = callback
|
360
345
|
? (error, response, options, rawResponse) => {
|
@@ -362,11 +347,16 @@ class ControlServiceClient {
|
|
362
347
|
callback(error, response, options, rawResponse); // We verified callback above.
|
363
348
|
}
|
364
349
|
: undefined;
|
365
|
-
return this.innerApiCalls
|
366
|
-
.createControl(request, options, wrappedCallback)
|
350
|
+
return this.innerApiCalls.createControl(request, options, wrappedCallback)
|
367
351
|
?.then(([response, options, rawResponse]) => {
|
368
352
|
this._log.info('createControl response %j', response);
|
369
353
|
return [response, options, rawResponse];
|
354
|
+
}).catch((error) => {
|
355
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
356
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
357
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
358
|
+
}
|
359
|
+
throw error;
|
370
360
|
});
|
371
361
|
}
|
372
362
|
deleteControl(request, optionsOrCallback, callback) {
|
@@ -382,13 +372,10 @@ class ControlServiceClient {
|
|
382
372
|
options = options || {};
|
383
373
|
options.otherArgs = options.otherArgs || {};
|
384
374
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
385
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
386
|
-
|
387
|
-
name: request.name ?? '',
|
388
|
-
});
|
389
|
-
this.initialize().catch(err => {
|
390
|
-
throw err;
|
375
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
376
|
+
'name': request.name ?? '',
|
391
377
|
});
|
378
|
+
this.initialize().catch(err => { throw err; });
|
392
379
|
this._log.info('deleteControl request %j', request);
|
393
380
|
const wrappedCallback = callback
|
394
381
|
? (error, response, options, rawResponse) => {
|
@@ -396,11 +383,16 @@ class ControlServiceClient {
|
|
396
383
|
callback(error, response, options, rawResponse); // We verified callback above.
|
397
384
|
}
|
398
385
|
: undefined;
|
399
|
-
return this.innerApiCalls
|
400
|
-
.deleteControl(request, options, wrappedCallback)
|
386
|
+
return this.innerApiCalls.deleteControl(request, options, wrappedCallback)
|
401
387
|
?.then(([response, options, rawResponse]) => {
|
402
388
|
this._log.info('deleteControl response %j', response);
|
403
389
|
return [response, options, rawResponse];
|
390
|
+
}).catch((error) => {
|
391
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
392
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
393
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
394
|
+
}
|
395
|
+
throw error;
|
404
396
|
});
|
405
397
|
}
|
406
398
|
updateControl(request, optionsOrCallback, callback) {
|
@@ -416,13 +408,10 @@ class ControlServiceClient {
|
|
416
408
|
options = options || {};
|
417
409
|
options.otherArgs = options.otherArgs || {};
|
418
410
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
419
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
420
|
-
|
421
|
-
'control.name': request.control.name ?? '',
|
422
|
-
});
|
423
|
-
this.initialize().catch(err => {
|
424
|
-
throw err;
|
411
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
412
|
+
'control.name': request.control.name ?? '',
|
425
413
|
});
|
414
|
+
this.initialize().catch(err => { throw err; });
|
426
415
|
this._log.info('updateControl request %j', request);
|
427
416
|
const wrappedCallback = callback
|
428
417
|
? (error, response, options, rawResponse) => {
|
@@ -430,11 +419,16 @@ class ControlServiceClient {
|
|
430
419
|
callback(error, response, options, rawResponse); // We verified callback above.
|
431
420
|
}
|
432
421
|
: undefined;
|
433
|
-
return this.innerApiCalls
|
434
|
-
.updateControl(request, options, wrappedCallback)
|
422
|
+
return this.innerApiCalls.updateControl(request, options, wrappedCallback)
|
435
423
|
?.then(([response, options, rawResponse]) => {
|
436
424
|
this._log.info('updateControl response %j', response);
|
437
425
|
return [response, options, rawResponse];
|
426
|
+
}).catch((error) => {
|
427
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
428
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
429
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
430
|
+
}
|
431
|
+
throw error;
|
438
432
|
});
|
439
433
|
}
|
440
434
|
getControl(request, optionsOrCallback, callback) {
|
@@ -450,13 +444,10 @@ class ControlServiceClient {
|
|
450
444
|
options = options || {};
|
451
445
|
options.otherArgs = options.otherArgs || {};
|
452
446
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
453
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
454
|
-
|
455
|
-
name: request.name ?? '',
|
456
|
-
});
|
457
|
-
this.initialize().catch(err => {
|
458
|
-
throw err;
|
447
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
448
|
+
'name': request.name ?? '',
|
459
449
|
});
|
450
|
+
this.initialize().catch(err => { throw err; });
|
460
451
|
this._log.info('getControl request %j', request);
|
461
452
|
const wrappedCallback = callback
|
462
453
|
? (error, response, options, rawResponse) => {
|
@@ -464,11 +455,16 @@ class ControlServiceClient {
|
|
464
455
|
callback(error, response, options, rawResponse); // We verified callback above.
|
465
456
|
}
|
466
457
|
: undefined;
|
467
|
-
return this.innerApiCalls
|
468
|
-
.getControl(request, options, wrappedCallback)
|
458
|
+
return this.innerApiCalls.getControl(request, options, wrappedCallback)
|
469
459
|
?.then(([response, options, rawResponse]) => {
|
470
460
|
this._log.info('getControl response %j', response);
|
471
461
|
return [response, options, rawResponse];
|
462
|
+
}).catch((error) => {
|
463
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
464
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
465
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
466
|
+
}
|
467
|
+
throw error;
|
472
468
|
});
|
473
469
|
}
|
474
470
|
listControls(request, optionsOrCallback, callback) {
|
@@ -484,13 +480,10 @@ class ControlServiceClient {
|
|
484
480
|
options = options || {};
|
485
481
|
options.otherArgs = options.otherArgs || {};
|
486
482
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
487
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
488
|
-
|
489
|
-
parent: request.parent ?? '',
|
490
|
-
});
|
491
|
-
this.initialize().catch(err => {
|
492
|
-
throw err;
|
483
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
484
|
+
'parent': request.parent ?? '',
|
493
485
|
});
|
486
|
+
this.initialize().catch(err => { throw err; });
|
494
487
|
const wrappedCallback = callback
|
495
488
|
? (error, values, nextPageRequest, rawResponse) => {
|
496
489
|
this._log.info('listControls values %j', values);
|
@@ -542,15 +535,12 @@ class ControlServiceClient {
|
|
542
535
|
options = options || {};
|
543
536
|
options.otherArgs = options.otherArgs || {};
|
544
537
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
545
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
546
|
-
|
547
|
-
|
548
|
-
});
|
538
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
539
|
+
'parent': request.parent ?? '',
|
540
|
+
});
|
549
541
|
const defaultCallSettings = this._defaults['listControls'];
|
550
542
|
const callSettings = defaultCallSettings.merge(options);
|
551
|
-
this.initialize().catch(err => {
|
552
|
-
throw err;
|
553
|
-
});
|
543
|
+
this.initialize().catch(err => { throw err; });
|
554
544
|
this._log.info('listControls stream %j', request);
|
555
545
|
return this.descriptors.page.listControls.createStream(this.innerApiCalls.listControls, request, callSettings);
|
556
546
|
}
|
@@ -594,70 +584,67 @@ class ControlServiceClient {
|
|
594
584
|
options = options || {};
|
595
585
|
options.otherArgs = options.otherArgs || {};
|
596
586
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
597
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
598
|
-
|
599
|
-
|
600
|
-
});
|
587
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
588
|
+
'parent': request.parent ?? '',
|
589
|
+
});
|
601
590
|
const defaultCallSettings = this._defaults['listControls'];
|
602
591
|
const callSettings = defaultCallSettings.merge(options);
|
603
|
-
this.initialize().catch(err => {
|
604
|
-
throw err;
|
605
|
-
});
|
592
|
+
this.initialize().catch(err => { throw err; });
|
606
593
|
this._log.info('listControls iterate %j', request);
|
607
594
|
return this.descriptors.page.listControls.asyncIterate(this.innerApiCalls['listControls'], request, callSettings);
|
608
595
|
}
|
609
596
|
/**
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
597
|
+
* Gets information about a location.
|
598
|
+
*
|
599
|
+
* @param {Object} request
|
600
|
+
* The request object that will be sent.
|
601
|
+
* @param {string} request.name
|
602
|
+
* Resource name for the location.
|
603
|
+
* @param {object} [options]
|
604
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
605
|
+
* @returns {Promise} - The promise which resolves to an array.
|
606
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
607
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
608
|
+
* for more details and examples.
|
609
|
+
* @example
|
610
|
+
* ```
|
611
|
+
* const [response] = await client.getLocation(request);
|
612
|
+
* ```
|
613
|
+
*/
|
627
614
|
getLocation(request, options, callback) {
|
628
615
|
return this.locationsClient.getLocation(request, options, callback);
|
629
616
|
}
|
630
617
|
/**
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
618
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
619
|
+
*
|
620
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
621
|
+
* @param {Object} request
|
622
|
+
* The request object that will be sent.
|
623
|
+
* @param {string} request.name
|
624
|
+
* The resource that owns the locations collection, if applicable.
|
625
|
+
* @param {string} request.filter
|
626
|
+
* The standard list filter.
|
627
|
+
* @param {number} request.pageSize
|
628
|
+
* The standard list page size.
|
629
|
+
* @param {string} request.pageToken
|
630
|
+
* The standard list page token.
|
631
|
+
* @param {object} [options]
|
632
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
633
|
+
* @returns {Object}
|
634
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
635
|
+
* When you iterate the returned iterable, each element will be an object representing
|
636
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
637
|
+
* so you can stop the iteration when you don't need more results.
|
638
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
639
|
+
* for more details and examples.
|
640
|
+
* @example
|
641
|
+
* ```
|
642
|
+
* const iterable = client.listLocationsAsync(request);
|
643
|
+
* for await (const response of iterable) {
|
644
|
+
* // process response
|
645
|
+
* }
|
646
|
+
* ```
|
647
|
+
*/
|
661
648
|
listLocationsAsync(request, options) {
|
662
649
|
return this.locationsClient.listLocationsAsync(request, options);
|
663
650
|
}
|
@@ -744,8 +731,7 @@ class ControlServiceClient {
|
|
744
731
|
* @returns {string} A string representing the project.
|
745
732
|
*/
|
746
733
|
matchProjectFromEvaluationName(evaluationName) {
|
747
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
748
|
-
.project;
|
734
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
|
749
735
|
}
|
750
736
|
/**
|
751
737
|
* Parse the location from Evaluation resource.
|
@@ -755,8 +741,7 @@ class ControlServiceClient {
|
|
755
741
|
* @returns {string} A string representing the location.
|
756
742
|
*/
|
757
743
|
matchLocationFromEvaluationName(evaluationName) {
|
758
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
759
|
-
.location;
|
744
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
|
760
745
|
}
|
761
746
|
/**
|
762
747
|
* Parse the evaluation from Evaluation resource.
|
@@ -766,8 +751,7 @@ class ControlServiceClient {
|
|
766
751
|
* @returns {string} A string representing the evaluation.
|
767
752
|
*/
|
768
753
|
matchEvaluationFromEvaluationName(evaluationName) {
|
769
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
770
|
-
.evaluation;
|
754
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
|
771
755
|
}
|
772
756
|
/**
|
773
757
|
* Return a fully-qualified groundingConfig resource name string.
|
@@ -3038,8 +3022,7 @@ class ControlServiceClient {
|
|
3038
3022
|
* @returns {string} A string representing the project.
|
3039
3023
|
*/
|
3040
3024
|
matchProjectFromSampleQueryName(sampleQueryName) {
|
3041
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3042
|
-
.project;
|
3025
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
|
3043
3026
|
}
|
3044
3027
|
/**
|
3045
3028
|
* Parse the location from SampleQuery resource.
|
@@ -3049,8 +3032,7 @@ class ControlServiceClient {
|
|
3049
3032
|
* @returns {string} A string representing the location.
|
3050
3033
|
*/
|
3051
3034
|
matchLocationFromSampleQueryName(sampleQueryName) {
|
3052
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3053
|
-
.location;
|
3035
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
|
3054
3036
|
}
|
3055
3037
|
/**
|
3056
3038
|
* Parse the sample_query_set from SampleQuery resource.
|
@@ -3060,8 +3042,7 @@ class ControlServiceClient {
|
|
3060
3042
|
* @returns {string} A string representing the sample_query_set.
|
3061
3043
|
*/
|
3062
3044
|
matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
|
3063
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3064
|
-
.sample_query_set;
|
3045
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
|
3065
3046
|
}
|
3066
3047
|
/**
|
3067
3048
|
* Parse the sample_query from SampleQuery resource.
|
@@ -3071,8 +3052,7 @@ class ControlServiceClient {
|
|
3071
3052
|
* @returns {string} A string representing the sample_query.
|
3072
3053
|
*/
|
3073
3054
|
matchSampleQueryFromSampleQueryName(sampleQueryName) {
|
3074
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
3075
|
-
.sample_query;
|
3055
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
|
3076
3056
|
}
|
3077
3057
|
/**
|
3078
3058
|
* Return a fully-qualified sampleQuerySet resource name string.
|
@@ -3131,7 +3111,7 @@ class ControlServiceClient {
|
|
3131
3111
|
this._log.info('ending gRPC channel');
|
3132
3112
|
this._terminated = true;
|
3133
3113
|
stub.close();
|
3134
|
-
this.locationsClient.close();
|
3114
|
+
this.locationsClient.close().catch(err => { throw err; });
|
3135
3115
|
});
|
3136
3116
|
}
|
3137
3117
|
return Promise.resolve();
|