@google-cloud/spanner 7.20.0 → 8.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.
Files changed (54) hide show
  1. package/README.md +1 -0
  2. package/build/protos/google/spanner/admin/database/v1/backup.proto +1 -1
  3. package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +1 -1
  4. package/build/protos/google/spanner/admin/database/v1/common.proto +1 -1
  5. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +1 -1
  6. package/build/protos/google/spanner/admin/instance/v1/common.proto +1 -1
  7. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +1 -1
  8. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +1 -1
  9. package/build/protos/google/spanner/v1/commit_response.proto +1 -1
  10. package/build/protos/google/spanner/v1/keys.proto +1 -1
  11. package/build/protos/google/spanner/v1/mutation.proto +1 -1
  12. package/build/protos/google/spanner/v1/query_plan.proto +1 -1
  13. package/build/protos/google/spanner/v1/result_set.proto +55 -49
  14. package/build/protos/google/spanner/v1/spanner.proto +1 -1
  15. package/build/protos/google/spanner/v1/transaction.proto +1 -1
  16. package/build/protos/google/spanner/v1/type.proto +1 -1
  17. package/build/protos/protos.d.ts +56 -50
  18. package/build/protos/protos.js +1016 -331
  19. package/build/protos/protos.json +47 -20
  20. package/build/src/backup.js +7 -0
  21. package/build/src/batch-transaction.d.ts +48 -29
  22. package/build/src/batch-transaction.js +13 -98
  23. package/build/src/codec.js +43 -26
  24. package/build/src/common-grpc/service-object.js +1 -0
  25. package/build/src/common-grpc/service.js +25 -8
  26. package/build/src/database.js +77 -49
  27. package/build/src/helper.d.ts +9 -0
  28. package/build/src/helper.js +24 -0
  29. package/build/src/index.js +24 -13
  30. package/build/src/instance-config.d.ts +1 -1
  31. package/build/src/instance-config.js +4 -0
  32. package/build/src/instance.js +12 -6
  33. package/build/src/instrument.d.ts +2 -0
  34. package/build/src/instrument.js +12 -9
  35. package/build/src/multiplexed-session.js +7 -1
  36. package/build/src/partial-result-stream.js +9 -5
  37. package/build/src/request_id_header.js +1 -0
  38. package/build/src/session-factory.js +5 -2
  39. package/build/src/session-pool.js +23 -6
  40. package/build/src/session.d.ts +2 -1
  41. package/build/src/session.js +8 -2
  42. package/build/src/table.js +6 -1
  43. package/build/src/transaction-runner.js +12 -2
  44. package/build/src/transaction.d.ts +2 -1
  45. package/build/src/transaction.js +95 -81
  46. package/build/src/v1/database_admin_client.d.ts +3 -2
  47. package/build/src/v1/database_admin_client.js +551 -167
  48. package/build/src/v1/instance_admin_client.d.ts +2 -1
  49. package/build/src/v1/instance_admin_client.js +453 -133
  50. package/build/src/v1/spanner_client.d.ts +2 -1
  51. package/build/src/v1/spanner_client.js +283 -85
  52. package/build/src/v1/spanner_executor_proxy_client.d.ts +2 -1
  53. package/build/src/v1/spanner_executor_proxy_client.js +41 -19
  54. package/package.json +57 -58
@@ -19,6 +19,7 @@
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.InstanceAdminClient = 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/v1/instance_admin_client_config.json`.
@@ -52,6 +53,28 @@ const version = require('../../../package.json').version;
52
53
  * @memberof v1
53
54
  */
54
55
  class InstanceAdminClient {
56
+ _terminated = false;
57
+ _opts;
58
+ _providedCustomServicePath;
59
+ _gaxModule;
60
+ _gaxGrpc;
61
+ _protos;
62
+ _defaults;
63
+ _universeDomain;
64
+ _servicePath;
65
+ _log = google_gax_1.loggingUtils.log('spanner');
66
+ auth;
67
+ descriptors = {
68
+ page: {},
69
+ stream: {},
70
+ longrunning: {},
71
+ batching: {},
72
+ };
73
+ warn;
74
+ innerApiCalls;
75
+ pathTemplates;
76
+ operationsClient;
77
+ instanceAdminStub;
55
78
  /**
56
79
  * Construct an instance of InstanceAdminClient.
57
80
  *
@@ -74,7 +97,7 @@ class InstanceAdminClient {
74
97
  * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
75
98
  * the environment variable GCLOUD_PROJECT for your project ID. If your
76
99
  * app is running in an environment which supports
77
- * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
100
+ * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
78
101
  * your project ID will be detected automatically.
79
102
  * @param {string} [options.apiEndpoint] - The domain name of the
80
103
  * API remote host.
@@ -92,32 +115,28 @@ class InstanceAdminClient {
92
115
  * ```
93
116
  */
94
117
  constructor(opts, gaxInstance) {
95
- var _a, _b, _c, _d, _e;
96
- this._terminated = false;
97
- this.descriptors = {
98
- page: {},
99
- stream: {},
100
- longrunning: {},
101
- batching: {},
102
- };
103
118
  // Ensure that options include all the required fields.
104
119
  const staticMembers = this.constructor;
105
- if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
106
- (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
107
- (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
120
+ if (opts?.universe_domain &&
121
+ opts?.universeDomain &&
122
+ opts?.universe_domain !== opts?.universeDomain) {
108
123
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
109
124
  }
110
125
  const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
111
126
  ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
112
127
  : undefined;
113
128
  this._universeDomain =
114
- (_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';
129
+ opts?.universeDomain ??
130
+ opts?.universe_domain ??
131
+ universeDomainEnvVar ??
132
+ 'googleapis.com';
115
133
  this._servicePath = 'spanner.' + this._universeDomain;
116
- const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
117
- this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
118
- const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
119
- const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
120
- 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');
134
+ const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
135
+ this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
136
+ const port = opts?.port || staticMembers.port;
137
+ const clientConfig = opts?.clientConfig ?? {};
138
+ const fallback = opts?.fallback ??
139
+ (typeof window !== 'undefined' && typeof window?.fetch === 'function');
121
140
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
122
141
  // Request numeric enum values if REST transport is used.
123
142
  opts.numericEnums = true;
@@ -388,7 +407,6 @@ class InstanceAdminClient {
388
407
  return this.auth.getProjectId();
389
408
  }
390
409
  getInstanceConfig(request, optionsOrCallback, callback) {
391
- var _a;
392
410
  request = request || {};
393
411
  let options;
394
412
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -403,13 +421,26 @@ class InstanceAdminClient {
403
421
  options.otherArgs.headers = options.otherArgs.headers || {};
404
422
  options.otherArgs.headers['x-goog-request-params'] =
405
423
  this._gaxModule.routingHeader.fromParams({
406
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
424
+ name: request.name ?? '',
407
425
  });
408
- this.initialize();
409
- return this.innerApiCalls.getInstanceConfig(request, options, callback);
426
+ this.initialize().catch(err => {
427
+ throw err;
428
+ });
429
+ this._log.info('getInstanceConfig request %j', request);
430
+ const wrappedCallback = callback
431
+ ? (error, response, options, rawResponse) => {
432
+ this._log.info('getInstanceConfig response %j', response);
433
+ callback(error, response, options, rawResponse); // We verified callback above.
434
+ }
435
+ : undefined;
436
+ return this.innerApiCalls
437
+ .getInstanceConfig(request, options, wrappedCallback)
438
+ ?.then(([response, options, rawResponse]) => {
439
+ this._log.info('getInstanceConfig response %j', response);
440
+ return [response, options, rawResponse];
441
+ });
410
442
  }
411
443
  deleteInstanceConfig(request, optionsOrCallback, callback) {
412
- var _a;
413
444
  request = request || {};
414
445
  let options;
415
446
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -424,13 +455,26 @@ class InstanceAdminClient {
424
455
  options.otherArgs.headers = options.otherArgs.headers || {};
425
456
  options.otherArgs.headers['x-goog-request-params'] =
426
457
  this._gaxModule.routingHeader.fromParams({
427
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
458
+ name: request.name ?? '',
428
459
  });
429
- this.initialize();
430
- return this.innerApiCalls.deleteInstanceConfig(request, options, callback);
460
+ this.initialize().catch(err => {
461
+ throw err;
462
+ });
463
+ this._log.info('deleteInstanceConfig request %j', request);
464
+ const wrappedCallback = callback
465
+ ? (error, response, options, rawResponse) => {
466
+ this._log.info('deleteInstanceConfig response %j', response);
467
+ callback(error, response, options, rawResponse); // We verified callback above.
468
+ }
469
+ : undefined;
470
+ return this.innerApiCalls
471
+ .deleteInstanceConfig(request, options, wrappedCallback)
472
+ ?.then(([response, options, rawResponse]) => {
473
+ this._log.info('deleteInstanceConfig response %j', response);
474
+ return [response, options, rawResponse];
475
+ });
431
476
  }
432
477
  getInstance(request, optionsOrCallback, callback) {
433
- var _a;
434
478
  request = request || {};
435
479
  let options;
436
480
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -445,13 +489,26 @@ class InstanceAdminClient {
445
489
  options.otherArgs.headers = options.otherArgs.headers || {};
446
490
  options.otherArgs.headers['x-goog-request-params'] =
447
491
  this._gaxModule.routingHeader.fromParams({
448
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
492
+ name: request.name ?? '',
449
493
  });
450
- this.initialize();
451
- return this.innerApiCalls.getInstance(request, options, callback);
494
+ this.initialize().catch(err => {
495
+ throw err;
496
+ });
497
+ this._log.info('getInstance request %j', request);
498
+ const wrappedCallback = callback
499
+ ? (error, response, options, rawResponse) => {
500
+ this._log.info('getInstance response %j', response);
501
+ callback(error, response, options, rawResponse); // We verified callback above.
502
+ }
503
+ : undefined;
504
+ return this.innerApiCalls
505
+ .getInstance(request, options, wrappedCallback)
506
+ ?.then(([response, options, rawResponse]) => {
507
+ this._log.info('getInstance response %j', response);
508
+ return [response, options, rawResponse];
509
+ });
452
510
  }
453
511
  deleteInstance(request, optionsOrCallback, callback) {
454
- var _a;
455
512
  request = request || {};
456
513
  let options;
457
514
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -466,13 +523,26 @@ class InstanceAdminClient {
466
523
  options.otherArgs.headers = options.otherArgs.headers || {};
467
524
  options.otherArgs.headers['x-goog-request-params'] =
468
525
  this._gaxModule.routingHeader.fromParams({
469
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
526
+ name: request.name ?? '',
470
527
  });
471
- this.initialize();
472
- return this.innerApiCalls.deleteInstance(request, options, callback);
528
+ this.initialize().catch(err => {
529
+ throw err;
530
+ });
531
+ this._log.info('deleteInstance request %j', request);
532
+ const wrappedCallback = callback
533
+ ? (error, response, options, rawResponse) => {
534
+ this._log.info('deleteInstance response %j', response);
535
+ callback(error, response, options, rawResponse); // We verified callback above.
536
+ }
537
+ : undefined;
538
+ return this.innerApiCalls
539
+ .deleteInstance(request, options, wrappedCallback)
540
+ ?.then(([response, options, rawResponse]) => {
541
+ this._log.info('deleteInstance response %j', response);
542
+ return [response, options, rawResponse];
543
+ });
473
544
  }
474
545
  setIamPolicy(request, optionsOrCallback, callback) {
475
- var _a;
476
546
  request = request || {};
477
547
  let options;
478
548
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -487,13 +557,26 @@ class InstanceAdminClient {
487
557
  options.otherArgs.headers = options.otherArgs.headers || {};
488
558
  options.otherArgs.headers['x-goog-request-params'] =
489
559
  this._gaxModule.routingHeader.fromParams({
490
- resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
560
+ resource: request.resource ?? '',
491
561
  });
492
- this.initialize();
493
- return this.innerApiCalls.setIamPolicy(request, options, callback);
562
+ this.initialize().catch(err => {
563
+ throw err;
564
+ });
565
+ this._log.info('setIamPolicy request %j', request);
566
+ const wrappedCallback = callback
567
+ ? (error, response, options, rawResponse) => {
568
+ this._log.info('setIamPolicy response %j', response);
569
+ callback(error, response, options, rawResponse); // We verified callback above.
570
+ }
571
+ : undefined;
572
+ return this.innerApiCalls
573
+ .setIamPolicy(request, options, wrappedCallback)
574
+ ?.then(([response, options, rawResponse]) => {
575
+ this._log.info('setIamPolicy response %j', response);
576
+ return [response, options, rawResponse];
577
+ });
494
578
  }
495
579
  getIamPolicy(request, optionsOrCallback, callback) {
496
- var _a;
497
580
  request = request || {};
498
581
  let options;
499
582
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -508,13 +591,26 @@ class InstanceAdminClient {
508
591
  options.otherArgs.headers = options.otherArgs.headers || {};
509
592
  options.otherArgs.headers['x-goog-request-params'] =
510
593
  this._gaxModule.routingHeader.fromParams({
511
- resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
594
+ resource: request.resource ?? '',
512
595
  });
513
- this.initialize();
514
- return this.innerApiCalls.getIamPolicy(request, options, callback);
596
+ this.initialize().catch(err => {
597
+ throw err;
598
+ });
599
+ this._log.info('getIamPolicy request %j', request);
600
+ const wrappedCallback = callback
601
+ ? (error, response, options, rawResponse) => {
602
+ this._log.info('getIamPolicy response %j', response);
603
+ callback(error, response, options, rawResponse); // We verified callback above.
604
+ }
605
+ : undefined;
606
+ return this.innerApiCalls
607
+ .getIamPolicy(request, options, wrappedCallback)
608
+ ?.then(([response, options, rawResponse]) => {
609
+ this._log.info('getIamPolicy response %j', response);
610
+ return [response, options, rawResponse];
611
+ });
515
612
  }
516
613
  testIamPermissions(request, optionsOrCallback, callback) {
517
- var _a;
518
614
  request = request || {};
519
615
  let options;
520
616
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -529,13 +625,26 @@ class InstanceAdminClient {
529
625
  options.otherArgs.headers = options.otherArgs.headers || {};
530
626
  options.otherArgs.headers['x-goog-request-params'] =
531
627
  this._gaxModule.routingHeader.fromParams({
532
- resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
628
+ resource: request.resource ?? '',
533
629
  });
534
- this.initialize();
535
- return this.innerApiCalls.testIamPermissions(request, options, callback);
630
+ this.initialize().catch(err => {
631
+ throw err;
632
+ });
633
+ this._log.info('testIamPermissions request %j', request);
634
+ const wrappedCallback = callback
635
+ ? (error, response, options, rawResponse) => {
636
+ this._log.info('testIamPermissions response %j', response);
637
+ callback(error, response, options, rawResponse); // We verified callback above.
638
+ }
639
+ : undefined;
640
+ return this.innerApiCalls
641
+ .testIamPermissions(request, options, wrappedCallback)
642
+ ?.then(([response, options, rawResponse]) => {
643
+ this._log.info('testIamPermissions response %j', response);
644
+ return [response, options, rawResponse];
645
+ });
536
646
  }
537
647
  getInstancePartition(request, optionsOrCallback, callback) {
538
- var _a;
539
648
  request = request || {};
540
649
  let options;
541
650
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -550,13 +659,26 @@ class InstanceAdminClient {
550
659
  options.otherArgs.headers = options.otherArgs.headers || {};
551
660
  options.otherArgs.headers['x-goog-request-params'] =
552
661
  this._gaxModule.routingHeader.fromParams({
553
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
662
+ name: request.name ?? '',
554
663
  });
555
- this.initialize();
556
- return this.innerApiCalls.getInstancePartition(request, options, callback);
664
+ this.initialize().catch(err => {
665
+ throw err;
666
+ });
667
+ this._log.info('getInstancePartition request %j', request);
668
+ const wrappedCallback = callback
669
+ ? (error, response, options, rawResponse) => {
670
+ this._log.info('getInstancePartition response %j', response);
671
+ callback(error, response, options, rawResponse); // We verified callback above.
672
+ }
673
+ : undefined;
674
+ return this.innerApiCalls
675
+ .getInstancePartition(request, options, wrappedCallback)
676
+ ?.then(([response, options, rawResponse]) => {
677
+ this._log.info('getInstancePartition response %j', response);
678
+ return [response, options, rawResponse];
679
+ });
557
680
  }
558
681
  deleteInstancePartition(request, optionsOrCallback, callback) {
559
- var _a;
560
682
  request = request || {};
561
683
  let options;
562
684
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -571,13 +693,26 @@ class InstanceAdminClient {
571
693
  options.otherArgs.headers = options.otherArgs.headers || {};
572
694
  options.otherArgs.headers['x-goog-request-params'] =
573
695
  this._gaxModule.routingHeader.fromParams({
574
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
696
+ name: request.name ?? '',
575
697
  });
576
- this.initialize();
577
- return this.innerApiCalls.deleteInstancePartition(request, options, callback);
698
+ this.initialize().catch(err => {
699
+ throw err;
700
+ });
701
+ this._log.info('deleteInstancePartition request %j', request);
702
+ const wrappedCallback = callback
703
+ ? (error, response, options, rawResponse) => {
704
+ this._log.info('deleteInstancePartition response %j', response);
705
+ callback(error, response, options, rawResponse); // We verified callback above.
706
+ }
707
+ : undefined;
708
+ return this.innerApiCalls
709
+ .deleteInstancePartition(request, options, wrappedCallback)
710
+ ?.then(([response, options, rawResponse]) => {
711
+ this._log.info('deleteInstancePartition response %j', response);
712
+ return [response, options, rawResponse];
713
+ });
578
714
  }
579
715
  createInstanceConfig(request, optionsOrCallback, callback) {
580
- var _a;
581
716
  request = request || {};
582
717
  let options;
583
718
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -592,10 +727,24 @@ class InstanceAdminClient {
592
727
  options.otherArgs.headers = options.otherArgs.headers || {};
593
728
  options.otherArgs.headers['x-goog-request-params'] =
594
729
  this._gaxModule.routingHeader.fromParams({
595
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
730
+ parent: request.parent ?? '',
596
731
  });
597
- this.initialize();
598
- return this.innerApiCalls.createInstanceConfig(request, options, callback);
732
+ this.initialize().catch(err => {
733
+ throw err;
734
+ });
735
+ const wrappedCallback = callback
736
+ ? (error, response, rawResponse, _) => {
737
+ this._log.info('createInstanceConfig response %j', rawResponse);
738
+ callback(error, response, rawResponse, _); // We verified callback above.
739
+ }
740
+ : undefined;
741
+ this._log.info('createInstanceConfig request %j', request);
742
+ return this.innerApiCalls
743
+ .createInstanceConfig(request, options, wrappedCallback)
744
+ ?.then(([response, rawResponse, _]) => {
745
+ this._log.info('createInstanceConfig response %j', rawResponse);
746
+ return [response, rawResponse, _];
747
+ });
599
748
  }
600
749
  /**
601
750
  * Check the status of the long running operation returned by `createInstanceConfig()`.
@@ -607,13 +756,13 @@ class InstanceAdminClient {
607
756
  * for more details and examples.
608
757
  */
609
758
  async checkCreateInstanceConfigProgress(name) {
759
+ this._log.info('createInstanceConfig long-running');
610
760
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
611
761
  const [operation] = await this.operationsClient.getOperation(request);
612
762
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstanceConfig, this._gaxModule.createDefaultBackoffSettings());
613
763
  return decodeOperation;
614
764
  }
615
765
  updateInstanceConfig(request, optionsOrCallback, callback) {
616
- var _a;
617
766
  request = request || {};
618
767
  let options;
619
768
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -628,10 +777,24 @@ class InstanceAdminClient {
628
777
  options.otherArgs.headers = options.otherArgs.headers || {};
629
778
  options.otherArgs.headers['x-goog-request-params'] =
630
779
  this._gaxModule.routingHeader.fromParams({
631
- 'instance_config.name': (_a = request.instanceConfig.name) !== null && _a !== void 0 ? _a : '',
780
+ 'instance_config.name': request.instanceConfig.name ?? '',
632
781
  });
633
- this.initialize();
634
- return this.innerApiCalls.updateInstanceConfig(request, options, callback);
782
+ this.initialize().catch(err => {
783
+ throw err;
784
+ });
785
+ const wrappedCallback = callback
786
+ ? (error, response, rawResponse, _) => {
787
+ this._log.info('updateInstanceConfig response %j', rawResponse);
788
+ callback(error, response, rawResponse, _); // We verified callback above.
789
+ }
790
+ : undefined;
791
+ this._log.info('updateInstanceConfig request %j', request);
792
+ return this.innerApiCalls
793
+ .updateInstanceConfig(request, options, wrappedCallback)
794
+ ?.then(([response, rawResponse, _]) => {
795
+ this._log.info('updateInstanceConfig response %j', rawResponse);
796
+ return [response, rawResponse, _];
797
+ });
635
798
  }
636
799
  /**
637
800
  * Check the status of the long running operation returned by `updateInstanceConfig()`.
@@ -643,13 +806,13 @@ class InstanceAdminClient {
643
806
  * for more details and examples.
644
807
  */
645
808
  async checkUpdateInstanceConfigProgress(name) {
809
+ this._log.info('updateInstanceConfig long-running');
646
810
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
647
811
  const [operation] = await this.operationsClient.getOperation(request);
648
812
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstanceConfig, this._gaxModule.createDefaultBackoffSettings());
649
813
  return decodeOperation;
650
814
  }
651
815
  createInstance(request, optionsOrCallback, callback) {
652
- var _a;
653
816
  request = request || {};
654
817
  let options;
655
818
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -664,10 +827,24 @@ class InstanceAdminClient {
664
827
  options.otherArgs.headers = options.otherArgs.headers || {};
665
828
  options.otherArgs.headers['x-goog-request-params'] =
666
829
  this._gaxModule.routingHeader.fromParams({
667
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
830
+ parent: request.parent ?? '',
668
831
  });
669
- this.initialize();
670
- return this.innerApiCalls.createInstance(request, options, callback);
832
+ this.initialize().catch(err => {
833
+ throw err;
834
+ });
835
+ const wrappedCallback = callback
836
+ ? (error, response, rawResponse, _) => {
837
+ this._log.info('createInstance response %j', rawResponse);
838
+ callback(error, response, rawResponse, _); // We verified callback above.
839
+ }
840
+ : undefined;
841
+ this._log.info('createInstance request %j', request);
842
+ return this.innerApiCalls
843
+ .createInstance(request, options, wrappedCallback)
844
+ ?.then(([response, rawResponse, _]) => {
845
+ this._log.info('createInstance response %j', rawResponse);
846
+ return [response, rawResponse, _];
847
+ });
671
848
  }
672
849
  /**
673
850
  * Check the status of the long running operation returned by `createInstance()`.
@@ -679,13 +856,13 @@ class InstanceAdminClient {
679
856
  * for more details and examples.
680
857
  */
681
858
  async checkCreateInstanceProgress(name) {
859
+ this._log.info('createInstance long-running');
682
860
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
683
861
  const [operation] = await this.operationsClient.getOperation(request);
684
862
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings());
685
863
  return decodeOperation;
686
864
  }
687
865
  updateInstance(request, optionsOrCallback, callback) {
688
- var _a;
689
866
  request = request || {};
690
867
  let options;
691
868
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -700,10 +877,24 @@ class InstanceAdminClient {
700
877
  options.otherArgs.headers = options.otherArgs.headers || {};
701
878
  options.otherArgs.headers['x-goog-request-params'] =
702
879
  this._gaxModule.routingHeader.fromParams({
703
- 'instance.name': (_a = request.instance.name) !== null && _a !== void 0 ? _a : '',
880
+ 'instance.name': request.instance.name ?? '',
704
881
  });
705
- this.initialize();
706
- return this.innerApiCalls.updateInstance(request, options, callback);
882
+ this.initialize().catch(err => {
883
+ throw err;
884
+ });
885
+ const wrappedCallback = callback
886
+ ? (error, response, rawResponse, _) => {
887
+ this._log.info('updateInstance response %j', rawResponse);
888
+ callback(error, response, rawResponse, _); // We verified callback above.
889
+ }
890
+ : undefined;
891
+ this._log.info('updateInstance request %j', request);
892
+ return this.innerApiCalls
893
+ .updateInstance(request, options, wrappedCallback)
894
+ ?.then(([response, rawResponse, _]) => {
895
+ this._log.info('updateInstance response %j', rawResponse);
896
+ return [response, rawResponse, _];
897
+ });
707
898
  }
708
899
  /**
709
900
  * Check the status of the long running operation returned by `updateInstance()`.
@@ -715,13 +906,13 @@ class InstanceAdminClient {
715
906
  * for more details and examples.
716
907
  */
717
908
  async checkUpdateInstanceProgress(name) {
909
+ this._log.info('updateInstance long-running');
718
910
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
719
911
  const [operation] = await this.operationsClient.getOperation(request);
720
912
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings());
721
913
  return decodeOperation;
722
914
  }
723
915
  createInstancePartition(request, optionsOrCallback, callback) {
724
- var _a;
725
916
  request = request || {};
726
917
  let options;
727
918
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -736,10 +927,24 @@ class InstanceAdminClient {
736
927
  options.otherArgs.headers = options.otherArgs.headers || {};
737
928
  options.otherArgs.headers['x-goog-request-params'] =
738
929
  this._gaxModule.routingHeader.fromParams({
739
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
930
+ parent: request.parent ?? '',
740
931
  });
741
- this.initialize();
742
- return this.innerApiCalls.createInstancePartition(request, options, callback);
932
+ this.initialize().catch(err => {
933
+ throw err;
934
+ });
935
+ const wrappedCallback = callback
936
+ ? (error, response, rawResponse, _) => {
937
+ this._log.info('createInstancePartition response %j', rawResponse);
938
+ callback(error, response, rawResponse, _); // We verified callback above.
939
+ }
940
+ : undefined;
941
+ this._log.info('createInstancePartition request %j', request);
942
+ return this.innerApiCalls
943
+ .createInstancePartition(request, options, wrappedCallback)
944
+ ?.then(([response, rawResponse, _]) => {
945
+ this._log.info('createInstancePartition response %j', rawResponse);
946
+ return [response, rawResponse, _];
947
+ });
743
948
  }
744
949
  /**
745
950
  * Check the status of the long running operation returned by `createInstancePartition()`.
@@ -751,13 +956,13 @@ class InstanceAdminClient {
751
956
  * for more details and examples.
752
957
  */
753
958
  async checkCreateInstancePartitionProgress(name) {
959
+ this._log.info('createInstancePartition long-running');
754
960
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
755
961
  const [operation] = await this.operationsClient.getOperation(request);
756
962
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstancePartition, this._gaxModule.createDefaultBackoffSettings());
757
963
  return decodeOperation;
758
964
  }
759
965
  updateInstancePartition(request, optionsOrCallback, callback) {
760
- var _a;
761
966
  request = request || {};
762
967
  let options;
763
968
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -772,10 +977,24 @@ class InstanceAdminClient {
772
977
  options.otherArgs.headers = options.otherArgs.headers || {};
773
978
  options.otherArgs.headers['x-goog-request-params'] =
774
979
  this._gaxModule.routingHeader.fromParams({
775
- 'instance_partition.name': (_a = request.instancePartition.name) !== null && _a !== void 0 ? _a : '',
980
+ 'instance_partition.name': request.instancePartition.name ?? '',
776
981
  });
777
- this.initialize();
778
- return this.innerApiCalls.updateInstancePartition(request, options, callback);
982
+ this.initialize().catch(err => {
983
+ throw err;
984
+ });
985
+ const wrappedCallback = callback
986
+ ? (error, response, rawResponse, _) => {
987
+ this._log.info('updateInstancePartition response %j', rawResponse);
988
+ callback(error, response, rawResponse, _); // We verified callback above.
989
+ }
990
+ : undefined;
991
+ this._log.info('updateInstancePartition request %j', request);
992
+ return this.innerApiCalls
993
+ .updateInstancePartition(request, options, wrappedCallback)
994
+ ?.then(([response, rawResponse, _]) => {
995
+ this._log.info('updateInstancePartition response %j', rawResponse);
996
+ return [response, rawResponse, _];
997
+ });
779
998
  }
780
999
  /**
781
1000
  * Check the status of the long running operation returned by `updateInstancePartition()`.
@@ -787,13 +1006,13 @@ class InstanceAdminClient {
787
1006
  * for more details and examples.
788
1007
  */
789
1008
  async checkUpdateInstancePartitionProgress(name) {
1009
+ this._log.info('updateInstancePartition long-running');
790
1010
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
791
1011
  const [operation] = await this.operationsClient.getOperation(request);
792
1012
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstancePartition, this._gaxModule.createDefaultBackoffSettings());
793
1013
  return decodeOperation;
794
1014
  }
795
1015
  moveInstance(request, optionsOrCallback, callback) {
796
- var _a;
797
1016
  request = request || {};
798
1017
  let options;
799
1018
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -808,10 +1027,24 @@ class InstanceAdminClient {
808
1027
  options.otherArgs.headers = options.otherArgs.headers || {};
809
1028
  options.otherArgs.headers['x-goog-request-params'] =
810
1029
  this._gaxModule.routingHeader.fromParams({
811
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1030
+ name: request.name ?? '',
812
1031
  });
813
- this.initialize();
814
- return this.innerApiCalls.moveInstance(request, options, callback);
1032
+ this.initialize().catch(err => {
1033
+ throw err;
1034
+ });
1035
+ const wrappedCallback = callback
1036
+ ? (error, response, rawResponse, _) => {
1037
+ this._log.info('moveInstance response %j', rawResponse);
1038
+ callback(error, response, rawResponse, _); // We verified callback above.
1039
+ }
1040
+ : undefined;
1041
+ this._log.info('moveInstance request %j', request);
1042
+ return this.innerApiCalls
1043
+ .moveInstance(request, options, wrappedCallback)
1044
+ ?.then(([response, rawResponse, _]) => {
1045
+ this._log.info('moveInstance response %j', rawResponse);
1046
+ return [response, rawResponse, _];
1047
+ });
815
1048
  }
816
1049
  /**
817
1050
  * Check the status of the long running operation returned by `moveInstance()`.
@@ -823,13 +1056,13 @@ class InstanceAdminClient {
823
1056
  * for more details and examples.
824
1057
  */
825
1058
  async checkMoveInstanceProgress(name) {
1059
+ this._log.info('moveInstance long-running');
826
1060
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
827
1061
  const [operation] = await this.operationsClient.getOperation(request);
828
1062
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.moveInstance, this._gaxModule.createDefaultBackoffSettings());
829
1063
  return decodeOperation;
830
1064
  }
831
1065
  listInstanceConfigs(request, optionsOrCallback, callback) {
832
- var _a;
833
1066
  request = request || {};
834
1067
  let options;
835
1068
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -844,10 +1077,24 @@ class InstanceAdminClient {
844
1077
  options.otherArgs.headers = options.otherArgs.headers || {};
845
1078
  options.otherArgs.headers['x-goog-request-params'] =
846
1079
  this._gaxModule.routingHeader.fromParams({
847
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1080
+ parent: request.parent ?? '',
848
1081
  });
849
- this.initialize();
850
- return this.innerApiCalls.listInstanceConfigs(request, options, callback);
1082
+ this.initialize().catch(err => {
1083
+ throw err;
1084
+ });
1085
+ const wrappedCallback = callback
1086
+ ? (error, values, nextPageRequest, rawResponse) => {
1087
+ this._log.info('listInstanceConfigs values %j', values);
1088
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1089
+ }
1090
+ : undefined;
1091
+ this._log.info('listInstanceConfigs request %j', request);
1092
+ return this.innerApiCalls
1093
+ .listInstanceConfigs(request, options, wrappedCallback)
1094
+ ?.then(([response, input, output]) => {
1095
+ this._log.info('listInstanceConfigs values %j', response);
1096
+ return [response, input, output];
1097
+ });
851
1098
  }
852
1099
  /**
853
1100
  * Equivalent to `listInstanceConfigs`, but returns a NodeJS Stream object.
@@ -877,18 +1124,20 @@ class InstanceAdminClient {
877
1124
  * for more details and examples.
878
1125
  */
879
1126
  listInstanceConfigsStream(request, options) {
880
- var _a;
881
1127
  request = request || {};
882
1128
  options = options || {};
883
1129
  options.otherArgs = options.otherArgs || {};
884
1130
  options.otherArgs.headers = options.otherArgs.headers || {};
885
1131
  options.otherArgs.headers['x-goog-request-params'] =
886
1132
  this._gaxModule.routingHeader.fromParams({
887
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1133
+ parent: request.parent ?? '',
888
1134
  });
889
1135
  const defaultCallSettings = this._defaults['listInstanceConfigs'];
890
1136
  const callSettings = defaultCallSettings.merge(options);
891
- this.initialize();
1137
+ this.initialize().catch(err => {
1138
+ throw err;
1139
+ });
1140
+ this._log.info('listInstanceConfigs stream %j', request);
892
1141
  return this.descriptors.page.listInstanceConfigs.createStream(this.innerApiCalls.listInstanceConfigs, request, callSettings);
893
1142
  }
894
1143
  /**
@@ -920,22 +1169,23 @@ class InstanceAdminClient {
920
1169
  * for more details and examples.
921
1170
  */
922
1171
  listInstanceConfigsAsync(request, options) {
923
- var _a;
924
1172
  request = request || {};
925
1173
  options = options || {};
926
1174
  options.otherArgs = options.otherArgs || {};
927
1175
  options.otherArgs.headers = options.otherArgs.headers || {};
928
1176
  options.otherArgs.headers['x-goog-request-params'] =
929
1177
  this._gaxModule.routingHeader.fromParams({
930
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1178
+ parent: request.parent ?? '',
931
1179
  });
932
1180
  const defaultCallSettings = this._defaults['listInstanceConfigs'];
933
1181
  const callSettings = defaultCallSettings.merge(options);
934
- this.initialize();
1182
+ this.initialize().catch(err => {
1183
+ throw err;
1184
+ });
1185
+ this._log.info('listInstanceConfigs iterate %j', request);
935
1186
  return this.descriptors.page.listInstanceConfigs.asyncIterate(this.innerApiCalls['listInstanceConfigs'], request, callSettings);
936
1187
  }
937
1188
  listInstanceConfigOperations(request, optionsOrCallback, callback) {
938
- var _a;
939
1189
  request = request || {};
940
1190
  let options;
941
1191
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -950,10 +1200,24 @@ class InstanceAdminClient {
950
1200
  options.otherArgs.headers = options.otherArgs.headers || {};
951
1201
  options.otherArgs.headers['x-goog-request-params'] =
952
1202
  this._gaxModule.routingHeader.fromParams({
953
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1203
+ parent: request.parent ?? '',
954
1204
  });
955
- this.initialize();
956
- return this.innerApiCalls.listInstanceConfigOperations(request, options, callback);
1205
+ this.initialize().catch(err => {
1206
+ throw err;
1207
+ });
1208
+ const wrappedCallback = callback
1209
+ ? (error, values, nextPageRequest, rawResponse) => {
1210
+ this._log.info('listInstanceConfigOperations values %j', values);
1211
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1212
+ }
1213
+ : undefined;
1214
+ this._log.info('listInstanceConfigOperations request %j', request);
1215
+ return this.innerApiCalls
1216
+ .listInstanceConfigOperations(request, options, wrappedCallback)
1217
+ ?.then(([response, input, output]) => {
1218
+ this._log.info('listInstanceConfigOperations values %j', response);
1219
+ return [response, input, output];
1220
+ });
957
1221
  }
958
1222
  /**
959
1223
  * Equivalent to `listInstanceConfigOperations`, but returns a NodeJS Stream object.
@@ -1026,18 +1290,20 @@ class InstanceAdminClient {
1026
1290
  * for more details and examples.
1027
1291
  */
1028
1292
  listInstanceConfigOperationsStream(request, options) {
1029
- var _a;
1030
1293
  request = request || {};
1031
1294
  options = options || {};
1032
1295
  options.otherArgs = options.otherArgs || {};
1033
1296
  options.otherArgs.headers = options.otherArgs.headers || {};
1034
1297
  options.otherArgs.headers['x-goog-request-params'] =
1035
1298
  this._gaxModule.routingHeader.fromParams({
1036
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1299
+ parent: request.parent ?? '',
1037
1300
  });
1038
1301
  const defaultCallSettings = this._defaults['listInstanceConfigOperations'];
1039
1302
  const callSettings = defaultCallSettings.merge(options);
1040
- this.initialize();
1303
+ this.initialize().catch(err => {
1304
+ throw err;
1305
+ });
1306
+ this._log.info('listInstanceConfigOperations stream %j', request);
1041
1307
  return this.descriptors.page.listInstanceConfigOperations.createStream(this.innerApiCalls.listInstanceConfigOperations, request, callSettings);
1042
1308
  }
1043
1309
  /**
@@ -1112,22 +1378,23 @@ class InstanceAdminClient {
1112
1378
  * for more details and examples.
1113
1379
  */
1114
1380
  listInstanceConfigOperationsAsync(request, options) {
1115
- var _a;
1116
1381
  request = request || {};
1117
1382
  options = options || {};
1118
1383
  options.otherArgs = options.otherArgs || {};
1119
1384
  options.otherArgs.headers = options.otherArgs.headers || {};
1120
1385
  options.otherArgs.headers['x-goog-request-params'] =
1121
1386
  this._gaxModule.routingHeader.fromParams({
1122
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1387
+ parent: request.parent ?? '',
1123
1388
  });
1124
1389
  const defaultCallSettings = this._defaults['listInstanceConfigOperations'];
1125
1390
  const callSettings = defaultCallSettings.merge(options);
1126
- this.initialize();
1391
+ this.initialize().catch(err => {
1392
+ throw err;
1393
+ });
1394
+ this._log.info('listInstanceConfigOperations iterate %j', request);
1127
1395
  return this.descriptors.page.listInstanceConfigOperations.asyncIterate(this.innerApiCalls['listInstanceConfigOperations'], request, callSettings);
1128
1396
  }
1129
1397
  listInstances(request, optionsOrCallback, callback) {
1130
- var _a;
1131
1398
  request = request || {};
1132
1399
  let options;
1133
1400
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1142,10 +1409,24 @@ class InstanceAdminClient {
1142
1409
  options.otherArgs.headers = options.otherArgs.headers || {};
1143
1410
  options.otherArgs.headers['x-goog-request-params'] =
1144
1411
  this._gaxModule.routingHeader.fromParams({
1145
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1412
+ parent: request.parent ?? '',
1146
1413
  });
1147
- this.initialize();
1148
- return this.innerApiCalls.listInstances(request, options, callback);
1414
+ this.initialize().catch(err => {
1415
+ throw err;
1416
+ });
1417
+ const wrappedCallback = callback
1418
+ ? (error, values, nextPageRequest, rawResponse) => {
1419
+ this._log.info('listInstances values %j', values);
1420
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1421
+ }
1422
+ : undefined;
1423
+ this._log.info('listInstances request %j', request);
1424
+ return this.innerApiCalls
1425
+ .listInstances(request, options, wrappedCallback)
1426
+ ?.then(([response, input, output]) => {
1427
+ this._log.info('listInstances values %j', response);
1428
+ return [response, input, output];
1429
+ });
1149
1430
  }
1150
1431
  /**
1151
1432
  * Equivalent to `listInstances`, but returns a NodeJS Stream object.
@@ -1201,18 +1482,20 @@ class InstanceAdminClient {
1201
1482
  * for more details and examples.
1202
1483
  */
1203
1484
  listInstancesStream(request, options) {
1204
- var _a;
1205
1485
  request = request || {};
1206
1486
  options = options || {};
1207
1487
  options.otherArgs = options.otherArgs || {};
1208
1488
  options.otherArgs.headers = options.otherArgs.headers || {};
1209
1489
  options.otherArgs.headers['x-goog-request-params'] =
1210
1490
  this._gaxModule.routingHeader.fromParams({
1211
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1491
+ parent: request.parent ?? '',
1212
1492
  });
1213
1493
  const defaultCallSettings = this._defaults['listInstances'];
1214
1494
  const callSettings = defaultCallSettings.merge(options);
1215
- this.initialize();
1495
+ this.initialize().catch(err => {
1496
+ throw err;
1497
+ });
1498
+ this._log.info('listInstances stream %j', request);
1216
1499
  return this.descriptors.page.listInstances.createStream(this.innerApiCalls.listInstances, request, callSettings);
1217
1500
  }
1218
1501
  /**
@@ -1270,22 +1553,23 @@ class InstanceAdminClient {
1270
1553
  * for more details and examples.
1271
1554
  */
1272
1555
  listInstancesAsync(request, options) {
1273
- var _a;
1274
1556
  request = request || {};
1275
1557
  options = options || {};
1276
1558
  options.otherArgs = options.otherArgs || {};
1277
1559
  options.otherArgs.headers = options.otherArgs.headers || {};
1278
1560
  options.otherArgs.headers['x-goog-request-params'] =
1279
1561
  this._gaxModule.routingHeader.fromParams({
1280
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1562
+ parent: request.parent ?? '',
1281
1563
  });
1282
1564
  const defaultCallSettings = this._defaults['listInstances'];
1283
1565
  const callSettings = defaultCallSettings.merge(options);
1284
- this.initialize();
1566
+ this.initialize().catch(err => {
1567
+ throw err;
1568
+ });
1569
+ this._log.info('listInstances iterate %j', request);
1285
1570
  return this.descriptors.page.listInstances.asyncIterate(this.innerApiCalls['listInstances'], request, callSettings);
1286
1571
  }
1287
1572
  listInstancePartitions(request, optionsOrCallback, callback) {
1288
- var _a;
1289
1573
  request = request || {};
1290
1574
  let options;
1291
1575
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1300,10 +1584,24 @@ class InstanceAdminClient {
1300
1584
  options.otherArgs.headers = options.otherArgs.headers || {};
1301
1585
  options.otherArgs.headers['x-goog-request-params'] =
1302
1586
  this._gaxModule.routingHeader.fromParams({
1303
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1587
+ parent: request.parent ?? '',
1304
1588
  });
1305
- this.initialize();
1306
- return this.innerApiCalls.listInstancePartitions(request, options, callback);
1589
+ this.initialize().catch(err => {
1590
+ throw err;
1591
+ });
1592
+ const wrappedCallback = callback
1593
+ ? (error, values, nextPageRequest, rawResponse) => {
1594
+ this._log.info('listInstancePartitions values %j', values);
1595
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1596
+ }
1597
+ : undefined;
1598
+ this._log.info('listInstancePartitions request %j', request);
1599
+ return this.innerApiCalls
1600
+ .listInstancePartitions(request, options, wrappedCallback)
1601
+ ?.then(([response, input, output]) => {
1602
+ this._log.info('listInstancePartitions values %j', response);
1603
+ return [response, input, output];
1604
+ });
1307
1605
  }
1308
1606
  /**
1309
1607
  * Equivalent to `listInstancePartitions`, but returns a NodeJS Stream object.
@@ -1341,18 +1639,20 @@ class InstanceAdminClient {
1341
1639
  * for more details and examples.
1342
1640
  */
1343
1641
  listInstancePartitionsStream(request, options) {
1344
- var _a;
1345
1642
  request = request || {};
1346
1643
  options = options || {};
1347
1644
  options.otherArgs = options.otherArgs || {};
1348
1645
  options.otherArgs.headers = options.otherArgs.headers || {};
1349
1646
  options.otherArgs.headers['x-goog-request-params'] =
1350
1647
  this._gaxModule.routingHeader.fromParams({
1351
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1648
+ parent: request.parent ?? '',
1352
1649
  });
1353
1650
  const defaultCallSettings = this._defaults['listInstancePartitions'];
1354
1651
  const callSettings = defaultCallSettings.merge(options);
1355
- this.initialize();
1652
+ this.initialize().catch(err => {
1653
+ throw err;
1654
+ });
1655
+ this._log.info('listInstancePartitions stream %j', request);
1356
1656
  return this.descriptors.page.listInstancePartitions.createStream(this.innerApiCalls.listInstancePartitions, request, callSettings);
1357
1657
  }
1358
1658
  /**
@@ -1392,22 +1692,23 @@ class InstanceAdminClient {
1392
1692
  * for more details and examples.
1393
1693
  */
1394
1694
  listInstancePartitionsAsync(request, options) {
1395
- var _a;
1396
1695
  request = request || {};
1397
1696
  options = options || {};
1398
1697
  options.otherArgs = options.otherArgs || {};
1399
1698
  options.otherArgs.headers = options.otherArgs.headers || {};
1400
1699
  options.otherArgs.headers['x-goog-request-params'] =
1401
1700
  this._gaxModule.routingHeader.fromParams({
1402
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1701
+ parent: request.parent ?? '',
1403
1702
  });
1404
1703
  const defaultCallSettings = this._defaults['listInstancePartitions'];
1405
1704
  const callSettings = defaultCallSettings.merge(options);
1406
- this.initialize();
1705
+ this.initialize().catch(err => {
1706
+ throw err;
1707
+ });
1708
+ this._log.info('listInstancePartitions iterate %j', request);
1407
1709
  return this.descriptors.page.listInstancePartitions.asyncIterate(this.innerApiCalls['listInstancePartitions'], request, callSettings);
1408
1710
  }
1409
1711
  listInstancePartitionOperations(request, optionsOrCallback, callback) {
1410
- var _a;
1411
1712
  request = request || {};
1412
1713
  let options;
1413
1714
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1422,10 +1723,24 @@ class InstanceAdminClient {
1422
1723
  options.otherArgs.headers = options.otherArgs.headers || {};
1423
1724
  options.otherArgs.headers['x-goog-request-params'] =
1424
1725
  this._gaxModule.routingHeader.fromParams({
1425
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1726
+ parent: request.parent ?? '',
1426
1727
  });
1427
- this.initialize();
1428
- return this.innerApiCalls.listInstancePartitionOperations(request, options, callback);
1728
+ this.initialize().catch(err => {
1729
+ throw err;
1730
+ });
1731
+ const wrappedCallback = callback
1732
+ ? (error, values, nextPageRequest, rawResponse) => {
1733
+ this._log.info('listInstancePartitionOperations values %j', values);
1734
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1735
+ }
1736
+ : undefined;
1737
+ this._log.info('listInstancePartitionOperations request %j', request);
1738
+ return this.innerApiCalls
1739
+ .listInstancePartitionOperations(request, options, wrappedCallback)
1740
+ ?.then(([response, input, output]) => {
1741
+ this._log.info('listInstancePartitionOperations values %j', response);
1742
+ return [response, input, output];
1743
+ });
1429
1744
  }
1430
1745
  /**
1431
1746
  * Equivalent to `listInstancePartitionOperations`, but returns a NodeJS Stream object.
@@ -1505,18 +1820,20 @@ class InstanceAdminClient {
1505
1820
  * for more details and examples.
1506
1821
  */
1507
1822
  listInstancePartitionOperationsStream(request, options) {
1508
- var _a;
1509
1823
  request = request || {};
1510
1824
  options = options || {};
1511
1825
  options.otherArgs = options.otherArgs || {};
1512
1826
  options.otherArgs.headers = options.otherArgs.headers || {};
1513
1827
  options.otherArgs.headers['x-goog-request-params'] =
1514
1828
  this._gaxModule.routingHeader.fromParams({
1515
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1829
+ parent: request.parent ?? '',
1516
1830
  });
1517
1831
  const defaultCallSettings = this._defaults['listInstancePartitionOperations'];
1518
1832
  const callSettings = defaultCallSettings.merge(options);
1519
- this.initialize();
1833
+ this.initialize().catch(err => {
1834
+ throw err;
1835
+ });
1836
+ this._log.info('listInstancePartitionOperations stream %j', request);
1520
1837
  return this.descriptors.page.listInstancePartitionOperations.createStream(this.innerApiCalls.listInstancePartitionOperations, request, callSettings);
1521
1838
  }
1522
1839
  /**
@@ -1598,18 +1915,20 @@ class InstanceAdminClient {
1598
1915
  * for more details and examples.
1599
1916
  */
1600
1917
  listInstancePartitionOperationsAsync(request, options) {
1601
- var _a;
1602
1918
  request = request || {};
1603
1919
  options = options || {};
1604
1920
  options.otherArgs = options.otherArgs || {};
1605
1921
  options.otherArgs.headers = options.otherArgs.headers || {};
1606
1922
  options.otherArgs.headers['x-goog-request-params'] =
1607
1923
  this._gaxModule.routingHeader.fromParams({
1608
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1924
+ parent: request.parent ?? '',
1609
1925
  });
1610
1926
  const defaultCallSettings = this._defaults['listInstancePartitionOperations'];
1611
1927
  const callSettings = defaultCallSettings.merge(options);
1612
- this.initialize();
1928
+ this.initialize().catch(err => {
1929
+ throw err;
1930
+ });
1931
+ this._log.info('listInstancePartitionOperations iterate %j', request);
1613
1932
  return this.descriptors.page.listInstancePartitionOperations.asyncIterate(this.innerApiCalls['listInstancePartitionOperations'], request, callSettings);
1614
1933
  }
1615
1934
  // --------------------
@@ -1756,9 +2075,10 @@ class InstanceAdminClient {
1756
2075
  close() {
1757
2076
  if (this.instanceAdminStub && !this._terminated) {
1758
2077
  return this.instanceAdminStub.then(stub => {
2078
+ this._log.info('ending gRPC channel');
1759
2079
  this._terminated = true;
1760
2080
  stub.close();
1761
- this.operationsClient.close();
2081
+ void this.operationsClient.close();
1762
2082
  });
1763
2083
  }
1764
2084
  return Promise.resolve();