@google-cloud/apikeys 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/build/protos/protos.d.ts +13 -4
- package/build/protos/protos.js +297 -88
- package/build/protos/protos.json +64 -16
- package/build/src/v2/api_keys_client.d.ts +59 -59
- package/build/src/v2/api_keys_client.js +114 -136
- package/package.json +4 -4
- package/CHANGELOG.md +0 -121
|
@@ -97,26 +97,17 @@ class ApiKeysClient {
|
|
|
97
97
|
constructor(opts, gaxInstance) {
|
|
98
98
|
// Ensure that options include all the required fields.
|
|
99
99
|
const staticMembers = this.constructor;
|
|
100
|
-
if (opts?.universe_domain &&
|
|
101
|
-
opts?.universeDomain &&
|
|
102
|
-
opts?.universe_domain !== opts?.universeDomain) {
|
|
100
|
+
if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
|
|
103
101
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
104
102
|
}
|
|
105
|
-
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
|
106
|
-
|
|
107
|
-
: undefined;
|
|
108
|
-
this._universeDomain =
|
|
109
|
-
opts?.universeDomain ??
|
|
110
|
-
opts?.universe_domain ??
|
|
111
|
-
universeDomainEnvVar ??
|
|
112
|
-
'googleapis.com';
|
|
103
|
+
const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
|
|
104
|
+
this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
|
|
113
105
|
this._servicePath = 'apikeys.' + this._universeDomain;
|
|
114
106
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
|
115
107
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
|
116
108
|
const port = opts?.port || staticMembers.port;
|
|
117
109
|
const clientConfig = opts?.clientConfig ?? {};
|
|
118
|
-
const fallback = opts?.fallback ??
|
|
119
|
-
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
|
110
|
+
const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
|
120
111
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
121
112
|
// Request numeric enum values if REST transport is used.
|
|
122
113
|
opts.numericEnums = true;
|
|
@@ -145,7 +136,10 @@ class ApiKeysClient {
|
|
|
145
136
|
this.auth.defaultScopes = staticMembers.scopes;
|
|
146
137
|
}
|
|
147
138
|
// Determine the client header string.
|
|
148
|
-
const clientHeader = [
|
|
139
|
+
const clientHeader = [
|
|
140
|
+
`gax/${this._gaxModule.version}`,
|
|
141
|
+
`gapic/${version}`,
|
|
142
|
+
];
|
|
149
143
|
if (typeof process === 'object' && 'versions' in process) {
|
|
150
144
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
|
151
145
|
}
|
|
@@ -175,28 +169,21 @@ class ApiKeysClient {
|
|
|
175
169
|
// (e.g. 50 results at a time, with tokens to get subsequent
|
|
176
170
|
// pages). Denote the keys used for pagination and results.
|
|
177
171
|
this.descriptors.page = {
|
|
178
|
-
listKeys: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'keys')
|
|
172
|
+
listKeys: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'keys')
|
|
179
173
|
};
|
|
180
|
-
const protoFilesRoot = this._gaxModule.
|
|
174
|
+
const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
|
|
181
175
|
// This API contains "long-running operations", which return a
|
|
182
176
|
// an Operation object that allows for tracking of the operation,
|
|
183
177
|
// rather than holding a request open.
|
|
184
178
|
const lroOptions = {
|
|
185
179
|
auth: this.auth,
|
|
186
|
-
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
|
|
180
|
+
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
|
|
187
181
|
};
|
|
188
182
|
if (opts.fallback) {
|
|
189
183
|
lroOptions.protoJson = protoFilesRoot;
|
|
190
|
-
lroOptions.httpRules = [
|
|
191
|
-
{
|
|
192
|
-
selector: 'google.longrunning.Operations.GetOperation',
|
|
193
|
-
get: '/v2/{name=operations/*}',
|
|
194
|
-
},
|
|
195
|
-
];
|
|
184
|
+
lroOptions.httpRules = [{ selector: 'google.longrunning.Operations.GetOperation', get: '/v2/{name=operations/*}', }];
|
|
196
185
|
}
|
|
197
|
-
this.operationsClient = this._gaxModule
|
|
198
|
-
.lro(lroOptions)
|
|
199
|
-
.operationsClient(opts);
|
|
186
|
+
this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
|
|
200
187
|
const createKeyResponse = protoFilesRoot.lookup('.google.api.apikeys.v2.Key');
|
|
201
188
|
const createKeyMetadata = protoFilesRoot.lookup('.google.protobuf.Empty');
|
|
202
189
|
const updateKeyResponse = protoFilesRoot.lookup('.google.api.apikeys.v2.Key');
|
|
@@ -209,7 +196,7 @@ class ApiKeysClient {
|
|
|
209
196
|
createKey: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createKeyResponse.decode.bind(createKeyResponse), createKeyMetadata.decode.bind(createKeyMetadata)),
|
|
210
197
|
updateKey: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateKeyResponse.decode.bind(updateKeyResponse), updateKeyMetadata.decode.bind(updateKeyMetadata)),
|
|
211
198
|
deleteKey: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteKeyResponse.decode.bind(deleteKeyResponse), deleteKeyMetadata.decode.bind(deleteKeyMetadata)),
|
|
212
|
-
undeleteKey: new this._gaxModule.LongrunningDescriptor(this.operationsClient, undeleteKeyResponse.decode.bind(undeleteKeyResponse), undeleteKeyMetadata.decode.bind(undeleteKeyMetadata))
|
|
199
|
+
undeleteKey: new this._gaxModule.LongrunningDescriptor(this.operationsClient, undeleteKeyResponse.decode.bind(undeleteKeyResponse), undeleteKeyMetadata.decode.bind(undeleteKeyMetadata))
|
|
213
200
|
};
|
|
214
201
|
// Put together the default options sent with requests.
|
|
215
202
|
this._defaults = this._gaxGrpc.constructSettings('google.api.apikeys.v2.ApiKeys', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
|
@@ -238,22 +225,13 @@ class ApiKeysClient {
|
|
|
238
225
|
}
|
|
239
226
|
// Put together the "service stub" for
|
|
240
227
|
// google.api.apikeys.v2.ApiKeys.
|
|
241
|
-
this.apiKeysStub = this._gaxGrpc.createStub(this._opts.fallback
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
228
|
+
this.apiKeysStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
|
229
|
+
this._protos.lookupService('google.api.apikeys.v2.ApiKeys') :
|
|
230
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
231
|
+
this._protos.google.api.apikeys.v2.ApiKeys, this._opts, this._providedCustomServicePath);
|
|
245
232
|
// Iterate over each of the methods that the service provides
|
|
246
233
|
// and create an API call method for each.
|
|
247
|
-
const apiKeysStubMethods = [
|
|
248
|
-
'createKey',
|
|
249
|
-
'listKeys',
|
|
250
|
-
'getKey',
|
|
251
|
-
'getKeyString',
|
|
252
|
-
'updateKey',
|
|
253
|
-
'deleteKey',
|
|
254
|
-
'undeleteKey',
|
|
255
|
-
'lookupKey',
|
|
256
|
-
];
|
|
234
|
+
const apiKeysStubMethods = ['createKey', 'listKeys', 'getKey', 'getKeyString', 'updateKey', 'deleteKey', 'undeleteKey', 'lookupKey'];
|
|
257
235
|
for (const methodName of apiKeysStubMethods) {
|
|
258
236
|
const callPromise = this.apiKeysStub.then(stub => (...args) => {
|
|
259
237
|
if (this._terminated) {
|
|
@@ -278,8 +256,7 @@ class ApiKeysClient {
|
|
|
278
256
|
* @returns {string} The DNS address for this service.
|
|
279
257
|
*/
|
|
280
258
|
static get servicePath() {
|
|
281
|
-
if (typeof process === 'object' &&
|
|
282
|
-
typeof process.emitWarning === 'function') {
|
|
259
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
|
283
260
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
284
261
|
}
|
|
285
262
|
return 'apikeys.googleapis.com';
|
|
@@ -290,8 +267,7 @@ class ApiKeysClient {
|
|
|
290
267
|
* @returns {string} The DNS address for this service.
|
|
291
268
|
*/
|
|
292
269
|
static get apiEndpoint() {
|
|
293
|
-
if (typeof process === 'object' &&
|
|
294
|
-
typeof process.emitWarning === 'function') {
|
|
270
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
|
295
271
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
296
272
|
}
|
|
297
273
|
return 'apikeys.googleapis.com';
|
|
@@ -321,7 +297,7 @@ class ApiKeysClient {
|
|
|
321
297
|
static get scopes() {
|
|
322
298
|
return [
|
|
323
299
|
'https://www.googleapis.com/auth/cloud-platform',
|
|
324
|
-
'https://www.googleapis.com/auth/cloud-platform.read-only'
|
|
300
|
+
'https://www.googleapis.com/auth/cloud-platform.read-only'
|
|
325
301
|
];
|
|
326
302
|
}
|
|
327
303
|
/**
|
|
@@ -348,11 +324,10 @@ class ApiKeysClient {
|
|
|
348
324
|
options = options || {};
|
|
349
325
|
options.otherArgs = options.otherArgs || {};
|
|
350
326
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
351
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
this.initialize();
|
|
327
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
328
|
+
'name': request.name ?? '',
|
|
329
|
+
});
|
|
330
|
+
this.initialize().catch(err => { throw err; });
|
|
356
331
|
this._log.info('getKey request %j', request);
|
|
357
332
|
const wrappedCallback = callback
|
|
358
333
|
? (error, response, options, rawResponse) => {
|
|
@@ -360,11 +335,16 @@ class ApiKeysClient {
|
|
|
360
335
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
361
336
|
}
|
|
362
337
|
: undefined;
|
|
363
|
-
return this.innerApiCalls
|
|
364
|
-
.getKey(request, options, wrappedCallback)
|
|
338
|
+
return this.innerApiCalls.getKey(request, options, wrappedCallback)
|
|
365
339
|
?.then(([response, options, rawResponse]) => {
|
|
366
340
|
this._log.info('getKey response %j', response);
|
|
367
341
|
return [response, options, rawResponse];
|
|
342
|
+
}).catch((error) => {
|
|
343
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
344
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
345
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
346
|
+
}
|
|
347
|
+
throw error;
|
|
368
348
|
});
|
|
369
349
|
}
|
|
370
350
|
getKeyString(request, optionsOrCallback, callback) {
|
|
@@ -380,11 +360,10 @@ class ApiKeysClient {
|
|
|
380
360
|
options = options || {};
|
|
381
361
|
options.otherArgs = options.otherArgs || {};
|
|
382
362
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
383
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
this.initialize();
|
|
363
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
364
|
+
'name': request.name ?? '',
|
|
365
|
+
});
|
|
366
|
+
this.initialize().catch(err => { throw err; });
|
|
388
367
|
this._log.info('getKeyString request %j', request);
|
|
389
368
|
const wrappedCallback = callback
|
|
390
369
|
? (error, response, options, rawResponse) => {
|
|
@@ -392,11 +371,16 @@ class ApiKeysClient {
|
|
|
392
371
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
393
372
|
}
|
|
394
373
|
: undefined;
|
|
395
|
-
return this.innerApiCalls
|
|
396
|
-
.getKeyString(request, options, wrappedCallback)
|
|
374
|
+
return this.innerApiCalls.getKeyString(request, options, wrappedCallback)
|
|
397
375
|
?.then(([response, options, rawResponse]) => {
|
|
398
376
|
this._log.info('getKeyString response %j', response);
|
|
399
377
|
return [response, options, rawResponse];
|
|
378
|
+
}).catch((error) => {
|
|
379
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
380
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
381
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
382
|
+
}
|
|
383
|
+
throw error;
|
|
400
384
|
});
|
|
401
385
|
}
|
|
402
386
|
lookupKey(request, optionsOrCallback, callback) {
|
|
@@ -412,7 +396,7 @@ class ApiKeysClient {
|
|
|
412
396
|
options = options || {};
|
|
413
397
|
options.otherArgs = options.otherArgs || {};
|
|
414
398
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
415
|
-
this.initialize();
|
|
399
|
+
this.initialize().catch(err => { throw err; });
|
|
416
400
|
this._log.info('lookupKey request %j', request);
|
|
417
401
|
const wrappedCallback = callback
|
|
418
402
|
? (error, response, options, rawResponse) => {
|
|
@@ -420,11 +404,16 @@ class ApiKeysClient {
|
|
|
420
404
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
421
405
|
}
|
|
422
406
|
: undefined;
|
|
423
|
-
return this.innerApiCalls
|
|
424
|
-
.lookupKey(request, options, wrappedCallback)
|
|
407
|
+
return this.innerApiCalls.lookupKey(request, options, wrappedCallback)
|
|
425
408
|
?.then(([response, options, rawResponse]) => {
|
|
426
409
|
this._log.info('lookupKey response %j', response);
|
|
427
410
|
return [response, options, rawResponse];
|
|
411
|
+
}).catch((error) => {
|
|
412
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
413
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
414
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
415
|
+
}
|
|
416
|
+
throw error;
|
|
428
417
|
});
|
|
429
418
|
}
|
|
430
419
|
createKey(request, optionsOrCallback, callback) {
|
|
@@ -440,11 +429,10 @@ class ApiKeysClient {
|
|
|
440
429
|
options = options || {};
|
|
441
430
|
options.otherArgs = options.otherArgs || {};
|
|
442
431
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
443
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
this.initialize();
|
|
432
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
433
|
+
'parent': request.parent ?? '',
|
|
434
|
+
});
|
|
435
|
+
this.initialize().catch(err => { throw err; });
|
|
448
436
|
const wrappedCallback = callback
|
|
449
437
|
? (error, response, rawResponse, _) => {
|
|
450
438
|
this._log.info('createKey response %j', rawResponse);
|
|
@@ -452,8 +440,7 @@ class ApiKeysClient {
|
|
|
452
440
|
}
|
|
453
441
|
: undefined;
|
|
454
442
|
this._log.info('createKey request %j', request);
|
|
455
|
-
return this.innerApiCalls
|
|
456
|
-
.createKey(request, options, wrappedCallback)
|
|
443
|
+
return this.innerApiCalls.createKey(request, options, wrappedCallback)
|
|
457
444
|
?.then(([response, rawResponse, _]) => {
|
|
458
445
|
this._log.info('createKey response %j', rawResponse);
|
|
459
446
|
return [response, rawResponse, _];
|
|
@@ -490,11 +477,10 @@ class ApiKeysClient {
|
|
|
490
477
|
options = options || {};
|
|
491
478
|
options.otherArgs = options.otherArgs || {};
|
|
492
479
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
493
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
this.initialize();
|
|
480
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
481
|
+
'key.name': request.key.name ?? '',
|
|
482
|
+
});
|
|
483
|
+
this.initialize().catch(err => { throw err; });
|
|
498
484
|
const wrappedCallback = callback
|
|
499
485
|
? (error, response, rawResponse, _) => {
|
|
500
486
|
this._log.info('updateKey response %j', rawResponse);
|
|
@@ -502,8 +488,7 @@ class ApiKeysClient {
|
|
|
502
488
|
}
|
|
503
489
|
: undefined;
|
|
504
490
|
this._log.info('updateKey request %j', request);
|
|
505
|
-
return this.innerApiCalls
|
|
506
|
-
.updateKey(request, options, wrappedCallback)
|
|
491
|
+
return this.innerApiCalls.updateKey(request, options, wrappedCallback)
|
|
507
492
|
?.then(([response, rawResponse, _]) => {
|
|
508
493
|
this._log.info('updateKey response %j', rawResponse);
|
|
509
494
|
return [response, rawResponse, _];
|
|
@@ -540,11 +525,10 @@ class ApiKeysClient {
|
|
|
540
525
|
options = options || {};
|
|
541
526
|
options.otherArgs = options.otherArgs || {};
|
|
542
527
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
543
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
this.initialize();
|
|
528
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
529
|
+
'name': request.name ?? '',
|
|
530
|
+
});
|
|
531
|
+
this.initialize().catch(err => { throw err; });
|
|
548
532
|
const wrappedCallback = callback
|
|
549
533
|
? (error, response, rawResponse, _) => {
|
|
550
534
|
this._log.info('deleteKey response %j', rawResponse);
|
|
@@ -552,8 +536,7 @@ class ApiKeysClient {
|
|
|
552
536
|
}
|
|
553
537
|
: undefined;
|
|
554
538
|
this._log.info('deleteKey request %j', request);
|
|
555
|
-
return this.innerApiCalls
|
|
556
|
-
.deleteKey(request, options, wrappedCallback)
|
|
539
|
+
return this.innerApiCalls.deleteKey(request, options, wrappedCallback)
|
|
557
540
|
?.then(([response, rawResponse, _]) => {
|
|
558
541
|
this._log.info('deleteKey response %j', rawResponse);
|
|
559
542
|
return [response, rawResponse, _];
|
|
@@ -590,11 +573,10 @@ class ApiKeysClient {
|
|
|
590
573
|
options = options || {};
|
|
591
574
|
options.otherArgs = options.otherArgs || {};
|
|
592
575
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
593
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
this.initialize();
|
|
576
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
577
|
+
'name': request.name ?? '',
|
|
578
|
+
});
|
|
579
|
+
this.initialize().catch(err => { throw err; });
|
|
598
580
|
const wrappedCallback = callback
|
|
599
581
|
? (error, response, rawResponse, _) => {
|
|
600
582
|
this._log.info('undeleteKey response %j', rawResponse);
|
|
@@ -602,8 +584,7 @@ class ApiKeysClient {
|
|
|
602
584
|
}
|
|
603
585
|
: undefined;
|
|
604
586
|
this._log.info('undeleteKey request %j', request);
|
|
605
|
-
return this.innerApiCalls
|
|
606
|
-
.undeleteKey(request, options, wrappedCallback)
|
|
587
|
+
return this.innerApiCalls.undeleteKey(request, options, wrappedCallback)
|
|
607
588
|
?.then(([response, rawResponse, _]) => {
|
|
608
589
|
this._log.info('undeleteKey response %j', rawResponse);
|
|
609
590
|
return [response, rawResponse, _];
|
|
@@ -640,11 +621,10 @@ class ApiKeysClient {
|
|
|
640
621
|
options = options || {};
|
|
641
622
|
options.otherArgs = options.otherArgs || {};
|
|
642
623
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
643
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
this.initialize();
|
|
624
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
625
|
+
'parent': request.parent ?? '',
|
|
626
|
+
});
|
|
627
|
+
this.initialize().catch(err => { throw err; });
|
|
648
628
|
const wrappedCallback = callback
|
|
649
629
|
? (error, values, nextPageRequest, rawResponse) => {
|
|
650
630
|
this._log.info('listKeys values %j', values);
|
|
@@ -688,13 +668,12 @@ class ApiKeysClient {
|
|
|
688
668
|
options = options || {};
|
|
689
669
|
options.otherArgs = options.otherArgs || {};
|
|
690
670
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
691
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
});
|
|
671
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
672
|
+
'parent': request.parent ?? '',
|
|
673
|
+
});
|
|
695
674
|
const defaultCallSettings = this._defaults['listKeys'];
|
|
696
675
|
const callSettings = defaultCallSettings.merge(options);
|
|
697
|
-
this.initialize();
|
|
676
|
+
this.initialize().catch(err => { throw err; });
|
|
698
677
|
this._log.info('listKeys stream %j', request);
|
|
699
678
|
return this.descriptors.page.listKeys.createStream(this.innerApiCalls.listKeys, request, callSettings);
|
|
700
679
|
}
|
|
@@ -730,46 +709,45 @@ class ApiKeysClient {
|
|
|
730
709
|
options = options || {};
|
|
731
710
|
options.otherArgs = options.otherArgs || {};
|
|
732
711
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
733
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
});
|
|
712
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
713
|
+
'parent': request.parent ?? '',
|
|
714
|
+
});
|
|
737
715
|
const defaultCallSettings = this._defaults['listKeys'];
|
|
738
716
|
const callSettings = defaultCallSettings.merge(options);
|
|
739
|
-
this.initialize();
|
|
717
|
+
this.initialize().catch(err => { throw err; });
|
|
740
718
|
this._log.info('listKeys iterate %j', request);
|
|
741
719
|
return this.descriptors.page.listKeys.asyncIterate(this.innerApiCalls['listKeys'], request, callSettings);
|
|
742
720
|
}
|
|
743
721
|
/**
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
722
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
|
723
|
+
* method to poll the operation result at intervals as recommended by the API
|
|
724
|
+
* service.
|
|
725
|
+
*
|
|
726
|
+
* @param {Object} request - The request object that will be sent.
|
|
727
|
+
* @param {string} request.name - The name of the operation resource.
|
|
728
|
+
* @param {Object=} options
|
|
729
|
+
* Optional parameters. You can override the default settings for this call,
|
|
730
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
731
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
|
732
|
+
* for the details.
|
|
733
|
+
* @param {function(?Error, ?Object)=} callback
|
|
734
|
+
* The function which will be called with the result of the API call.
|
|
735
|
+
*
|
|
736
|
+
* The second parameter to the callback is an object representing
|
|
737
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
|
738
|
+
* @return {Promise} - The promise which resolves to an array.
|
|
739
|
+
* The first element of the array is an object representing
|
|
740
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
|
741
|
+
* The promise has a method named "cancel" which cancels the ongoing API call.
|
|
742
|
+
*
|
|
743
|
+
* @example
|
|
744
|
+
* ```
|
|
745
|
+
* const client = longrunning.operationsClient();
|
|
746
|
+
* const name = '';
|
|
747
|
+
* const [response] = await client.getOperation({name});
|
|
748
|
+
* // doThingsWith(response)
|
|
749
|
+
* ```
|
|
750
|
+
*/
|
|
773
751
|
getOperation(request, optionsOrCallback, callback) {
|
|
774
752
|
let options;
|
|
775
753
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -1034,7 +1012,7 @@ class ApiKeysClient {
|
|
|
1034
1012
|
this._log.info('ending gRPC channel');
|
|
1035
1013
|
this._terminated = true;
|
|
1036
1014
|
stub.close();
|
|
1037
|
-
this.operationsClient.close();
|
|
1015
|
+
void this.operationsClient.close();
|
|
1038
1016
|
});
|
|
1039
1017
|
}
|
|
1040
1018
|
return Promise.resolve();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-cloud/apikeys",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "API Keys API client for Node.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"test": "c8 mocha build/test"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"google-gax": "^5.0.0
|
|
49
|
+
"google-gax": "^5.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/mocha": "^10.0.10",
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"gapic-tools": "^1.0.0",
|
|
57
57
|
"gts": "^6.0.2",
|
|
58
58
|
"jsdoc": "^4.0.4",
|
|
59
|
-
"jsdoc-fresh": "^
|
|
59
|
+
"jsdoc-fresh": "^4.0.0",
|
|
60
60
|
"jsdoc-region-tag": "^3.0.0",
|
|
61
61
|
"linkinator": "^6.1.2",
|
|
62
62
|
"long": "^5.3.1",
|
|
63
63
|
"mocha": "^11.1.0",
|
|
64
64
|
"pack-n-play": "^3.0.0",
|
|
65
|
-
"sinon": "^
|
|
65
|
+
"sinon": "^21.0.0",
|
|
66
66
|
"typescript": "^5.8.2"
|
|
67
67
|
},
|
|
68
68
|
"engines": {
|
package/CHANGELOG.md
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/apikeys-v1.3.1...apikeys-v2.0.0) (2025-03-18)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
### ⚠ BREAKING CHANGES
|
|
7
|
-
|
|
8
|
-
* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))
|
|
9
|
-
|
|
10
|
-
### Features
|
|
11
|
-
|
|
12
|
-
* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Miscellaneous Chores
|
|
16
|
-
|
|
17
|
-
* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436))
|
|
18
|
-
|
|
19
|
-
## [1.3.1](https://github.com/googleapis/google-cloud-node/compare/apikeys-v1.3.0...apikeys-v1.3.1) (2025-02-12)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### Bug Fixes
|
|
23
|
-
|
|
24
|
-
* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a))
|
|
25
|
-
|
|
26
|
-
## [1.3.0](https://github.com/googleapis/google-cloud-node/compare/apikeys-v1.2.0...apikeys-v1.3.0) (2024-05-21)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### Features
|
|
30
|
-
|
|
31
|
-
* [Many APIs] update Nodejs generator to send API versions in headers for GAPICs ([#5350](https://github.com/googleapis/google-cloud-node/issues/5350)) ([6c03873](https://github.com/googleapis/google-cloud-node/commit/6c038731de1f36456042e6b4ecf2a9686be662c7))
|
|
32
|
-
* [Many APIs] update Nodejs generator to send API versions in headers for GAPICs ([#5351](https://github.com/googleapis/google-cloud-node/issues/5351)) ([01f48fc](https://github.com/googleapis/google-cloud-node/commit/01f48fce63ec4ddf801d59ee2b8c0db9f6fb8372))
|
|
33
|
-
* [Many APIs] update Nodejs generator to send API versions in headers for GAPICs ([#5354](https://github.com/googleapis/google-cloud-node/issues/5354)) ([a9784ed](https://github.com/googleapis/google-cloud-node/commit/a9784ed3db6ee96d171762308bbbcd57390b6866))
|
|
34
|
-
|
|
35
|
-
## [1.2.0](https://github.com/googleapis/google-cloud-node/compare/apikeys-v1.1.0...apikeys-v1.2.0) (2024-04-16)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
### Features
|
|
39
|
-
|
|
40
|
-
* [Many APIs] support GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable ([#5185](https://github.com/googleapis/google-cloud-node/issues/5185)) ([cc54e98](https://github.com/googleapis/google-cloud-node/commit/cc54e98f7f51598e88277ac50310b07b778acbc7))
|
|
41
|
-
|
|
42
|
-
## [1.1.0](https://github.com/googleapis/google-cloud-node/compare/apikeys-v1.0.1...apikeys-v1.1.0) (2024-02-09)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
### Features
|
|
46
|
-
|
|
47
|
-
* Trusted Private Cloud support, use the universeDomain parameter ([#5022](https://github.com/googleapis/google-cloud-node/issues/5022)) ([b6498d8](https://github.com/googleapis/google-cloud-node/commit/b6498d8580d056817981dedbaa0ea5d82e9dccc2))
|
|
48
|
-
|
|
49
|
-
## [1.0.1](https://github.com/googleapis/google-cloud-node/compare/apikeys-v1.0.0...apikeys-v1.0.1) (2023-09-06)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### Bug Fixes
|
|
53
|
-
|
|
54
|
-
* [Many APIs] simplify logic for HTTP/1.1 REST fallback option ([#4583](https://github.com/googleapis/google-cloud-node/issues/4583)) ([c3ddba8](https://github.com/googleapis/google-cloud-node/commit/c3ddba8df9fee6185e36a4e99f7c67b0319f1242))
|
|
55
|
-
|
|
56
|
-
## [1.0.0](https://github.com/googleapis/google-cloud-node/compare/apikeys-v0.2.2...apikeys-v1.0.0) (2023-08-06)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
### ⚠ BREAKING CHANGES
|
|
60
|
-
|
|
61
|
-
* migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443))
|
|
62
|
-
|
|
63
|
-
### Bug Fixes
|
|
64
|
-
|
|
65
|
-
* [Many APIs] fix typings for IAM methods ([#4459](https://github.com/googleapis/google-cloud-node/issues/4459)) ([1d510be](https://github.com/googleapis/google-cloud-node/commit/1d510bef5bd7b0ac3552b4729ef3d9ebe1ac3dc4))
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
### Miscellaneous Chores
|
|
69
|
-
|
|
70
|
-
* Migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443)) ([2260f12](https://github.com/googleapis/google-cloud-node/commit/2260f12543d171bda95345e53475f5f0fdc45770))
|
|
71
|
-
|
|
72
|
-
## [0.2.2](https://github.com/googleapis/google-cloud-node/compare/apikeys-v0.2.1...apikeys-v0.2.2) (2023-04-13)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
### Bug Fixes
|
|
76
|
-
|
|
77
|
-
* **deps:** Bump `google-gax` to ^3.5.8 ([#4117](https://github.com/googleapis/google-cloud-node/issues/4117)) ([0b67d88](https://github.com/googleapis/google-cloud-node/commit/0b67d883963643ce1b4f6d2ccd3e8d37adf6e029))
|
|
78
|
-
* Minify JSON and JS files, and remove .map files ([#4143](https://github.com/googleapis/google-cloud-node/issues/4143)) ([170f7d5](https://github.com/googleapis/google-cloud-node/commit/170f7d57b8fd344d182a8e758867b8124722eebc))
|
|
79
|
-
|
|
80
|
-
## [0.2.1](https://github.com/googleapis/google-cloud-node/compare/apikeys-v0.2.0...apikeys-v0.2.1) (2023-02-15)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
### Bug Fixes
|
|
84
|
-
|
|
85
|
-
* [Many APIs] changing format of the jsdoc links ([#3985](https://github.com/googleapis/google-cloud-node/issues/3985)) ([fb2a6fd](https://github.com/googleapis/google-cloud-node/commit/fb2a6fdbd9dcf2ae91b3767629d71f0970d0712c))
|
|
86
|
-
|
|
87
|
-
## [0.2.0](https://github.com/googleapis/google-cloud-node/compare/apikeys-v0.1.3...apikeys-v0.2.0) (2023-01-28)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
### Features
|
|
91
|
-
|
|
92
|
-
* Added SuggestConversationSummary RPC ([#3851](https://github.com/googleapis/google-cloud-node/issues/3851)) ([79fbaa8](https://github.com/googleapis/google-cloud-node/commit/79fbaa833d08738fa37aa37158ddb5b1c91710e1))
|
|
93
|
-
|
|
94
|
-
## [0.1.3](https://github.com/googleapis/google-cloud-node/compare/apikeys-v0.1.2...apikeys-v0.1.3) (2022-11-10)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
### Bug Fixes
|
|
98
|
-
|
|
99
|
-
* Regenerated proto JS and TS definitions (generator update) ([#3472](https://github.com/googleapis/google-cloud-node/issues/3472)) ([5e2230d](https://github.com/googleapis/google-cloud-node/commit/5e2230dfc4302bb2ac9628ff4200eb46509e103d))
|
|
100
|
-
|
|
101
|
-
## [0.1.2](https://github.com/googleapis/google-cloud-node/compare/apikeys-v0.1.1...apikeys-v0.1.2) (2022-11-03)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
### Bug Fixes
|
|
105
|
-
|
|
106
|
-
* **deps:** Use google-gax v3.5.2 ([#3478](https://github.com/googleapis/google-cloud-node/issues/3478)) ([09305e0](https://github.com/googleapis/google-cloud-node/commit/09305e06548b89dc17bb3d3167e2d1e69588caa4))
|
|
107
|
-
|
|
108
|
-
## [0.1.1](https://github.com/googleapis/google-cloud-node/compare/apikeys-v0.1.0...apikeys-v0.1.1) (2022-09-28)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
### Bug Fixes
|
|
112
|
-
|
|
113
|
-
* preserve default values in x-goog-request-params header ([#3353](https://github.com/googleapis/google-cloud-node/issues/3353)) ([da99ad5](https://github.com/googleapis/google-cloud-node/commit/da99ad57f592a504750d57fdb1c7423734fec069))
|
|
114
|
-
|
|
115
|
-
## 0.1.0 (2022-08-29)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
### Features
|
|
119
|
-
|
|
120
|
-
* accept google-gax instance as a parameter ([#3307](https://github.com/googleapis/google-cloud-node/issues/3307)) ([502e3f7](https://github.com/googleapis/google-cloud-node/commit/502e3f7247193962c7546112d695ac8e5e220b22))
|
|
121
|
-
* add initial files for google.api.apikeys.v2 ([6fad7f0](https://github.com/googleapis/google-cloud-node/commit/6fad7f0e625c0382c24e60eec2267d56766617ce))
|