@google-cloud/apikeys 1.3.1 → 2.0.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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
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
+
3
19
  ## [1.3.1](https://github.com/googleapis/google-cloud-node/compare/apikeys-v1.3.0...apikeys-v1.3.1) (2025-02-12)
4
20
 
5
21
 
package/README.md CHANGED
@@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
44
44
  1. [Select or create a Cloud Platform project][projects].
45
45
  1. [Enable billing for your project][billing].
46
46
  1. [Enable the API Keys API API][enable_api].
47
- 1. [Set up authentication][auth] so you can access the
47
+ 1. [Set up authentication with a service account][auth] so you can access the
48
48
  API from your local workstation.
49
49
 
50
50
  ### Installing the client library
@@ -190,4 +190,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)
190
190
  [projects]: https://console.cloud.google.com/project
191
191
  [billing]: https://support.google.com/cloud/answer/6293499#enable-billing
192
192
  [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=apikeys.googleapis.com
193
- [auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local
193
+ [auth]: https://cloud.google.com/docs/authentication/getting-started
@@ -1,4 +1,4 @@
1
- // Copyright 2024 Google LLC
1
+ // Copyright 2025 Google LLC
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2024 Google LLC
1
+ // Copyright 2025 Google LLC
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,7 +1,4 @@
1
1
  {
2
- "options": {
3
- "syntax": "proto3"
4
- },
5
2
  "nested": {
6
3
  "google": {
7
4
  "nested": {
@@ -17,6 +17,7 @@ export declare class ApiKeysClient {
17
17
  private _defaults;
18
18
  private _universeDomain;
19
19
  private _servicePath;
20
+ private _log;
20
21
  auth: gax.GoogleAuth;
21
22
  descriptors: Descriptors;
22
23
  warn: (code: string, message: string, warnType?: string) => void;
@@ -52,7 +53,7 @@ export declare class ApiKeysClient {
52
53
  * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
53
54
  * the environment variable GCLOUD_PROJECT for your project ID. If your
54
55
  * app is running in an environment which supports
55
- * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
56
+ * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
56
57
  * your project ID will be detected automatically.
57
58
  * @param {string} [options.apiEndpoint] - The domain name of the
58
59
  * API remote host.
@@ -19,6 +19,7 @@
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.ApiKeysClient = void 0;
21
21
  const jsonProtos = require("../../protos/protos.json");
22
+ const google_gax_1 = require("google-gax");
22
23
  /**
23
24
  * Client JSON configuration object, loaded from
24
25
  * `src/v2/api_keys_client_config.json`.
@@ -32,6 +33,28 @@ const version = require('../../../package.json').version;
32
33
  * @memberof v2
33
34
  */
34
35
  class ApiKeysClient {
36
+ _terminated = false;
37
+ _opts;
38
+ _providedCustomServicePath;
39
+ _gaxModule;
40
+ _gaxGrpc;
41
+ _protos;
42
+ _defaults;
43
+ _universeDomain;
44
+ _servicePath;
45
+ _log = google_gax_1.loggingUtils.log('apikeys');
46
+ auth;
47
+ descriptors = {
48
+ page: {},
49
+ stream: {},
50
+ longrunning: {},
51
+ batching: {},
52
+ };
53
+ warn;
54
+ innerApiCalls;
55
+ pathTemplates;
56
+ operationsClient;
57
+ apiKeysStub;
35
58
  /**
36
59
  * Construct an instance of ApiKeysClient.
37
60
  *
@@ -54,7 +77,7 @@ class ApiKeysClient {
54
77
  * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
55
78
  * the environment variable GCLOUD_PROJECT for your project ID. If your
56
79
  * app is running in an environment which supports
57
- * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
80
+ * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
58
81
  * your project ID will be detected automatically.
59
82
  * @param {string} [options.apiEndpoint] - The domain name of the
60
83
  * API remote host.
@@ -72,32 +95,28 @@ class ApiKeysClient {
72
95
  * ```
73
96
  */
74
97
  constructor(opts, gaxInstance) {
75
- var _a, _b, _c, _d, _e;
76
- this._terminated = false;
77
- this.descriptors = {
78
- page: {},
79
- stream: {},
80
- longrunning: {},
81
- batching: {},
82
- };
83
98
  // Ensure that options include all the required fields.
84
99
  const staticMembers = this.constructor;
85
- if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
86
- (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
87
- (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
100
+ if (opts?.universe_domain &&
101
+ opts?.universeDomain &&
102
+ opts?.universe_domain !== opts?.universeDomain) {
88
103
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
89
104
  }
90
105
  const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
91
106
  ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
92
107
  : undefined;
93
108
  this._universeDomain =
94
- (_c = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
109
+ opts?.universeDomain ??
110
+ opts?.universe_domain ??
111
+ universeDomainEnvVar ??
112
+ 'googleapis.com';
95
113
  this._servicePath = 'apikeys.' + this._universeDomain;
96
- const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
97
- this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
98
- const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
99
- const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
100
- const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
114
+ const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
115
+ this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
116
+ const port = opts?.port || staticMembers.port;
117
+ const clientConfig = opts?.clientConfig ?? {};
118
+ const fallback = opts?.fallback ??
119
+ (typeof window !== 'undefined' && typeof window?.fetch === 'function');
101
120
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
102
121
  // Request numeric enum values if REST transport is used.
103
122
  opts.numericEnums = true;
@@ -317,7 +336,6 @@ class ApiKeysClient {
317
336
  return this.auth.getProjectId();
318
337
  }
319
338
  getKey(request, optionsOrCallback, callback) {
320
- var _a;
321
339
  request = request || {};
322
340
  let options;
323
341
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -332,13 +350,24 @@ class ApiKeysClient {
332
350
  options.otherArgs.headers = options.otherArgs.headers || {};
333
351
  options.otherArgs.headers['x-goog-request-params'] =
334
352
  this._gaxModule.routingHeader.fromParams({
335
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
353
+ name: request.name ?? '',
336
354
  });
337
355
  this.initialize();
338
- return this.innerApiCalls.getKey(request, options, callback);
356
+ this._log.info('getKey request %j', request);
357
+ const wrappedCallback = callback
358
+ ? (error, response, options, rawResponse) => {
359
+ this._log.info('getKey response %j', response);
360
+ callback(error, response, options, rawResponse); // We verified callback above.
361
+ }
362
+ : undefined;
363
+ return this.innerApiCalls
364
+ .getKey(request, options, wrappedCallback)
365
+ ?.then(([response, options, rawResponse]) => {
366
+ this._log.info('getKey response %j', response);
367
+ return [response, options, rawResponse];
368
+ });
339
369
  }
340
370
  getKeyString(request, optionsOrCallback, callback) {
341
- var _a;
342
371
  request = request || {};
343
372
  let options;
344
373
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -353,10 +382,22 @@ class ApiKeysClient {
353
382
  options.otherArgs.headers = options.otherArgs.headers || {};
354
383
  options.otherArgs.headers['x-goog-request-params'] =
355
384
  this._gaxModule.routingHeader.fromParams({
356
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
385
+ name: request.name ?? '',
357
386
  });
358
387
  this.initialize();
359
- return this.innerApiCalls.getKeyString(request, options, callback);
388
+ this._log.info('getKeyString request %j', request);
389
+ const wrappedCallback = callback
390
+ ? (error, response, options, rawResponse) => {
391
+ this._log.info('getKeyString response %j', response);
392
+ callback(error, response, options, rawResponse); // We verified callback above.
393
+ }
394
+ : undefined;
395
+ return this.innerApiCalls
396
+ .getKeyString(request, options, wrappedCallback)
397
+ ?.then(([response, options, rawResponse]) => {
398
+ this._log.info('getKeyString response %j', response);
399
+ return [response, options, rawResponse];
400
+ });
360
401
  }
361
402
  lookupKey(request, optionsOrCallback, callback) {
362
403
  request = request || {};
@@ -372,10 +413,21 @@ class ApiKeysClient {
372
413
  options.otherArgs = options.otherArgs || {};
373
414
  options.otherArgs.headers = options.otherArgs.headers || {};
374
415
  this.initialize();
375
- return this.innerApiCalls.lookupKey(request, options, callback);
416
+ this._log.info('lookupKey request %j', request);
417
+ const wrappedCallback = callback
418
+ ? (error, response, options, rawResponse) => {
419
+ this._log.info('lookupKey response %j', response);
420
+ callback(error, response, options, rawResponse); // We verified callback above.
421
+ }
422
+ : undefined;
423
+ return this.innerApiCalls
424
+ .lookupKey(request, options, wrappedCallback)
425
+ ?.then(([response, options, rawResponse]) => {
426
+ this._log.info('lookupKey response %j', response);
427
+ return [response, options, rawResponse];
428
+ });
376
429
  }
377
430
  createKey(request, optionsOrCallback, callback) {
378
- var _a;
379
431
  request = request || {};
380
432
  let options;
381
433
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -390,10 +442,22 @@ class ApiKeysClient {
390
442
  options.otherArgs.headers = options.otherArgs.headers || {};
391
443
  options.otherArgs.headers['x-goog-request-params'] =
392
444
  this._gaxModule.routingHeader.fromParams({
393
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
445
+ parent: request.parent ?? '',
394
446
  });
395
447
  this.initialize();
396
- return this.innerApiCalls.createKey(request, options, callback);
448
+ const wrappedCallback = callback
449
+ ? (error, response, rawResponse, _) => {
450
+ this._log.info('createKey response %j', rawResponse);
451
+ callback(error, response, rawResponse, _); // We verified callback above.
452
+ }
453
+ : undefined;
454
+ this._log.info('createKey request %j', request);
455
+ return this.innerApiCalls
456
+ .createKey(request, options, wrappedCallback)
457
+ ?.then(([response, rawResponse, _]) => {
458
+ this._log.info('createKey response %j', rawResponse);
459
+ return [response, rawResponse, _];
460
+ });
397
461
  }
398
462
  /**
399
463
  * Check the status of the long running operation returned by `createKey()`.
@@ -407,13 +471,13 @@ class ApiKeysClient {
407
471
  * region_tag:apikeys_v2_generated_ApiKeys_CreateKey_async
408
472
  */
409
473
  async checkCreateKeyProgress(name) {
474
+ this._log.info('createKey long-running');
410
475
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
411
476
  const [operation] = await this.operationsClient.getOperation(request);
412
477
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createKey, this._gaxModule.createDefaultBackoffSettings());
413
478
  return decodeOperation;
414
479
  }
415
480
  updateKey(request, optionsOrCallback, callback) {
416
- var _a;
417
481
  request = request || {};
418
482
  let options;
419
483
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -428,10 +492,22 @@ class ApiKeysClient {
428
492
  options.otherArgs.headers = options.otherArgs.headers || {};
429
493
  options.otherArgs.headers['x-goog-request-params'] =
430
494
  this._gaxModule.routingHeader.fromParams({
431
- 'key.name': (_a = request.key.name) !== null && _a !== void 0 ? _a : '',
495
+ 'key.name': request.key.name ?? '',
432
496
  });
433
497
  this.initialize();
434
- return this.innerApiCalls.updateKey(request, options, callback);
498
+ const wrappedCallback = callback
499
+ ? (error, response, rawResponse, _) => {
500
+ this._log.info('updateKey response %j', rawResponse);
501
+ callback(error, response, rawResponse, _); // We verified callback above.
502
+ }
503
+ : undefined;
504
+ this._log.info('updateKey request %j', request);
505
+ return this.innerApiCalls
506
+ .updateKey(request, options, wrappedCallback)
507
+ ?.then(([response, rawResponse, _]) => {
508
+ this._log.info('updateKey response %j', rawResponse);
509
+ return [response, rawResponse, _];
510
+ });
435
511
  }
436
512
  /**
437
513
  * Check the status of the long running operation returned by `updateKey()`.
@@ -445,13 +521,13 @@ class ApiKeysClient {
445
521
  * region_tag:apikeys_v2_generated_ApiKeys_UpdateKey_async
446
522
  */
447
523
  async checkUpdateKeyProgress(name) {
524
+ this._log.info('updateKey long-running');
448
525
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
449
526
  const [operation] = await this.operationsClient.getOperation(request);
450
527
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateKey, this._gaxModule.createDefaultBackoffSettings());
451
528
  return decodeOperation;
452
529
  }
453
530
  deleteKey(request, optionsOrCallback, callback) {
454
- var _a;
455
531
  request = request || {};
456
532
  let options;
457
533
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -466,10 +542,22 @@ class ApiKeysClient {
466
542
  options.otherArgs.headers = options.otherArgs.headers || {};
467
543
  options.otherArgs.headers['x-goog-request-params'] =
468
544
  this._gaxModule.routingHeader.fromParams({
469
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
545
+ name: request.name ?? '',
470
546
  });
471
547
  this.initialize();
472
- return this.innerApiCalls.deleteKey(request, options, callback);
548
+ const wrappedCallback = callback
549
+ ? (error, response, rawResponse, _) => {
550
+ this._log.info('deleteKey response %j', rawResponse);
551
+ callback(error, response, rawResponse, _); // We verified callback above.
552
+ }
553
+ : undefined;
554
+ this._log.info('deleteKey request %j', request);
555
+ return this.innerApiCalls
556
+ .deleteKey(request, options, wrappedCallback)
557
+ ?.then(([response, rawResponse, _]) => {
558
+ this._log.info('deleteKey response %j', rawResponse);
559
+ return [response, rawResponse, _];
560
+ });
473
561
  }
474
562
  /**
475
563
  * Check the status of the long running operation returned by `deleteKey()`.
@@ -483,13 +571,13 @@ class ApiKeysClient {
483
571
  * region_tag:apikeys_v2_generated_ApiKeys_DeleteKey_async
484
572
  */
485
573
  async checkDeleteKeyProgress(name) {
574
+ this._log.info('deleteKey long-running');
486
575
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
487
576
  const [operation] = await this.operationsClient.getOperation(request);
488
577
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteKey, this._gaxModule.createDefaultBackoffSettings());
489
578
  return decodeOperation;
490
579
  }
491
580
  undeleteKey(request, optionsOrCallback, callback) {
492
- var _a;
493
581
  request = request || {};
494
582
  let options;
495
583
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -504,10 +592,22 @@ class ApiKeysClient {
504
592
  options.otherArgs.headers = options.otherArgs.headers || {};
505
593
  options.otherArgs.headers['x-goog-request-params'] =
506
594
  this._gaxModule.routingHeader.fromParams({
507
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
595
+ name: request.name ?? '',
508
596
  });
509
597
  this.initialize();
510
- return this.innerApiCalls.undeleteKey(request, options, callback);
598
+ const wrappedCallback = callback
599
+ ? (error, response, rawResponse, _) => {
600
+ this._log.info('undeleteKey response %j', rawResponse);
601
+ callback(error, response, rawResponse, _); // We verified callback above.
602
+ }
603
+ : undefined;
604
+ this._log.info('undeleteKey request %j', request);
605
+ return this.innerApiCalls
606
+ .undeleteKey(request, options, wrappedCallback)
607
+ ?.then(([response, rawResponse, _]) => {
608
+ this._log.info('undeleteKey response %j', rawResponse);
609
+ return [response, rawResponse, _];
610
+ });
511
611
  }
512
612
  /**
513
613
  * Check the status of the long running operation returned by `undeleteKey()`.
@@ -521,13 +621,13 @@ class ApiKeysClient {
521
621
  * region_tag:apikeys_v2_generated_ApiKeys_UndeleteKey_async
522
622
  */
523
623
  async checkUndeleteKeyProgress(name) {
624
+ this._log.info('undeleteKey long-running');
524
625
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
525
626
  const [operation] = await this.operationsClient.getOperation(request);
526
627
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeleteKey, this._gaxModule.createDefaultBackoffSettings());
527
628
  return decodeOperation;
528
629
  }
529
630
  listKeys(request, optionsOrCallback, callback) {
530
- var _a;
531
631
  request = request || {};
532
632
  let options;
533
633
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -542,10 +642,22 @@ class ApiKeysClient {
542
642
  options.otherArgs.headers = options.otherArgs.headers || {};
543
643
  options.otherArgs.headers['x-goog-request-params'] =
544
644
  this._gaxModule.routingHeader.fromParams({
545
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
645
+ parent: request.parent ?? '',
546
646
  });
547
647
  this.initialize();
548
- return this.innerApiCalls.listKeys(request, options, callback);
648
+ const wrappedCallback = callback
649
+ ? (error, values, nextPageRequest, rawResponse) => {
650
+ this._log.info('listKeys values %j', values);
651
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
652
+ }
653
+ : undefined;
654
+ this._log.info('listKeys request %j', request);
655
+ return this.innerApiCalls
656
+ .listKeys(request, options, wrappedCallback)
657
+ ?.then(([response, input, output]) => {
658
+ this._log.info('listKeys values %j', response);
659
+ return [response, input, output];
660
+ });
549
661
  }
550
662
  /**
551
663
  * Equivalent to `listKeys`, but returns a NodeJS Stream object.
@@ -572,18 +684,18 @@ class ApiKeysClient {
572
684
  * for more details and examples.
573
685
  */
574
686
  listKeysStream(request, options) {
575
- var _a;
576
687
  request = request || {};
577
688
  options = options || {};
578
689
  options.otherArgs = options.otherArgs || {};
579
690
  options.otherArgs.headers = options.otherArgs.headers || {};
580
691
  options.otherArgs.headers['x-goog-request-params'] =
581
692
  this._gaxModule.routingHeader.fromParams({
582
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
693
+ parent: request.parent ?? '',
583
694
  });
584
695
  const defaultCallSettings = this._defaults['listKeys'];
585
696
  const callSettings = defaultCallSettings.merge(options);
586
697
  this.initialize();
698
+ this._log.info('listKeys stream %j', request);
587
699
  return this.descriptors.page.listKeys.createStream(this.innerApiCalls.listKeys, request, callSettings);
588
700
  }
589
701
  /**
@@ -614,18 +726,18 @@ class ApiKeysClient {
614
726
  * region_tag:apikeys_v2_generated_ApiKeys_ListKeys_async
615
727
  */
616
728
  listKeysAsync(request, options) {
617
- var _a;
618
729
  request = request || {};
619
730
  options = options || {};
620
731
  options.otherArgs = options.otherArgs || {};
621
732
  options.otherArgs.headers = options.otherArgs.headers || {};
622
733
  options.otherArgs.headers['x-goog-request-params'] =
623
734
  this._gaxModule.routingHeader.fromParams({
624
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
735
+ parent: request.parent ?? '',
625
736
  });
626
737
  const defaultCallSettings = this._defaults['listKeys'];
627
738
  const callSettings = defaultCallSettings.merge(options);
628
739
  this.initialize();
740
+ this._log.info('listKeys iterate %j', request);
629
741
  return this.descriptors.page.listKeys.asyncIterate(this.innerApiCalls['listKeys'], request, callSettings);
630
742
  }
631
743
  /**
@@ -659,7 +771,6 @@ class ApiKeysClient {
659
771
  * ```
660
772
  */
661
773
  getOperation(request, optionsOrCallback, callback) {
662
- var _a;
663
774
  let options;
664
775
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
665
776
  callback = optionsOrCallback;
@@ -673,7 +784,7 @@ class ApiKeysClient {
673
784
  options.otherArgs.headers = options.otherArgs.headers || {};
674
785
  options.otherArgs.headers['x-goog-request-params'] =
675
786
  this._gaxModule.routingHeader.fromParams({
676
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
787
+ name: request.name ?? '',
677
788
  });
678
789
  return this.operationsClient.getOperation(request, options, callback);
679
790
  }
@@ -708,13 +819,12 @@ class ApiKeysClient {
708
819
  * ```
709
820
  */
710
821
  listOperationsAsync(request, options) {
711
- var _a;
712
822
  options = options || {};
713
823
  options.otherArgs = options.otherArgs || {};
714
824
  options.otherArgs.headers = options.otherArgs.headers || {};
715
825
  options.otherArgs.headers['x-goog-request-params'] =
716
826
  this._gaxModule.routingHeader.fromParams({
717
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
827
+ name: request.name ?? '',
718
828
  });
719
829
  return this.operationsClient.listOperationsAsync(request, options);
720
830
  }
@@ -750,7 +860,6 @@ class ApiKeysClient {
750
860
  * ```
751
861
  */
752
862
  cancelOperation(request, optionsOrCallback, callback) {
753
- var _a;
754
863
  let options;
755
864
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
756
865
  callback = optionsOrCallback;
@@ -764,7 +873,7 @@ class ApiKeysClient {
764
873
  options.otherArgs.headers = options.otherArgs.headers || {};
765
874
  options.otherArgs.headers['x-goog-request-params'] =
766
875
  this._gaxModule.routingHeader.fromParams({
767
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
876
+ name: request.name ?? '',
768
877
  });
769
878
  return this.operationsClient.cancelOperation(request, options, callback);
770
879
  }
@@ -794,7 +903,6 @@ class ApiKeysClient {
794
903
  * ```
795
904
  */
796
905
  deleteOperation(request, optionsOrCallback, callback) {
797
- var _a;
798
906
  let options;
799
907
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
800
908
  callback = optionsOrCallback;
@@ -808,7 +916,7 @@ class ApiKeysClient {
808
916
  options.otherArgs.headers = options.otherArgs.headers || {};
809
917
  options.otherArgs.headers['x-goog-request-params'] =
810
918
  this._gaxModule.routingHeader.fromParams({
811
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
919
+ name: request.name ?? '',
812
920
  });
813
921
  return this.operationsClient.deleteOperation(request, options, callback);
814
922
  }
@@ -923,6 +1031,7 @@ class ApiKeysClient {
923
1031
  close() {
924
1032
  if (this.apiKeysStub && !this._terminated) {
925
1033
  return this.apiKeysStub.then(stub => {
1034
+ this._log.info('ending gRPC channel');
926
1035
  this._terminated = true;
927
1036
  stub.close();
928
1037
  this.operationsClient.close();
@@ -0,0 +1,4 @@
1
+ [
2
+ "../../protos/google/api/apikeys/v2/apikeys.proto",
3
+ "../../protos/google/api/apikeys/v2/resources.proto"
4
+ ]
@@ -0,0 +1,107 @@
1
+ {
2
+ "schema": "1.0",
3
+ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
4
+ "language": "typescript",
5
+ "protoPackage": "google.api.apikeys.v2",
6
+ "libraryPackage": "@google-cloud/apikeys",
7
+ "services": {
8
+ "ApiKeys": {
9
+ "clients": {
10
+ "grpc": {
11
+ "libraryClient": "ApiKeysClient",
12
+ "rpcs": {
13
+ "GetKey": {
14
+ "methods": [
15
+ "getKey"
16
+ ]
17
+ },
18
+ "GetKeyString": {
19
+ "methods": [
20
+ "getKeyString"
21
+ ]
22
+ },
23
+ "LookupKey": {
24
+ "methods": [
25
+ "lookupKey"
26
+ ]
27
+ },
28
+ "CreateKey": {
29
+ "methods": [
30
+ "createKey"
31
+ ]
32
+ },
33
+ "UpdateKey": {
34
+ "methods": [
35
+ "updateKey"
36
+ ]
37
+ },
38
+ "DeleteKey": {
39
+ "methods": [
40
+ "deleteKey"
41
+ ]
42
+ },
43
+ "UndeleteKey": {
44
+ "methods": [
45
+ "undeleteKey"
46
+ ]
47
+ },
48
+ "ListKeys": {
49
+ "methods": [
50
+ "listKeys",
51
+ "listKeysStream",
52
+ "listKeysAsync"
53
+ ]
54
+ }
55
+ }
56
+ },
57
+ "grpc-fallback": {
58
+ "libraryClient": "ApiKeysClient",
59
+ "rpcs": {
60
+ "GetKey": {
61
+ "methods": [
62
+ "getKey"
63
+ ]
64
+ },
65
+ "GetKeyString": {
66
+ "methods": [
67
+ "getKeyString"
68
+ ]
69
+ },
70
+ "LookupKey": {
71
+ "methods": [
72
+ "lookupKey"
73
+ ]
74
+ },
75
+ "CreateKey": {
76
+ "methods": [
77
+ "createKey"
78
+ ]
79
+ },
80
+ "UpdateKey": {
81
+ "methods": [
82
+ "updateKey"
83
+ ]
84
+ },
85
+ "DeleteKey": {
86
+ "methods": [
87
+ "deleteKey"
88
+ ]
89
+ },
90
+ "UndeleteKey": {
91
+ "methods": [
92
+ "undeleteKey"
93
+ ]
94
+ },
95
+ "ListKeys": {
96
+ "methods": [
97
+ "listKeys",
98
+ "listKeysStream",
99
+ "listKeysAsync"
100
+ ]
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google-cloud/apikeys",
3
- "version": "1.3.1",
3
+ "version": "2.0.0",
4
4
  "description": "API Keys API client for Node.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,26 +46,26 @@
46
46
  "test": "c8 mocha build/test"
47
47
  },
48
48
  "dependencies": {
49
- "google-gax": "^4.0.3"
49
+ "google-gax": "^5.0.0-rc.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@types/mocha": "^9.0.0",
53
- "@types/node": "^22.0.0",
54
- "@types/sinon": "^17.0.0",
55
- "c8": "^9.0.0",
56
- "gapic-tools": "^0.4.0",
57
- "gts": "^5.0.0",
58
- "jsdoc": "^4.0.0",
52
+ "@types/mocha": "^10.0.10",
53
+ "@types/node": "^22.13.9",
54
+ "@types/sinon": "^17.0.4",
55
+ "c8": "^10.1.3",
56
+ "gapic-tools": "^1.0.0",
57
+ "gts": "^6.0.2",
58
+ "jsdoc": "^4.0.4",
59
59
  "jsdoc-fresh": "^3.0.0",
60
60
  "jsdoc-region-tag": "^3.0.0",
61
- "linkinator": "4.1.2",
62
- "long": "^5.2.3",
63
- "mocha": "^9.2.2",
64
- "pack-n-play": "^2.0.0",
65
- "sinon": "^18.0.0",
66
- "typescript": "^5.1.6"
61
+ "linkinator": "^6.1.2",
62
+ "long": "^5.3.1",
63
+ "mocha": "^11.1.0",
64
+ "pack-n-play": "^3.0.0",
65
+ "sinon": "^19.0.2",
66
+ "typescript": "^5.8.2"
67
67
  },
68
68
  "engines": {
69
- "node": ">=14.0.0"
69
+ "node": ">=18"
70
70
  }
71
71
  }