@google-cloud/spanner 6.1.4 → 6.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.
@@ -18,8 +18,6 @@
18
18
  // ** All changes to this file may be overwritten. **
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.DatabaseAdminClient = void 0;
21
- /* global window */
22
- const gax = require("google-gax");
23
21
  const jsonProtos = require("../../protos/protos.json");
24
22
  /**
25
23
  * Client JSON configuration object, loaded from
@@ -27,7 +25,6 @@ const jsonProtos = require("../../protos/protos.json");
27
25
  * This file defines retry strategy and timeouts for all API methods in this library.
28
26
  */
29
27
  const gapicConfig = require("./database_admin_client_config.json");
30
- const google_gax_1 = require("google-gax");
31
28
  const version = require('../../../package.json').version;
32
29
  /**
33
30
  * Cloud Spanner Database Admin API
@@ -73,8 +70,15 @@ class DatabaseAdminClient {
73
70
  * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
74
71
  * For more information, please check the
75
72
  * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
73
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
74
+ * need to avoid loading the default gRPC version and want to use the fallback
75
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
76
+ * ```
77
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
78
+ * const client = new DatabaseAdminClient({fallback: 'rest'}, gax);
79
+ * ```
76
80
  */
77
- constructor(opts) {
81
+ constructor(opts, gaxInstance) {
78
82
  var _a, _b;
79
83
  this._terminated = false;
80
84
  this.descriptors = {
@@ -95,8 +99,12 @@ class DatabaseAdminClient {
95
99
  if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
96
100
  opts['scopes'] = staticMembers.scopes;
97
101
  }
102
+ // Load google-gax module synchronously if needed
103
+ if (!gaxInstance) {
104
+ gaxInstance = require('google-gax');
105
+ }
98
106
  // Choose either gRPC or proto-over-HTTP implementation of google-gax.
99
- this._gaxModule = opts.fallback ? gax.fallback : gax;
107
+ this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
100
108
  // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
101
109
  this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
102
110
  // Save options to use in initialize() method.
@@ -232,7 +240,7 @@ class DatabaseAdminClient {
232
240
  // merely providing the destination and request information.
233
241
  this.innerApiCalls = {};
234
242
  // Add a warn function to the client constructor so it can be easily tested.
235
- this.warn = gax.warn;
243
+ this.warn = this._gaxModule.warn;
236
244
  }
237
245
  /**
238
246
  * Initialize the client.
@@ -342,6 +350,7 @@ class DatabaseAdminClient {
342
350
  return this.auth.getProjectId();
343
351
  }
344
352
  getDatabase(request, optionsOrCallback, callback) {
353
+ var _a;
345
354
  request = request || {};
346
355
  let options;
347
356
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -355,13 +364,14 @@ class DatabaseAdminClient {
355
364
  options.otherArgs = options.otherArgs || {};
356
365
  options.otherArgs.headers = options.otherArgs.headers || {};
357
366
  options.otherArgs.headers['x-goog-request-params'] =
358
- gax.routingHeader.fromParams({
359
- name: request.name || '',
367
+ this._gaxModule.routingHeader.fromParams({
368
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
360
369
  });
361
370
  this.initialize();
362
371
  return this.innerApiCalls.getDatabase(request, options, callback);
363
372
  }
364
373
  dropDatabase(request, optionsOrCallback, callback) {
374
+ var _a;
365
375
  request = request || {};
366
376
  let options;
367
377
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -375,13 +385,14 @@ class DatabaseAdminClient {
375
385
  options.otherArgs = options.otherArgs || {};
376
386
  options.otherArgs.headers = options.otherArgs.headers || {};
377
387
  options.otherArgs.headers['x-goog-request-params'] =
378
- gax.routingHeader.fromParams({
379
- database: request.database || '',
388
+ this._gaxModule.routingHeader.fromParams({
389
+ database: (_a = request.database) !== null && _a !== void 0 ? _a : '',
380
390
  });
381
391
  this.initialize();
382
392
  return this.innerApiCalls.dropDatabase(request, options, callback);
383
393
  }
384
394
  getDatabaseDdl(request, optionsOrCallback, callback) {
395
+ var _a;
385
396
  request = request || {};
386
397
  let options;
387
398
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -395,13 +406,14 @@ class DatabaseAdminClient {
395
406
  options.otherArgs = options.otherArgs || {};
396
407
  options.otherArgs.headers = options.otherArgs.headers || {};
397
408
  options.otherArgs.headers['x-goog-request-params'] =
398
- gax.routingHeader.fromParams({
399
- database: request.database || '',
409
+ this._gaxModule.routingHeader.fromParams({
410
+ database: (_a = request.database) !== null && _a !== void 0 ? _a : '',
400
411
  });
401
412
  this.initialize();
402
413
  return this.innerApiCalls.getDatabaseDdl(request, options, callback);
403
414
  }
404
415
  setIamPolicy(request, optionsOrCallback, callback) {
416
+ var _a;
405
417
  request = request || {};
406
418
  let options;
407
419
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -415,13 +427,14 @@ class DatabaseAdminClient {
415
427
  options.otherArgs = options.otherArgs || {};
416
428
  options.otherArgs.headers = options.otherArgs.headers || {};
417
429
  options.otherArgs.headers['x-goog-request-params'] =
418
- gax.routingHeader.fromParams({
419
- resource: request.resource || '',
430
+ this._gaxModule.routingHeader.fromParams({
431
+ resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
420
432
  });
421
433
  this.initialize();
422
434
  return this.innerApiCalls.setIamPolicy(request, options, callback);
423
435
  }
424
436
  getIamPolicy(request, optionsOrCallback, callback) {
437
+ var _a;
425
438
  request = request || {};
426
439
  let options;
427
440
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -435,13 +448,14 @@ class DatabaseAdminClient {
435
448
  options.otherArgs = options.otherArgs || {};
436
449
  options.otherArgs.headers = options.otherArgs.headers || {};
437
450
  options.otherArgs.headers['x-goog-request-params'] =
438
- gax.routingHeader.fromParams({
439
- resource: request.resource || '',
451
+ this._gaxModule.routingHeader.fromParams({
452
+ resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
440
453
  });
441
454
  this.initialize();
442
455
  return this.innerApiCalls.getIamPolicy(request, options, callback);
443
456
  }
444
457
  testIamPermissions(request, optionsOrCallback, callback) {
458
+ var _a;
445
459
  request = request || {};
446
460
  let options;
447
461
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -455,13 +469,14 @@ class DatabaseAdminClient {
455
469
  options.otherArgs = options.otherArgs || {};
456
470
  options.otherArgs.headers = options.otherArgs.headers || {};
457
471
  options.otherArgs.headers['x-goog-request-params'] =
458
- gax.routingHeader.fromParams({
459
- resource: request.resource || '',
472
+ this._gaxModule.routingHeader.fromParams({
473
+ resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
460
474
  });
461
475
  this.initialize();
462
476
  return this.innerApiCalls.testIamPermissions(request, options, callback);
463
477
  }
464
478
  getBackup(request, optionsOrCallback, callback) {
479
+ var _a;
465
480
  request = request || {};
466
481
  let options;
467
482
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -475,13 +490,14 @@ class DatabaseAdminClient {
475
490
  options.otherArgs = options.otherArgs || {};
476
491
  options.otherArgs.headers = options.otherArgs.headers || {};
477
492
  options.otherArgs.headers['x-goog-request-params'] =
478
- gax.routingHeader.fromParams({
479
- name: request.name || '',
493
+ this._gaxModule.routingHeader.fromParams({
494
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
480
495
  });
481
496
  this.initialize();
482
497
  return this.innerApiCalls.getBackup(request, options, callback);
483
498
  }
484
499
  updateBackup(request, optionsOrCallback, callback) {
500
+ var _a;
485
501
  request = request || {};
486
502
  let options;
487
503
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -495,13 +511,14 @@ class DatabaseAdminClient {
495
511
  options.otherArgs = options.otherArgs || {};
496
512
  options.otherArgs.headers = options.otherArgs.headers || {};
497
513
  options.otherArgs.headers['x-goog-request-params'] =
498
- gax.routingHeader.fromParams({
499
- 'backup.name': request.backup.name || '',
514
+ this._gaxModule.routingHeader.fromParams({
515
+ 'backup.name': (_a = request.backup.name) !== null && _a !== void 0 ? _a : '',
500
516
  });
501
517
  this.initialize();
502
518
  return this.innerApiCalls.updateBackup(request, options, callback);
503
519
  }
504
520
  deleteBackup(request, optionsOrCallback, callback) {
521
+ var _a;
505
522
  request = request || {};
506
523
  let options;
507
524
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -515,13 +532,14 @@ class DatabaseAdminClient {
515
532
  options.otherArgs = options.otherArgs || {};
516
533
  options.otherArgs.headers = options.otherArgs.headers || {};
517
534
  options.otherArgs.headers['x-goog-request-params'] =
518
- gax.routingHeader.fromParams({
519
- name: request.name || '',
535
+ this._gaxModule.routingHeader.fromParams({
536
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
520
537
  });
521
538
  this.initialize();
522
539
  return this.innerApiCalls.deleteBackup(request, options, callback);
523
540
  }
524
541
  createDatabase(request, optionsOrCallback, callback) {
542
+ var _a;
525
543
  request = request || {};
526
544
  let options;
527
545
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -535,8 +553,8 @@ class DatabaseAdminClient {
535
553
  options.otherArgs = options.otherArgs || {};
536
554
  options.otherArgs.headers = options.otherArgs.headers || {};
537
555
  options.otherArgs.headers['x-goog-request-params'] =
538
- gax.routingHeader.fromParams({
539
- parent: request.parent || '',
556
+ this._gaxModule.routingHeader.fromParams({
557
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
540
558
  });
541
559
  this.initialize();
542
560
  return this.innerApiCalls.createDatabase(request, options, callback);
@@ -554,12 +572,13 @@ class DatabaseAdminClient {
554
572
  * region_tag:spanner_v1_generated_DatabaseAdmin_CreateDatabase_async
555
573
  */
556
574
  async checkCreateDatabaseProgress(name) {
557
- const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
575
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
558
576
  const [operation] = await this.operationsClient.getOperation(request);
559
- const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createDatabase, this._gaxModule.createDefaultBackoffSettings());
577
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDatabase, this._gaxModule.createDefaultBackoffSettings());
560
578
  return decodeOperation;
561
579
  }
562
580
  updateDatabaseDdl(request, optionsOrCallback, callback) {
581
+ var _a;
563
582
  request = request || {};
564
583
  let options;
565
584
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -573,8 +592,8 @@ class DatabaseAdminClient {
573
592
  options.otherArgs = options.otherArgs || {};
574
593
  options.otherArgs.headers = options.otherArgs.headers || {};
575
594
  options.otherArgs.headers['x-goog-request-params'] =
576
- gax.routingHeader.fromParams({
577
- database: request.database || '',
595
+ this._gaxModule.routingHeader.fromParams({
596
+ database: (_a = request.database) !== null && _a !== void 0 ? _a : '',
578
597
  });
579
598
  this.initialize();
580
599
  return this.innerApiCalls.updateDatabaseDdl(request, options, callback);
@@ -592,12 +611,13 @@ class DatabaseAdminClient {
592
611
  * region_tag:spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_async
593
612
  */
594
613
  async checkUpdateDatabaseDdlProgress(name) {
595
- const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
614
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
596
615
  const [operation] = await this.operationsClient.getOperation(request);
597
- const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateDatabaseDdl, this._gaxModule.createDefaultBackoffSettings());
616
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateDatabaseDdl, this._gaxModule.createDefaultBackoffSettings());
598
617
  return decodeOperation;
599
618
  }
600
619
  createBackup(request, optionsOrCallback, callback) {
620
+ var _a;
601
621
  request = request || {};
602
622
  let options;
603
623
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -611,8 +631,8 @@ class DatabaseAdminClient {
611
631
  options.otherArgs = options.otherArgs || {};
612
632
  options.otherArgs.headers = options.otherArgs.headers || {};
613
633
  options.otherArgs.headers['x-goog-request-params'] =
614
- gax.routingHeader.fromParams({
615
- parent: request.parent || '',
634
+ this._gaxModule.routingHeader.fromParams({
635
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
616
636
  });
617
637
  this.initialize();
618
638
  return this.innerApiCalls.createBackup(request, options, callback);
@@ -630,12 +650,13 @@ class DatabaseAdminClient {
630
650
  * region_tag:spanner_v1_generated_DatabaseAdmin_CreateBackup_async
631
651
  */
632
652
  async checkCreateBackupProgress(name) {
633
- const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
653
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
634
654
  const [operation] = await this.operationsClient.getOperation(request);
635
- const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings());
655
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings());
636
656
  return decodeOperation;
637
657
  }
638
658
  copyBackup(request, optionsOrCallback, callback) {
659
+ var _a;
639
660
  request = request || {};
640
661
  let options;
641
662
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -649,8 +670,8 @@ class DatabaseAdminClient {
649
670
  options.otherArgs = options.otherArgs || {};
650
671
  options.otherArgs.headers = options.otherArgs.headers || {};
651
672
  options.otherArgs.headers['x-goog-request-params'] =
652
- gax.routingHeader.fromParams({
653
- parent: request.parent || '',
673
+ this._gaxModule.routingHeader.fromParams({
674
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
654
675
  });
655
676
  this.initialize();
656
677
  return this.innerApiCalls.copyBackup(request, options, callback);
@@ -668,12 +689,13 @@ class DatabaseAdminClient {
668
689
  * region_tag:spanner_v1_generated_DatabaseAdmin_CopyBackup_async
669
690
  */
670
691
  async checkCopyBackupProgress(name) {
671
- const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
692
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
672
693
  const [operation] = await this.operationsClient.getOperation(request);
673
- const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.copyBackup, this._gaxModule.createDefaultBackoffSettings());
694
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.copyBackup, this._gaxModule.createDefaultBackoffSettings());
674
695
  return decodeOperation;
675
696
  }
676
697
  restoreDatabase(request, optionsOrCallback, callback) {
698
+ var _a;
677
699
  request = request || {};
678
700
  let options;
679
701
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -687,8 +709,8 @@ class DatabaseAdminClient {
687
709
  options.otherArgs = options.otherArgs || {};
688
710
  options.otherArgs.headers = options.otherArgs.headers || {};
689
711
  options.otherArgs.headers['x-goog-request-params'] =
690
- gax.routingHeader.fromParams({
691
- parent: request.parent || '',
712
+ this._gaxModule.routingHeader.fromParams({
713
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
692
714
  });
693
715
  this.initialize();
694
716
  return this.innerApiCalls.restoreDatabase(request, options, callback);
@@ -706,12 +728,13 @@ class DatabaseAdminClient {
706
728
  * region_tag:spanner_v1_generated_DatabaseAdmin_RestoreDatabase_async
707
729
  */
708
730
  async checkRestoreDatabaseProgress(name) {
709
- const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
731
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
710
732
  const [operation] = await this.operationsClient.getOperation(request);
711
- const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restoreDatabase, this._gaxModule.createDefaultBackoffSettings());
733
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreDatabase, this._gaxModule.createDefaultBackoffSettings());
712
734
  return decodeOperation;
713
735
  }
714
736
  listDatabases(request, optionsOrCallback, callback) {
737
+ var _a;
715
738
  request = request || {};
716
739
  let options;
717
740
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -725,8 +748,8 @@ class DatabaseAdminClient {
725
748
  options.otherArgs = options.otherArgs || {};
726
749
  options.otherArgs.headers = options.otherArgs.headers || {};
727
750
  options.otherArgs.headers['x-goog-request-params'] =
728
- gax.routingHeader.fromParams({
729
- parent: request.parent || '',
751
+ this._gaxModule.routingHeader.fromParams({
752
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
730
753
  });
731
754
  this.initialize();
732
755
  return this.innerApiCalls.listDatabases(request, options, callback);
@@ -758,13 +781,14 @@ class DatabaseAdminClient {
758
781
  * for more details and examples.
759
782
  */
760
783
  listDatabasesStream(request, options) {
784
+ var _a;
761
785
  request = request || {};
762
786
  options = options || {};
763
787
  options.otherArgs = options.otherArgs || {};
764
788
  options.otherArgs.headers = options.otherArgs.headers || {};
765
789
  options.otherArgs.headers['x-goog-request-params'] =
766
- gax.routingHeader.fromParams({
767
- parent: request.parent || '',
790
+ this._gaxModule.routingHeader.fromParams({
791
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
768
792
  });
769
793
  const defaultCallSettings = this._defaults['listDatabases'];
770
794
  const callSettings = defaultCallSettings.merge(options);
@@ -801,13 +825,14 @@ class DatabaseAdminClient {
801
825
  * region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabases_async
802
826
  */
803
827
  listDatabasesAsync(request, options) {
828
+ var _a;
804
829
  request = request || {};
805
830
  options = options || {};
806
831
  options.otherArgs = options.otherArgs || {};
807
832
  options.otherArgs.headers = options.otherArgs.headers || {};
808
833
  options.otherArgs.headers['x-goog-request-params'] =
809
- gax.routingHeader.fromParams({
810
- parent: request.parent || '',
834
+ this._gaxModule.routingHeader.fromParams({
835
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
811
836
  });
812
837
  const defaultCallSettings = this._defaults['listDatabases'];
813
838
  const callSettings = defaultCallSettings.merge(options);
@@ -815,6 +840,7 @@ class DatabaseAdminClient {
815
840
  return this.descriptors.page.listDatabases.asyncIterate(this.innerApiCalls['listDatabases'], request, callSettings);
816
841
  }
817
842
  listBackups(request, optionsOrCallback, callback) {
843
+ var _a;
818
844
  request = request || {};
819
845
  let options;
820
846
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -828,8 +854,8 @@ class DatabaseAdminClient {
828
854
  options.otherArgs = options.otherArgs || {};
829
855
  options.otherArgs.headers = options.otherArgs.headers || {};
830
856
  options.otherArgs.headers['x-goog-request-params'] =
831
- gax.routingHeader.fromParams({
832
- parent: request.parent || '',
857
+ this._gaxModule.routingHeader.fromParams({
858
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
833
859
  });
834
860
  this.initialize();
835
861
  return this.innerApiCalls.listBackups(request, options, callback);
@@ -898,13 +924,14 @@ class DatabaseAdminClient {
898
924
  * for more details and examples.
899
925
  */
900
926
  listBackupsStream(request, options) {
927
+ var _a;
901
928
  request = request || {};
902
929
  options = options || {};
903
930
  options.otherArgs = options.otherArgs || {};
904
931
  options.otherArgs.headers = options.otherArgs.headers || {};
905
932
  options.otherArgs.headers['x-goog-request-params'] =
906
- gax.routingHeader.fromParams({
907
- parent: request.parent || '',
933
+ this._gaxModule.routingHeader.fromParams({
934
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
908
935
  });
909
936
  const defaultCallSettings = this._defaults['listBackups'];
910
937
  const callSettings = defaultCallSettings.merge(options);
@@ -978,13 +1005,14 @@ class DatabaseAdminClient {
978
1005
  * region_tag:spanner_v1_generated_DatabaseAdmin_ListBackups_async
979
1006
  */
980
1007
  listBackupsAsync(request, options) {
1008
+ var _a;
981
1009
  request = request || {};
982
1010
  options = options || {};
983
1011
  options.otherArgs = options.otherArgs || {};
984
1012
  options.otherArgs.headers = options.otherArgs.headers || {};
985
1013
  options.otherArgs.headers['x-goog-request-params'] =
986
- gax.routingHeader.fromParams({
987
- parent: request.parent || '',
1014
+ this._gaxModule.routingHeader.fromParams({
1015
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
988
1016
  });
989
1017
  const defaultCallSettings = this._defaults['listBackups'];
990
1018
  const callSettings = defaultCallSettings.merge(options);
@@ -992,6 +1020,7 @@ class DatabaseAdminClient {
992
1020
  return this.descriptors.page.listBackups.asyncIterate(this.innerApiCalls['listBackups'], request, callSettings);
993
1021
  }
994
1022
  listDatabaseOperations(request, optionsOrCallback, callback) {
1023
+ var _a;
995
1024
  request = request || {};
996
1025
  let options;
997
1026
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1005,8 +1034,8 @@ class DatabaseAdminClient {
1005
1034
  options.otherArgs = options.otherArgs || {};
1006
1035
  options.otherArgs.headers = options.otherArgs.headers || {};
1007
1036
  options.otherArgs.headers['x-goog-request-params'] =
1008
- gax.routingHeader.fromParams({
1009
- parent: request.parent || '',
1037
+ this._gaxModule.routingHeader.fromParams({
1038
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1010
1039
  });
1011
1040
  this.initialize();
1012
1041
  return this.innerApiCalls.listDatabaseOperations(request, options, callback);
@@ -1082,13 +1111,14 @@ class DatabaseAdminClient {
1082
1111
  * for more details and examples.
1083
1112
  */
1084
1113
  listDatabaseOperationsStream(request, options) {
1114
+ var _a;
1085
1115
  request = request || {};
1086
1116
  options = options || {};
1087
1117
  options.otherArgs = options.otherArgs || {};
1088
1118
  options.otherArgs.headers = options.otherArgs.headers || {};
1089
1119
  options.otherArgs.headers['x-goog-request-params'] =
1090
- gax.routingHeader.fromParams({
1091
- parent: request.parent || '',
1120
+ this._gaxModule.routingHeader.fromParams({
1121
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1092
1122
  });
1093
1123
  const defaultCallSettings = this._defaults['listDatabaseOperations'];
1094
1124
  const callSettings = defaultCallSettings.merge(options);
@@ -1169,13 +1199,14 @@ class DatabaseAdminClient {
1169
1199
  * region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_async
1170
1200
  */
1171
1201
  listDatabaseOperationsAsync(request, options) {
1202
+ var _a;
1172
1203
  request = request || {};
1173
1204
  options = options || {};
1174
1205
  options.otherArgs = options.otherArgs || {};
1175
1206
  options.otherArgs.headers = options.otherArgs.headers || {};
1176
1207
  options.otherArgs.headers['x-goog-request-params'] =
1177
- gax.routingHeader.fromParams({
1178
- parent: request.parent || '',
1208
+ this._gaxModule.routingHeader.fromParams({
1209
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1179
1210
  });
1180
1211
  const defaultCallSettings = this._defaults['listDatabaseOperations'];
1181
1212
  const callSettings = defaultCallSettings.merge(options);
@@ -1183,6 +1214,7 @@ class DatabaseAdminClient {
1183
1214
  return this.descriptors.page.listDatabaseOperations.asyncIterate(this.innerApiCalls['listDatabaseOperations'], request, callSettings);
1184
1215
  }
1185
1216
  listBackupOperations(request, optionsOrCallback, callback) {
1217
+ var _a;
1186
1218
  request = request || {};
1187
1219
  let options;
1188
1220
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1196,8 +1228,8 @@ class DatabaseAdminClient {
1196
1228
  options.otherArgs = options.otherArgs || {};
1197
1229
  options.otherArgs.headers = options.otherArgs.headers || {};
1198
1230
  options.otherArgs.headers['x-goog-request-params'] =
1199
- gax.routingHeader.fromParams({
1200
- parent: request.parent || '',
1231
+ this._gaxModule.routingHeader.fromParams({
1232
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1201
1233
  });
1202
1234
  this.initialize();
1203
1235
  return this.innerApiCalls.listBackupOperations(request, options, callback);
@@ -1297,13 +1329,14 @@ class DatabaseAdminClient {
1297
1329
  * for more details and examples.
1298
1330
  */
1299
1331
  listBackupOperationsStream(request, options) {
1332
+ var _a;
1300
1333
  request = request || {};
1301
1334
  options = options || {};
1302
1335
  options.otherArgs = options.otherArgs || {};
1303
1336
  options.otherArgs.headers = options.otherArgs.headers || {};
1304
1337
  options.otherArgs.headers['x-goog-request-params'] =
1305
- gax.routingHeader.fromParams({
1306
- parent: request.parent || '',
1338
+ this._gaxModule.routingHeader.fromParams({
1339
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1307
1340
  });
1308
1341
  const defaultCallSettings = this._defaults['listBackupOperations'];
1309
1342
  const callSettings = defaultCallSettings.merge(options);
@@ -1408,13 +1441,14 @@ class DatabaseAdminClient {
1408
1441
  * region_tag:spanner_v1_generated_DatabaseAdmin_ListBackupOperations_async
1409
1442
  */
1410
1443
  listBackupOperationsAsync(request, options) {
1444
+ var _a;
1411
1445
  request = request || {};
1412
1446
  options = options || {};
1413
1447
  options.otherArgs = options.otherArgs || {};
1414
1448
  options.otherArgs.headers = options.otherArgs.headers || {};
1415
1449
  options.otherArgs.headers['x-goog-request-params'] =
1416
- gax.routingHeader.fromParams({
1417
- parent: request.parent || '',
1450
+ this._gaxModule.routingHeader.fromParams({
1451
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1418
1452
  });
1419
1453
  const defaultCallSettings = this._defaults['listBackupOperations'];
1420
1454
  const callSettings = defaultCallSettings.merge(options);
@@ -1422,6 +1456,7 @@ class DatabaseAdminClient {
1422
1456
  return this.descriptors.page.listBackupOperations.asyncIterate(this.innerApiCalls['listBackupOperations'], request, callSettings);
1423
1457
  }
1424
1458
  listDatabaseRoles(request, optionsOrCallback, callback) {
1459
+ var _a;
1425
1460
  request = request || {};
1426
1461
  let options;
1427
1462
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1435,8 +1470,8 @@ class DatabaseAdminClient {
1435
1470
  options.otherArgs = options.otherArgs || {};
1436
1471
  options.otherArgs.headers = options.otherArgs.headers || {};
1437
1472
  options.otherArgs.headers['x-goog-request-params'] =
1438
- gax.routingHeader.fromParams({
1439
- parent: request.parent || '',
1473
+ this._gaxModule.routingHeader.fromParams({
1474
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1440
1475
  });
1441
1476
  this.initialize();
1442
1477
  return this.innerApiCalls.listDatabaseRoles(request, options, callback);
@@ -1469,13 +1504,14 @@ class DatabaseAdminClient {
1469
1504
  * for more details and examples.
1470
1505
  */
1471
1506
  listDatabaseRolesStream(request, options) {
1507
+ var _a;
1472
1508
  request = request || {};
1473
1509
  options = options || {};
1474
1510
  options.otherArgs = options.otherArgs || {};
1475
1511
  options.otherArgs.headers = options.otherArgs.headers || {};
1476
1512
  options.otherArgs.headers['x-goog-request-params'] =
1477
- gax.routingHeader.fromParams({
1478
- parent: request.parent || '',
1513
+ this._gaxModule.routingHeader.fromParams({
1514
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1479
1515
  });
1480
1516
  const defaultCallSettings = this._defaults['listDatabaseRoles'];
1481
1517
  const callSettings = defaultCallSettings.merge(options);
@@ -1513,13 +1549,14 @@ class DatabaseAdminClient {
1513
1549
  * region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabaseRoles_async
1514
1550
  */
1515
1551
  listDatabaseRolesAsync(request, options) {
1552
+ var _a;
1516
1553
  request = request || {};
1517
1554
  options = options || {};
1518
1555
  options.otherArgs = options.otherArgs || {};
1519
1556
  options.otherArgs.headers = options.otherArgs.headers || {};
1520
1557
  options.otherArgs.headers['x-goog-request-params'] =
1521
- gax.routingHeader.fromParams({
1522
- parent: request.parent || '',
1558
+ this._gaxModule.routingHeader.fromParams({
1559
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1523
1560
  });
1524
1561
  const defaultCallSettings = this._defaults['listDatabaseRoles'];
1525
1562
  const callSettings = defaultCallSettings.merge(options);