@google-cloud/dlp 5.13.0 → 6.0.1

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.
@@ -19,6 +19,7 @@
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.DlpServiceClient = 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/dlp_service_client_config.json`.
@@ -36,6 +37,28 @@ const version = require('../../../package.json').version;
36
37
  * @memberof v2
37
38
  */
38
39
  class DlpServiceClient {
40
+ _terminated = false;
41
+ _opts;
42
+ _providedCustomServicePath;
43
+ _gaxModule;
44
+ _gaxGrpc;
45
+ _protos;
46
+ _defaults;
47
+ _universeDomain;
48
+ _servicePath;
49
+ _log = google_gax_1.loggingUtils.log('dlp');
50
+ auth;
51
+ descriptors = {
52
+ page: {},
53
+ stream: {},
54
+ longrunning: {},
55
+ batching: {},
56
+ };
57
+ warn;
58
+ innerApiCalls;
59
+ locationsClient;
60
+ pathTemplates;
61
+ dlpServiceStub;
39
62
  /**
40
63
  * Construct an instance of DlpServiceClient.
41
64
  *
@@ -58,7 +81,7 @@ class DlpServiceClient {
58
81
  * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
59
82
  * the environment variable GCLOUD_PROJECT for your project ID. If your
60
83
  * app is running in an environment which supports
61
- * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
84
+ * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
62
85
  * your project ID will be detected automatically.
63
86
  * @param {string} [options.apiEndpoint] - The domain name of the
64
87
  * API remote host.
@@ -76,32 +99,28 @@ class DlpServiceClient {
76
99
  * ```
77
100
  */
78
101
  constructor(opts, gaxInstance) {
79
- var _a, _b, _c, _d, _e;
80
- this._terminated = false;
81
- this.descriptors = {
82
- page: {},
83
- stream: {},
84
- longrunning: {},
85
- batching: {},
86
- };
87
102
  // Ensure that options include all the required fields.
88
103
  const staticMembers = this.constructor;
89
- if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
90
- (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
91
- (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
104
+ if (opts?.universe_domain &&
105
+ opts?.universeDomain &&
106
+ opts?.universe_domain !== opts?.universeDomain) {
92
107
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
93
108
  }
94
109
  const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
95
110
  ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
96
111
  : undefined;
97
112
  this._universeDomain =
98
- (_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';
113
+ opts?.universeDomain ??
114
+ opts?.universe_domain ??
115
+ universeDomainEnvVar ??
116
+ 'googleapis.com';
99
117
  this._servicePath = 'dlp.' + this._universeDomain;
100
- const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
101
- this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
102
- const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
103
- const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
104
- 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');
118
+ const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
119
+ this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
120
+ const port = opts?.port || staticMembers.port;
121
+ const clientConfig = opts?.clientConfig ?? {};
122
+ const fallback = opts?.fallback ??
123
+ (typeof window !== 'undefined' && typeof window?.fetch === 'function');
105
124
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
106
125
  // Request numeric enum values if REST transport is used.
107
126
  opts.numericEnums = true;
@@ -371,7 +390,6 @@ class DlpServiceClient {
371
390
  return this.auth.getProjectId();
372
391
  }
373
392
  inspectContent(request, optionsOrCallback, callback) {
374
- var _a;
375
393
  request = request || {};
376
394
  let options;
377
395
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -386,13 +404,26 @@ class DlpServiceClient {
386
404
  options.otherArgs.headers = options.otherArgs.headers || {};
387
405
  options.otherArgs.headers['x-goog-request-params'] =
388
406
  this._gaxModule.routingHeader.fromParams({
389
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
407
+ parent: request.parent ?? '',
390
408
  });
391
- this.initialize();
392
- return this.innerApiCalls.inspectContent(request, options, callback);
409
+ this.initialize().catch(err => {
410
+ throw err;
411
+ });
412
+ this._log.info('inspectContent request %j', request);
413
+ const wrappedCallback = callback
414
+ ? (error, response, options, rawResponse) => {
415
+ this._log.info('inspectContent response %j', response);
416
+ callback(error, response, options, rawResponse); // We verified callback above.
417
+ }
418
+ : undefined;
419
+ return this.innerApiCalls
420
+ .inspectContent(request, options, wrappedCallback)
421
+ ?.then(([response, options, rawResponse]) => {
422
+ this._log.info('inspectContent response %j', response);
423
+ return [response, options, rawResponse];
424
+ });
393
425
  }
394
426
  redactImage(request, optionsOrCallback, callback) {
395
- var _a;
396
427
  request = request || {};
397
428
  let options;
398
429
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -407,13 +438,26 @@ class DlpServiceClient {
407
438
  options.otherArgs.headers = options.otherArgs.headers || {};
408
439
  options.otherArgs.headers['x-goog-request-params'] =
409
440
  this._gaxModule.routingHeader.fromParams({
410
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
441
+ parent: request.parent ?? '',
411
442
  });
412
- this.initialize();
413
- return this.innerApiCalls.redactImage(request, options, callback);
443
+ this.initialize().catch(err => {
444
+ throw err;
445
+ });
446
+ this._log.info('redactImage request %j', request);
447
+ const wrappedCallback = callback
448
+ ? (error, response, options, rawResponse) => {
449
+ this._log.info('redactImage response %j', response);
450
+ callback(error, response, options, rawResponse); // We verified callback above.
451
+ }
452
+ : undefined;
453
+ return this.innerApiCalls
454
+ .redactImage(request, options, wrappedCallback)
455
+ ?.then(([response, options, rawResponse]) => {
456
+ this._log.info('redactImage response %j', response);
457
+ return [response, options, rawResponse];
458
+ });
414
459
  }
415
460
  deidentifyContent(request, optionsOrCallback, callback) {
416
- var _a;
417
461
  request = request || {};
418
462
  let options;
419
463
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -428,13 +472,26 @@ class DlpServiceClient {
428
472
  options.otherArgs.headers = options.otherArgs.headers || {};
429
473
  options.otherArgs.headers['x-goog-request-params'] =
430
474
  this._gaxModule.routingHeader.fromParams({
431
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
475
+ parent: request.parent ?? '',
432
476
  });
433
- this.initialize();
434
- return this.innerApiCalls.deidentifyContent(request, options, callback);
477
+ this.initialize().catch(err => {
478
+ throw err;
479
+ });
480
+ this._log.info('deidentifyContent request %j', request);
481
+ const wrappedCallback = callback
482
+ ? (error, response, options, rawResponse) => {
483
+ this._log.info('deidentifyContent response %j', response);
484
+ callback(error, response, options, rawResponse); // We verified callback above.
485
+ }
486
+ : undefined;
487
+ return this.innerApiCalls
488
+ .deidentifyContent(request, options, wrappedCallback)
489
+ ?.then(([response, options, rawResponse]) => {
490
+ this._log.info('deidentifyContent response %j', response);
491
+ return [response, options, rawResponse];
492
+ });
435
493
  }
436
494
  reidentifyContent(request, optionsOrCallback, callback) {
437
- var _a;
438
495
  request = request || {};
439
496
  let options;
440
497
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -449,13 +506,26 @@ class DlpServiceClient {
449
506
  options.otherArgs.headers = options.otherArgs.headers || {};
450
507
  options.otherArgs.headers['x-goog-request-params'] =
451
508
  this._gaxModule.routingHeader.fromParams({
452
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
509
+ parent: request.parent ?? '',
453
510
  });
454
- this.initialize();
455
- return this.innerApiCalls.reidentifyContent(request, options, callback);
511
+ this.initialize().catch(err => {
512
+ throw err;
513
+ });
514
+ this._log.info('reidentifyContent request %j', request);
515
+ const wrappedCallback = callback
516
+ ? (error, response, options, rawResponse) => {
517
+ this._log.info('reidentifyContent response %j', response);
518
+ callback(error, response, options, rawResponse); // We verified callback above.
519
+ }
520
+ : undefined;
521
+ return this.innerApiCalls
522
+ .reidentifyContent(request, options, wrappedCallback)
523
+ ?.then(([response, options, rawResponse]) => {
524
+ this._log.info('reidentifyContent response %j', response);
525
+ return [response, options, rawResponse];
526
+ });
456
527
  }
457
528
  listInfoTypes(request, optionsOrCallback, callback) {
458
- var _a;
459
529
  request = request || {};
460
530
  let options;
461
531
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -470,13 +540,26 @@ class DlpServiceClient {
470
540
  options.otherArgs.headers = options.otherArgs.headers || {};
471
541
  options.otherArgs.headers['x-goog-request-params'] =
472
542
  this._gaxModule.routingHeader.fromParams({
473
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
543
+ parent: request.parent ?? '',
474
544
  });
475
- this.initialize();
476
- return this.innerApiCalls.listInfoTypes(request, options, callback);
545
+ this.initialize().catch(err => {
546
+ throw err;
547
+ });
548
+ this._log.info('listInfoTypes request %j', request);
549
+ const wrappedCallback = callback
550
+ ? (error, response, options, rawResponse) => {
551
+ this._log.info('listInfoTypes response %j', response);
552
+ callback(error, response, options, rawResponse); // We verified callback above.
553
+ }
554
+ : undefined;
555
+ return this.innerApiCalls
556
+ .listInfoTypes(request, options, wrappedCallback)
557
+ ?.then(([response, options, rawResponse]) => {
558
+ this._log.info('listInfoTypes response %j', response);
559
+ return [response, options, rawResponse];
560
+ });
477
561
  }
478
562
  createInspectTemplate(request, optionsOrCallback, callback) {
479
- var _a;
480
563
  request = request || {};
481
564
  let options;
482
565
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -491,13 +574,26 @@ class DlpServiceClient {
491
574
  options.otherArgs.headers = options.otherArgs.headers || {};
492
575
  options.otherArgs.headers['x-goog-request-params'] =
493
576
  this._gaxModule.routingHeader.fromParams({
494
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
577
+ parent: request.parent ?? '',
495
578
  });
496
- this.initialize();
497
- return this.innerApiCalls.createInspectTemplate(request, options, callback);
579
+ this.initialize().catch(err => {
580
+ throw err;
581
+ });
582
+ this._log.info('createInspectTemplate request %j', request);
583
+ const wrappedCallback = callback
584
+ ? (error, response, options, rawResponse) => {
585
+ this._log.info('createInspectTemplate response %j', response);
586
+ callback(error, response, options, rawResponse); // We verified callback above.
587
+ }
588
+ : undefined;
589
+ return this.innerApiCalls
590
+ .createInspectTemplate(request, options, wrappedCallback)
591
+ ?.then(([response, options, rawResponse]) => {
592
+ this._log.info('createInspectTemplate response %j', response);
593
+ return [response, options, rawResponse];
594
+ });
498
595
  }
499
596
  updateInspectTemplate(request, optionsOrCallback, callback) {
500
- var _a;
501
597
  request = request || {};
502
598
  let options;
503
599
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -512,13 +608,26 @@ class DlpServiceClient {
512
608
  options.otherArgs.headers = options.otherArgs.headers || {};
513
609
  options.otherArgs.headers['x-goog-request-params'] =
514
610
  this._gaxModule.routingHeader.fromParams({
515
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
611
+ name: request.name ?? '',
516
612
  });
517
- this.initialize();
518
- return this.innerApiCalls.updateInspectTemplate(request, options, callback);
613
+ this.initialize().catch(err => {
614
+ throw err;
615
+ });
616
+ this._log.info('updateInspectTemplate request %j', request);
617
+ const wrappedCallback = callback
618
+ ? (error, response, options, rawResponse) => {
619
+ this._log.info('updateInspectTemplate response %j', response);
620
+ callback(error, response, options, rawResponse); // We verified callback above.
621
+ }
622
+ : undefined;
623
+ return this.innerApiCalls
624
+ .updateInspectTemplate(request, options, wrappedCallback)
625
+ ?.then(([response, options, rawResponse]) => {
626
+ this._log.info('updateInspectTemplate response %j', response);
627
+ return [response, options, rawResponse];
628
+ });
519
629
  }
520
630
  getInspectTemplate(request, optionsOrCallback, callback) {
521
- var _a;
522
631
  request = request || {};
523
632
  let options;
524
633
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -533,13 +642,26 @@ class DlpServiceClient {
533
642
  options.otherArgs.headers = options.otherArgs.headers || {};
534
643
  options.otherArgs.headers['x-goog-request-params'] =
535
644
  this._gaxModule.routingHeader.fromParams({
536
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
645
+ name: request.name ?? '',
537
646
  });
538
- this.initialize();
539
- return this.innerApiCalls.getInspectTemplate(request, options, callback);
647
+ this.initialize().catch(err => {
648
+ throw err;
649
+ });
650
+ this._log.info('getInspectTemplate request %j', request);
651
+ const wrappedCallback = callback
652
+ ? (error, response, options, rawResponse) => {
653
+ this._log.info('getInspectTemplate response %j', response);
654
+ callback(error, response, options, rawResponse); // We verified callback above.
655
+ }
656
+ : undefined;
657
+ return this.innerApiCalls
658
+ .getInspectTemplate(request, options, wrappedCallback)
659
+ ?.then(([response, options, rawResponse]) => {
660
+ this._log.info('getInspectTemplate response %j', response);
661
+ return [response, options, rawResponse];
662
+ });
540
663
  }
541
664
  deleteInspectTemplate(request, optionsOrCallback, callback) {
542
- var _a;
543
665
  request = request || {};
544
666
  let options;
545
667
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -554,13 +676,26 @@ class DlpServiceClient {
554
676
  options.otherArgs.headers = options.otherArgs.headers || {};
555
677
  options.otherArgs.headers['x-goog-request-params'] =
556
678
  this._gaxModule.routingHeader.fromParams({
557
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
679
+ name: request.name ?? '',
558
680
  });
559
- this.initialize();
560
- return this.innerApiCalls.deleteInspectTemplate(request, options, callback);
681
+ this.initialize().catch(err => {
682
+ throw err;
683
+ });
684
+ this._log.info('deleteInspectTemplate request %j', request);
685
+ const wrappedCallback = callback
686
+ ? (error, response, options, rawResponse) => {
687
+ this._log.info('deleteInspectTemplate response %j', response);
688
+ callback(error, response, options, rawResponse); // We verified callback above.
689
+ }
690
+ : undefined;
691
+ return this.innerApiCalls
692
+ .deleteInspectTemplate(request, options, wrappedCallback)
693
+ ?.then(([response, options, rawResponse]) => {
694
+ this._log.info('deleteInspectTemplate response %j', response);
695
+ return [response, options, rawResponse];
696
+ });
561
697
  }
562
698
  createDeidentifyTemplate(request, optionsOrCallback, callback) {
563
- var _a;
564
699
  request = request || {};
565
700
  let options;
566
701
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -575,13 +710,26 @@ class DlpServiceClient {
575
710
  options.otherArgs.headers = options.otherArgs.headers || {};
576
711
  options.otherArgs.headers['x-goog-request-params'] =
577
712
  this._gaxModule.routingHeader.fromParams({
578
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
713
+ parent: request.parent ?? '',
579
714
  });
580
- this.initialize();
581
- return this.innerApiCalls.createDeidentifyTemplate(request, options, callback);
715
+ this.initialize().catch(err => {
716
+ throw err;
717
+ });
718
+ this._log.info('createDeidentifyTemplate request %j', request);
719
+ const wrappedCallback = callback
720
+ ? (error, response, options, rawResponse) => {
721
+ this._log.info('createDeidentifyTemplate response %j', response);
722
+ callback(error, response, options, rawResponse); // We verified callback above.
723
+ }
724
+ : undefined;
725
+ return this.innerApiCalls
726
+ .createDeidentifyTemplate(request, options, wrappedCallback)
727
+ ?.then(([response, options, rawResponse]) => {
728
+ this._log.info('createDeidentifyTemplate response %j', response);
729
+ return [response, options, rawResponse];
730
+ });
582
731
  }
583
732
  updateDeidentifyTemplate(request, optionsOrCallback, callback) {
584
- var _a;
585
733
  request = request || {};
586
734
  let options;
587
735
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -596,13 +744,26 @@ class DlpServiceClient {
596
744
  options.otherArgs.headers = options.otherArgs.headers || {};
597
745
  options.otherArgs.headers['x-goog-request-params'] =
598
746
  this._gaxModule.routingHeader.fromParams({
599
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
747
+ name: request.name ?? '',
600
748
  });
601
- this.initialize();
602
- return this.innerApiCalls.updateDeidentifyTemplate(request, options, callback);
749
+ this.initialize().catch(err => {
750
+ throw err;
751
+ });
752
+ this._log.info('updateDeidentifyTemplate request %j', request);
753
+ const wrappedCallback = callback
754
+ ? (error, response, options, rawResponse) => {
755
+ this._log.info('updateDeidentifyTemplate response %j', response);
756
+ callback(error, response, options, rawResponse); // We verified callback above.
757
+ }
758
+ : undefined;
759
+ return this.innerApiCalls
760
+ .updateDeidentifyTemplate(request, options, wrappedCallback)
761
+ ?.then(([response, options, rawResponse]) => {
762
+ this._log.info('updateDeidentifyTemplate response %j', response);
763
+ return [response, options, rawResponse];
764
+ });
603
765
  }
604
766
  getDeidentifyTemplate(request, optionsOrCallback, callback) {
605
- var _a;
606
767
  request = request || {};
607
768
  let options;
608
769
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -617,13 +778,26 @@ class DlpServiceClient {
617
778
  options.otherArgs.headers = options.otherArgs.headers || {};
618
779
  options.otherArgs.headers['x-goog-request-params'] =
619
780
  this._gaxModule.routingHeader.fromParams({
620
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
781
+ name: request.name ?? '',
621
782
  });
622
- this.initialize();
623
- return this.innerApiCalls.getDeidentifyTemplate(request, options, callback);
783
+ this.initialize().catch(err => {
784
+ throw err;
785
+ });
786
+ this._log.info('getDeidentifyTemplate request %j', request);
787
+ const wrappedCallback = callback
788
+ ? (error, response, options, rawResponse) => {
789
+ this._log.info('getDeidentifyTemplate response %j', response);
790
+ callback(error, response, options, rawResponse); // We verified callback above.
791
+ }
792
+ : undefined;
793
+ return this.innerApiCalls
794
+ .getDeidentifyTemplate(request, options, wrappedCallback)
795
+ ?.then(([response, options, rawResponse]) => {
796
+ this._log.info('getDeidentifyTemplate response %j', response);
797
+ return [response, options, rawResponse];
798
+ });
624
799
  }
625
800
  deleteDeidentifyTemplate(request, optionsOrCallback, callback) {
626
- var _a;
627
801
  request = request || {};
628
802
  let options;
629
803
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -638,13 +812,26 @@ class DlpServiceClient {
638
812
  options.otherArgs.headers = options.otherArgs.headers || {};
639
813
  options.otherArgs.headers['x-goog-request-params'] =
640
814
  this._gaxModule.routingHeader.fromParams({
641
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
815
+ name: request.name ?? '',
642
816
  });
643
- this.initialize();
644
- return this.innerApiCalls.deleteDeidentifyTemplate(request, options, callback);
817
+ this.initialize().catch(err => {
818
+ throw err;
819
+ });
820
+ this._log.info('deleteDeidentifyTemplate request %j', request);
821
+ const wrappedCallback = callback
822
+ ? (error, response, options, rawResponse) => {
823
+ this._log.info('deleteDeidentifyTemplate response %j', response);
824
+ callback(error, response, options, rawResponse); // We verified callback above.
825
+ }
826
+ : undefined;
827
+ return this.innerApiCalls
828
+ .deleteDeidentifyTemplate(request, options, wrappedCallback)
829
+ ?.then(([response, options, rawResponse]) => {
830
+ this._log.info('deleteDeidentifyTemplate response %j', response);
831
+ return [response, options, rawResponse];
832
+ });
645
833
  }
646
834
  createJobTrigger(request, optionsOrCallback, callback) {
647
- var _a;
648
835
  request = request || {};
649
836
  let options;
650
837
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -659,13 +846,26 @@ class DlpServiceClient {
659
846
  options.otherArgs.headers = options.otherArgs.headers || {};
660
847
  options.otherArgs.headers['x-goog-request-params'] =
661
848
  this._gaxModule.routingHeader.fromParams({
662
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
849
+ parent: request.parent ?? '',
663
850
  });
664
- this.initialize();
665
- return this.innerApiCalls.createJobTrigger(request, options, callback);
851
+ this.initialize().catch(err => {
852
+ throw err;
853
+ });
854
+ this._log.info('createJobTrigger request %j', request);
855
+ const wrappedCallback = callback
856
+ ? (error, response, options, rawResponse) => {
857
+ this._log.info('createJobTrigger response %j', response);
858
+ callback(error, response, options, rawResponse); // We verified callback above.
859
+ }
860
+ : undefined;
861
+ return this.innerApiCalls
862
+ .createJobTrigger(request, options, wrappedCallback)
863
+ ?.then(([response, options, rawResponse]) => {
864
+ this._log.info('createJobTrigger response %j', response);
865
+ return [response, options, rawResponse];
866
+ });
666
867
  }
667
868
  updateJobTrigger(request, optionsOrCallback, callback) {
668
- var _a;
669
869
  request = request || {};
670
870
  let options;
671
871
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -680,13 +880,26 @@ class DlpServiceClient {
680
880
  options.otherArgs.headers = options.otherArgs.headers || {};
681
881
  options.otherArgs.headers['x-goog-request-params'] =
682
882
  this._gaxModule.routingHeader.fromParams({
683
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
883
+ name: request.name ?? '',
684
884
  });
685
- this.initialize();
686
- return this.innerApiCalls.updateJobTrigger(request, options, callback);
885
+ this.initialize().catch(err => {
886
+ throw err;
887
+ });
888
+ this._log.info('updateJobTrigger request %j', request);
889
+ const wrappedCallback = callback
890
+ ? (error, response, options, rawResponse) => {
891
+ this._log.info('updateJobTrigger response %j', response);
892
+ callback(error, response, options, rawResponse); // We verified callback above.
893
+ }
894
+ : undefined;
895
+ return this.innerApiCalls
896
+ .updateJobTrigger(request, options, wrappedCallback)
897
+ ?.then(([response, options, rawResponse]) => {
898
+ this._log.info('updateJobTrigger response %j', response);
899
+ return [response, options, rawResponse];
900
+ });
687
901
  }
688
902
  hybridInspectJobTrigger(request, optionsOrCallback, callback) {
689
- var _a;
690
903
  request = request || {};
691
904
  let options;
692
905
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -701,13 +914,26 @@ class DlpServiceClient {
701
914
  options.otherArgs.headers = options.otherArgs.headers || {};
702
915
  options.otherArgs.headers['x-goog-request-params'] =
703
916
  this._gaxModule.routingHeader.fromParams({
704
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
917
+ name: request.name ?? '',
705
918
  });
706
- this.initialize();
707
- return this.innerApiCalls.hybridInspectJobTrigger(request, options, callback);
919
+ this.initialize().catch(err => {
920
+ throw err;
921
+ });
922
+ this._log.info('hybridInspectJobTrigger request %j', request);
923
+ const wrappedCallback = callback
924
+ ? (error, response, options, rawResponse) => {
925
+ this._log.info('hybridInspectJobTrigger response %j', response);
926
+ callback(error, response, options, rawResponse); // We verified callback above.
927
+ }
928
+ : undefined;
929
+ return this.innerApiCalls
930
+ .hybridInspectJobTrigger(request, options, wrappedCallback)
931
+ ?.then(([response, options, rawResponse]) => {
932
+ this._log.info('hybridInspectJobTrigger response %j', response);
933
+ return [response, options, rawResponse];
934
+ });
708
935
  }
709
936
  getJobTrigger(request, optionsOrCallback, callback) {
710
- var _a;
711
937
  request = request || {};
712
938
  let options;
713
939
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -722,13 +948,26 @@ class DlpServiceClient {
722
948
  options.otherArgs.headers = options.otherArgs.headers || {};
723
949
  options.otherArgs.headers['x-goog-request-params'] =
724
950
  this._gaxModule.routingHeader.fromParams({
725
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
951
+ name: request.name ?? '',
726
952
  });
727
- this.initialize();
728
- return this.innerApiCalls.getJobTrigger(request, options, callback);
953
+ this.initialize().catch(err => {
954
+ throw err;
955
+ });
956
+ this._log.info('getJobTrigger request %j', request);
957
+ const wrappedCallback = callback
958
+ ? (error, response, options, rawResponse) => {
959
+ this._log.info('getJobTrigger response %j', response);
960
+ callback(error, response, options, rawResponse); // We verified callback above.
961
+ }
962
+ : undefined;
963
+ return this.innerApiCalls
964
+ .getJobTrigger(request, options, wrappedCallback)
965
+ ?.then(([response, options, rawResponse]) => {
966
+ this._log.info('getJobTrigger response %j', response);
967
+ return [response, options, rawResponse];
968
+ });
729
969
  }
730
970
  deleteJobTrigger(request, optionsOrCallback, callback) {
731
- var _a;
732
971
  request = request || {};
733
972
  let options;
734
973
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -743,13 +982,26 @@ class DlpServiceClient {
743
982
  options.otherArgs.headers = options.otherArgs.headers || {};
744
983
  options.otherArgs.headers['x-goog-request-params'] =
745
984
  this._gaxModule.routingHeader.fromParams({
746
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
985
+ name: request.name ?? '',
747
986
  });
748
- this.initialize();
749
- return this.innerApiCalls.deleteJobTrigger(request, options, callback);
987
+ this.initialize().catch(err => {
988
+ throw err;
989
+ });
990
+ this._log.info('deleteJobTrigger request %j', request);
991
+ const wrappedCallback = callback
992
+ ? (error, response, options, rawResponse) => {
993
+ this._log.info('deleteJobTrigger response %j', response);
994
+ callback(error, response, options, rawResponse); // We verified callback above.
995
+ }
996
+ : undefined;
997
+ return this.innerApiCalls
998
+ .deleteJobTrigger(request, options, wrappedCallback)
999
+ ?.then(([response, options, rawResponse]) => {
1000
+ this._log.info('deleteJobTrigger response %j', response);
1001
+ return [response, options, rawResponse];
1002
+ });
750
1003
  }
751
1004
  activateJobTrigger(request, optionsOrCallback, callback) {
752
- var _a;
753
1005
  request = request || {};
754
1006
  let options;
755
1007
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -764,13 +1016,26 @@ class DlpServiceClient {
764
1016
  options.otherArgs.headers = options.otherArgs.headers || {};
765
1017
  options.otherArgs.headers['x-goog-request-params'] =
766
1018
  this._gaxModule.routingHeader.fromParams({
767
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1019
+ name: request.name ?? '',
768
1020
  });
769
- this.initialize();
770
- return this.innerApiCalls.activateJobTrigger(request, options, callback);
1021
+ this.initialize().catch(err => {
1022
+ throw err;
1023
+ });
1024
+ this._log.info('activateJobTrigger request %j', request);
1025
+ const wrappedCallback = callback
1026
+ ? (error, response, options, rawResponse) => {
1027
+ this._log.info('activateJobTrigger response %j', response);
1028
+ callback(error, response, options, rawResponse); // We verified callback above.
1029
+ }
1030
+ : undefined;
1031
+ return this.innerApiCalls
1032
+ .activateJobTrigger(request, options, wrappedCallback)
1033
+ ?.then(([response, options, rawResponse]) => {
1034
+ this._log.info('activateJobTrigger response %j', response);
1035
+ return [response, options, rawResponse];
1036
+ });
771
1037
  }
772
1038
  createDiscoveryConfig(request, optionsOrCallback, callback) {
773
- var _a;
774
1039
  request = request || {};
775
1040
  let options;
776
1041
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -785,13 +1050,26 @@ class DlpServiceClient {
785
1050
  options.otherArgs.headers = options.otherArgs.headers || {};
786
1051
  options.otherArgs.headers['x-goog-request-params'] =
787
1052
  this._gaxModule.routingHeader.fromParams({
788
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1053
+ parent: request.parent ?? '',
789
1054
  });
790
- this.initialize();
791
- return this.innerApiCalls.createDiscoveryConfig(request, options, callback);
1055
+ this.initialize().catch(err => {
1056
+ throw err;
1057
+ });
1058
+ this._log.info('createDiscoveryConfig request %j', request);
1059
+ const wrappedCallback = callback
1060
+ ? (error, response, options, rawResponse) => {
1061
+ this._log.info('createDiscoveryConfig response %j', response);
1062
+ callback(error, response, options, rawResponse); // We verified callback above.
1063
+ }
1064
+ : undefined;
1065
+ return this.innerApiCalls
1066
+ .createDiscoveryConfig(request, options, wrappedCallback)
1067
+ ?.then(([response, options, rawResponse]) => {
1068
+ this._log.info('createDiscoveryConfig response %j', response);
1069
+ return [response, options, rawResponse];
1070
+ });
792
1071
  }
793
1072
  updateDiscoveryConfig(request, optionsOrCallback, callback) {
794
- var _a;
795
1073
  request = request || {};
796
1074
  let options;
797
1075
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -806,13 +1084,26 @@ class DlpServiceClient {
806
1084
  options.otherArgs.headers = options.otherArgs.headers || {};
807
1085
  options.otherArgs.headers['x-goog-request-params'] =
808
1086
  this._gaxModule.routingHeader.fromParams({
809
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1087
+ name: request.name ?? '',
810
1088
  });
811
- this.initialize();
812
- return this.innerApiCalls.updateDiscoveryConfig(request, options, callback);
1089
+ this.initialize().catch(err => {
1090
+ throw err;
1091
+ });
1092
+ this._log.info('updateDiscoveryConfig request %j', request);
1093
+ const wrappedCallback = callback
1094
+ ? (error, response, options, rawResponse) => {
1095
+ this._log.info('updateDiscoveryConfig response %j', response);
1096
+ callback(error, response, options, rawResponse); // We verified callback above.
1097
+ }
1098
+ : undefined;
1099
+ return this.innerApiCalls
1100
+ .updateDiscoveryConfig(request, options, wrappedCallback)
1101
+ ?.then(([response, options, rawResponse]) => {
1102
+ this._log.info('updateDiscoveryConfig response %j', response);
1103
+ return [response, options, rawResponse];
1104
+ });
813
1105
  }
814
1106
  getDiscoveryConfig(request, optionsOrCallback, callback) {
815
- var _a;
816
1107
  request = request || {};
817
1108
  let options;
818
1109
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -827,13 +1118,26 @@ class DlpServiceClient {
827
1118
  options.otherArgs.headers = options.otherArgs.headers || {};
828
1119
  options.otherArgs.headers['x-goog-request-params'] =
829
1120
  this._gaxModule.routingHeader.fromParams({
830
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1121
+ name: request.name ?? '',
831
1122
  });
832
- this.initialize();
833
- return this.innerApiCalls.getDiscoveryConfig(request, options, callback);
1123
+ this.initialize().catch(err => {
1124
+ throw err;
1125
+ });
1126
+ this._log.info('getDiscoveryConfig request %j', request);
1127
+ const wrappedCallback = callback
1128
+ ? (error, response, options, rawResponse) => {
1129
+ this._log.info('getDiscoveryConfig response %j', response);
1130
+ callback(error, response, options, rawResponse); // We verified callback above.
1131
+ }
1132
+ : undefined;
1133
+ return this.innerApiCalls
1134
+ .getDiscoveryConfig(request, options, wrappedCallback)
1135
+ ?.then(([response, options, rawResponse]) => {
1136
+ this._log.info('getDiscoveryConfig response %j', response);
1137
+ return [response, options, rawResponse];
1138
+ });
834
1139
  }
835
1140
  deleteDiscoveryConfig(request, optionsOrCallback, callback) {
836
- var _a;
837
1141
  request = request || {};
838
1142
  let options;
839
1143
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -848,13 +1152,26 @@ class DlpServiceClient {
848
1152
  options.otherArgs.headers = options.otherArgs.headers || {};
849
1153
  options.otherArgs.headers['x-goog-request-params'] =
850
1154
  this._gaxModule.routingHeader.fromParams({
851
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1155
+ name: request.name ?? '',
852
1156
  });
853
- this.initialize();
854
- return this.innerApiCalls.deleteDiscoveryConfig(request, options, callback);
1157
+ this.initialize().catch(err => {
1158
+ throw err;
1159
+ });
1160
+ this._log.info('deleteDiscoveryConfig request %j', request);
1161
+ const wrappedCallback = callback
1162
+ ? (error, response, options, rawResponse) => {
1163
+ this._log.info('deleteDiscoveryConfig response %j', response);
1164
+ callback(error, response, options, rawResponse); // We verified callback above.
1165
+ }
1166
+ : undefined;
1167
+ return this.innerApiCalls
1168
+ .deleteDiscoveryConfig(request, options, wrappedCallback)
1169
+ ?.then(([response, options, rawResponse]) => {
1170
+ this._log.info('deleteDiscoveryConfig response %j', response);
1171
+ return [response, options, rawResponse];
1172
+ });
855
1173
  }
856
1174
  createDlpJob(request, optionsOrCallback, callback) {
857
- var _a;
858
1175
  request = request || {};
859
1176
  let options;
860
1177
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -869,13 +1186,26 @@ class DlpServiceClient {
869
1186
  options.otherArgs.headers = options.otherArgs.headers || {};
870
1187
  options.otherArgs.headers['x-goog-request-params'] =
871
1188
  this._gaxModule.routingHeader.fromParams({
872
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1189
+ parent: request.parent ?? '',
873
1190
  });
874
- this.initialize();
875
- return this.innerApiCalls.createDlpJob(request, options, callback);
1191
+ this.initialize().catch(err => {
1192
+ throw err;
1193
+ });
1194
+ this._log.info('createDlpJob request %j', request);
1195
+ const wrappedCallback = callback
1196
+ ? (error, response, options, rawResponse) => {
1197
+ this._log.info('createDlpJob response %j', response);
1198
+ callback(error, response, options, rawResponse); // We verified callback above.
1199
+ }
1200
+ : undefined;
1201
+ return this.innerApiCalls
1202
+ .createDlpJob(request, options, wrappedCallback)
1203
+ ?.then(([response, options, rawResponse]) => {
1204
+ this._log.info('createDlpJob response %j', response);
1205
+ return [response, options, rawResponse];
1206
+ });
876
1207
  }
877
1208
  getDlpJob(request, optionsOrCallback, callback) {
878
- var _a;
879
1209
  request = request || {};
880
1210
  let options;
881
1211
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -890,13 +1220,26 @@ class DlpServiceClient {
890
1220
  options.otherArgs.headers = options.otherArgs.headers || {};
891
1221
  options.otherArgs.headers['x-goog-request-params'] =
892
1222
  this._gaxModule.routingHeader.fromParams({
893
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1223
+ name: request.name ?? '',
894
1224
  });
895
- this.initialize();
896
- return this.innerApiCalls.getDlpJob(request, options, callback);
1225
+ this.initialize().catch(err => {
1226
+ throw err;
1227
+ });
1228
+ this._log.info('getDlpJob request %j', request);
1229
+ const wrappedCallback = callback
1230
+ ? (error, response, options, rawResponse) => {
1231
+ this._log.info('getDlpJob response %j', response);
1232
+ callback(error, response, options, rawResponse); // We verified callback above.
1233
+ }
1234
+ : undefined;
1235
+ return this.innerApiCalls
1236
+ .getDlpJob(request, options, wrappedCallback)
1237
+ ?.then(([response, options, rawResponse]) => {
1238
+ this._log.info('getDlpJob response %j', response);
1239
+ return [response, options, rawResponse];
1240
+ });
897
1241
  }
898
1242
  deleteDlpJob(request, optionsOrCallback, callback) {
899
- var _a;
900
1243
  request = request || {};
901
1244
  let options;
902
1245
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -911,13 +1254,26 @@ class DlpServiceClient {
911
1254
  options.otherArgs.headers = options.otherArgs.headers || {};
912
1255
  options.otherArgs.headers['x-goog-request-params'] =
913
1256
  this._gaxModule.routingHeader.fromParams({
914
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1257
+ name: request.name ?? '',
915
1258
  });
916
- this.initialize();
917
- return this.innerApiCalls.deleteDlpJob(request, options, callback);
1259
+ this.initialize().catch(err => {
1260
+ throw err;
1261
+ });
1262
+ this._log.info('deleteDlpJob request %j', request);
1263
+ const wrappedCallback = callback
1264
+ ? (error, response, options, rawResponse) => {
1265
+ this._log.info('deleteDlpJob response %j', response);
1266
+ callback(error, response, options, rawResponse); // We verified callback above.
1267
+ }
1268
+ : undefined;
1269
+ return this.innerApiCalls
1270
+ .deleteDlpJob(request, options, wrappedCallback)
1271
+ ?.then(([response, options, rawResponse]) => {
1272
+ this._log.info('deleteDlpJob response %j', response);
1273
+ return [response, options, rawResponse];
1274
+ });
918
1275
  }
919
1276
  cancelDlpJob(request, optionsOrCallback, callback) {
920
- var _a;
921
1277
  request = request || {};
922
1278
  let options;
923
1279
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -932,13 +1288,26 @@ class DlpServiceClient {
932
1288
  options.otherArgs.headers = options.otherArgs.headers || {};
933
1289
  options.otherArgs.headers['x-goog-request-params'] =
934
1290
  this._gaxModule.routingHeader.fromParams({
935
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1291
+ name: request.name ?? '',
936
1292
  });
937
- this.initialize();
938
- return this.innerApiCalls.cancelDlpJob(request, options, callback);
1293
+ this.initialize().catch(err => {
1294
+ throw err;
1295
+ });
1296
+ this._log.info('cancelDlpJob request %j', request);
1297
+ const wrappedCallback = callback
1298
+ ? (error, response, options, rawResponse) => {
1299
+ this._log.info('cancelDlpJob response %j', response);
1300
+ callback(error, response, options, rawResponse); // We verified callback above.
1301
+ }
1302
+ : undefined;
1303
+ return this.innerApiCalls
1304
+ .cancelDlpJob(request, options, wrappedCallback)
1305
+ ?.then(([response, options, rawResponse]) => {
1306
+ this._log.info('cancelDlpJob response %j', response);
1307
+ return [response, options, rawResponse];
1308
+ });
939
1309
  }
940
1310
  createStoredInfoType(request, optionsOrCallback, callback) {
941
- var _a;
942
1311
  request = request || {};
943
1312
  let options;
944
1313
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -953,13 +1322,26 @@ class DlpServiceClient {
953
1322
  options.otherArgs.headers = options.otherArgs.headers || {};
954
1323
  options.otherArgs.headers['x-goog-request-params'] =
955
1324
  this._gaxModule.routingHeader.fromParams({
956
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1325
+ parent: request.parent ?? '',
957
1326
  });
958
- this.initialize();
959
- return this.innerApiCalls.createStoredInfoType(request, options, callback);
1327
+ this.initialize().catch(err => {
1328
+ throw err;
1329
+ });
1330
+ this._log.info('createStoredInfoType request %j', request);
1331
+ const wrappedCallback = callback
1332
+ ? (error, response, options, rawResponse) => {
1333
+ this._log.info('createStoredInfoType response %j', response);
1334
+ callback(error, response, options, rawResponse); // We verified callback above.
1335
+ }
1336
+ : undefined;
1337
+ return this.innerApiCalls
1338
+ .createStoredInfoType(request, options, wrappedCallback)
1339
+ ?.then(([response, options, rawResponse]) => {
1340
+ this._log.info('createStoredInfoType response %j', response);
1341
+ return [response, options, rawResponse];
1342
+ });
960
1343
  }
961
1344
  updateStoredInfoType(request, optionsOrCallback, callback) {
962
- var _a;
963
1345
  request = request || {};
964
1346
  let options;
965
1347
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -974,13 +1356,26 @@ class DlpServiceClient {
974
1356
  options.otherArgs.headers = options.otherArgs.headers || {};
975
1357
  options.otherArgs.headers['x-goog-request-params'] =
976
1358
  this._gaxModule.routingHeader.fromParams({
977
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1359
+ name: request.name ?? '',
978
1360
  });
979
- this.initialize();
980
- return this.innerApiCalls.updateStoredInfoType(request, options, callback);
1361
+ this.initialize().catch(err => {
1362
+ throw err;
1363
+ });
1364
+ this._log.info('updateStoredInfoType request %j', request);
1365
+ const wrappedCallback = callback
1366
+ ? (error, response, options, rawResponse) => {
1367
+ this._log.info('updateStoredInfoType response %j', response);
1368
+ callback(error, response, options, rawResponse); // We verified callback above.
1369
+ }
1370
+ : undefined;
1371
+ return this.innerApiCalls
1372
+ .updateStoredInfoType(request, options, wrappedCallback)
1373
+ ?.then(([response, options, rawResponse]) => {
1374
+ this._log.info('updateStoredInfoType response %j', response);
1375
+ return [response, options, rawResponse];
1376
+ });
981
1377
  }
982
1378
  getStoredInfoType(request, optionsOrCallback, callback) {
983
- var _a;
984
1379
  request = request || {};
985
1380
  let options;
986
1381
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -995,13 +1390,26 @@ class DlpServiceClient {
995
1390
  options.otherArgs.headers = options.otherArgs.headers || {};
996
1391
  options.otherArgs.headers['x-goog-request-params'] =
997
1392
  this._gaxModule.routingHeader.fromParams({
998
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1393
+ name: request.name ?? '',
999
1394
  });
1000
- this.initialize();
1001
- return this.innerApiCalls.getStoredInfoType(request, options, callback);
1395
+ this.initialize().catch(err => {
1396
+ throw err;
1397
+ });
1398
+ this._log.info('getStoredInfoType request %j', request);
1399
+ const wrappedCallback = callback
1400
+ ? (error, response, options, rawResponse) => {
1401
+ this._log.info('getStoredInfoType response %j', response);
1402
+ callback(error, response, options, rawResponse); // We verified callback above.
1403
+ }
1404
+ : undefined;
1405
+ return this.innerApiCalls
1406
+ .getStoredInfoType(request, options, wrappedCallback)
1407
+ ?.then(([response, options, rawResponse]) => {
1408
+ this._log.info('getStoredInfoType response %j', response);
1409
+ return [response, options, rawResponse];
1410
+ });
1002
1411
  }
1003
1412
  deleteStoredInfoType(request, optionsOrCallback, callback) {
1004
- var _a;
1005
1413
  request = request || {};
1006
1414
  let options;
1007
1415
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1016,13 +1424,26 @@ class DlpServiceClient {
1016
1424
  options.otherArgs.headers = options.otherArgs.headers || {};
1017
1425
  options.otherArgs.headers['x-goog-request-params'] =
1018
1426
  this._gaxModule.routingHeader.fromParams({
1019
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1427
+ name: request.name ?? '',
1020
1428
  });
1021
- this.initialize();
1022
- return this.innerApiCalls.deleteStoredInfoType(request, options, callback);
1429
+ this.initialize().catch(err => {
1430
+ throw err;
1431
+ });
1432
+ this._log.info('deleteStoredInfoType request %j', request);
1433
+ const wrappedCallback = callback
1434
+ ? (error, response, options, rawResponse) => {
1435
+ this._log.info('deleteStoredInfoType response %j', response);
1436
+ callback(error, response, options, rawResponse); // We verified callback above.
1437
+ }
1438
+ : undefined;
1439
+ return this.innerApiCalls
1440
+ .deleteStoredInfoType(request, options, wrappedCallback)
1441
+ ?.then(([response, options, rawResponse]) => {
1442
+ this._log.info('deleteStoredInfoType response %j', response);
1443
+ return [response, options, rawResponse];
1444
+ });
1023
1445
  }
1024
1446
  getProjectDataProfile(request, optionsOrCallback, callback) {
1025
- var _a;
1026
1447
  request = request || {};
1027
1448
  let options;
1028
1449
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1037,13 +1458,26 @@ class DlpServiceClient {
1037
1458
  options.otherArgs.headers = options.otherArgs.headers || {};
1038
1459
  options.otherArgs.headers['x-goog-request-params'] =
1039
1460
  this._gaxModule.routingHeader.fromParams({
1040
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1461
+ name: request.name ?? '',
1041
1462
  });
1042
- this.initialize();
1043
- return this.innerApiCalls.getProjectDataProfile(request, options, callback);
1463
+ this.initialize().catch(err => {
1464
+ throw err;
1465
+ });
1466
+ this._log.info('getProjectDataProfile request %j', request);
1467
+ const wrappedCallback = callback
1468
+ ? (error, response, options, rawResponse) => {
1469
+ this._log.info('getProjectDataProfile response %j', response);
1470
+ callback(error, response, options, rawResponse); // We verified callback above.
1471
+ }
1472
+ : undefined;
1473
+ return this.innerApiCalls
1474
+ .getProjectDataProfile(request, options, wrappedCallback)
1475
+ ?.then(([response, options, rawResponse]) => {
1476
+ this._log.info('getProjectDataProfile response %j', response);
1477
+ return [response, options, rawResponse];
1478
+ });
1044
1479
  }
1045
1480
  getFileStoreDataProfile(request, optionsOrCallback, callback) {
1046
- var _a;
1047
1481
  request = request || {};
1048
1482
  let options;
1049
1483
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1058,13 +1492,26 @@ class DlpServiceClient {
1058
1492
  options.otherArgs.headers = options.otherArgs.headers || {};
1059
1493
  options.otherArgs.headers['x-goog-request-params'] =
1060
1494
  this._gaxModule.routingHeader.fromParams({
1061
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1495
+ name: request.name ?? '',
1062
1496
  });
1063
- this.initialize();
1064
- return this.innerApiCalls.getFileStoreDataProfile(request, options, callback);
1497
+ this.initialize().catch(err => {
1498
+ throw err;
1499
+ });
1500
+ this._log.info('getFileStoreDataProfile request %j', request);
1501
+ const wrappedCallback = callback
1502
+ ? (error, response, options, rawResponse) => {
1503
+ this._log.info('getFileStoreDataProfile response %j', response);
1504
+ callback(error, response, options, rawResponse); // We verified callback above.
1505
+ }
1506
+ : undefined;
1507
+ return this.innerApiCalls
1508
+ .getFileStoreDataProfile(request, options, wrappedCallback)
1509
+ ?.then(([response, options, rawResponse]) => {
1510
+ this._log.info('getFileStoreDataProfile response %j', response);
1511
+ return [response, options, rawResponse];
1512
+ });
1065
1513
  }
1066
1514
  deleteFileStoreDataProfile(request, optionsOrCallback, callback) {
1067
- var _a;
1068
1515
  request = request || {};
1069
1516
  let options;
1070
1517
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1079,13 +1526,26 @@ class DlpServiceClient {
1079
1526
  options.otherArgs.headers = options.otherArgs.headers || {};
1080
1527
  options.otherArgs.headers['x-goog-request-params'] =
1081
1528
  this._gaxModule.routingHeader.fromParams({
1082
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1529
+ name: request.name ?? '',
1083
1530
  });
1084
- this.initialize();
1085
- return this.innerApiCalls.deleteFileStoreDataProfile(request, options, callback);
1531
+ this.initialize().catch(err => {
1532
+ throw err;
1533
+ });
1534
+ this._log.info('deleteFileStoreDataProfile request %j', request);
1535
+ const wrappedCallback = callback
1536
+ ? (error, response, options, rawResponse) => {
1537
+ this._log.info('deleteFileStoreDataProfile response %j', response);
1538
+ callback(error, response, options, rawResponse); // We verified callback above.
1539
+ }
1540
+ : undefined;
1541
+ return this.innerApiCalls
1542
+ .deleteFileStoreDataProfile(request, options, wrappedCallback)
1543
+ ?.then(([response, options, rawResponse]) => {
1544
+ this._log.info('deleteFileStoreDataProfile response %j', response);
1545
+ return [response, options, rawResponse];
1546
+ });
1086
1547
  }
1087
1548
  getTableDataProfile(request, optionsOrCallback, callback) {
1088
- var _a;
1089
1549
  request = request || {};
1090
1550
  let options;
1091
1551
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1100,13 +1560,26 @@ class DlpServiceClient {
1100
1560
  options.otherArgs.headers = options.otherArgs.headers || {};
1101
1561
  options.otherArgs.headers['x-goog-request-params'] =
1102
1562
  this._gaxModule.routingHeader.fromParams({
1103
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1563
+ name: request.name ?? '',
1104
1564
  });
1105
- this.initialize();
1106
- return this.innerApiCalls.getTableDataProfile(request, options, callback);
1565
+ this.initialize().catch(err => {
1566
+ throw err;
1567
+ });
1568
+ this._log.info('getTableDataProfile request %j', request);
1569
+ const wrappedCallback = callback
1570
+ ? (error, response, options, rawResponse) => {
1571
+ this._log.info('getTableDataProfile response %j', response);
1572
+ callback(error, response, options, rawResponse); // We verified callback above.
1573
+ }
1574
+ : undefined;
1575
+ return this.innerApiCalls
1576
+ .getTableDataProfile(request, options, wrappedCallback)
1577
+ ?.then(([response, options, rawResponse]) => {
1578
+ this._log.info('getTableDataProfile response %j', response);
1579
+ return [response, options, rawResponse];
1580
+ });
1107
1581
  }
1108
1582
  getColumnDataProfile(request, optionsOrCallback, callback) {
1109
- var _a;
1110
1583
  request = request || {};
1111
1584
  let options;
1112
1585
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1121,13 +1594,26 @@ class DlpServiceClient {
1121
1594
  options.otherArgs.headers = options.otherArgs.headers || {};
1122
1595
  options.otherArgs.headers['x-goog-request-params'] =
1123
1596
  this._gaxModule.routingHeader.fromParams({
1124
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1597
+ name: request.name ?? '',
1125
1598
  });
1126
- this.initialize();
1127
- return this.innerApiCalls.getColumnDataProfile(request, options, callback);
1599
+ this.initialize().catch(err => {
1600
+ throw err;
1601
+ });
1602
+ this._log.info('getColumnDataProfile request %j', request);
1603
+ const wrappedCallback = callback
1604
+ ? (error, response, options, rawResponse) => {
1605
+ this._log.info('getColumnDataProfile response %j', response);
1606
+ callback(error, response, options, rawResponse); // We verified callback above.
1607
+ }
1608
+ : undefined;
1609
+ return this.innerApiCalls
1610
+ .getColumnDataProfile(request, options, wrappedCallback)
1611
+ ?.then(([response, options, rawResponse]) => {
1612
+ this._log.info('getColumnDataProfile response %j', response);
1613
+ return [response, options, rawResponse];
1614
+ });
1128
1615
  }
1129
1616
  deleteTableDataProfile(request, optionsOrCallback, callback) {
1130
- var _a;
1131
1617
  request = request || {};
1132
1618
  let options;
1133
1619
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1142,13 +1628,26 @@ class DlpServiceClient {
1142
1628
  options.otherArgs.headers = options.otherArgs.headers || {};
1143
1629
  options.otherArgs.headers['x-goog-request-params'] =
1144
1630
  this._gaxModule.routingHeader.fromParams({
1145
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1631
+ name: request.name ?? '',
1146
1632
  });
1147
- this.initialize();
1148
- return this.innerApiCalls.deleteTableDataProfile(request, options, callback);
1633
+ this.initialize().catch(err => {
1634
+ throw err;
1635
+ });
1636
+ this._log.info('deleteTableDataProfile request %j', request);
1637
+ const wrappedCallback = callback
1638
+ ? (error, response, options, rawResponse) => {
1639
+ this._log.info('deleteTableDataProfile response %j', response);
1640
+ callback(error, response, options, rawResponse); // We verified callback above.
1641
+ }
1642
+ : undefined;
1643
+ return this.innerApiCalls
1644
+ .deleteTableDataProfile(request, options, wrappedCallback)
1645
+ ?.then(([response, options, rawResponse]) => {
1646
+ this._log.info('deleteTableDataProfile response %j', response);
1647
+ return [response, options, rawResponse];
1648
+ });
1149
1649
  }
1150
1650
  hybridInspectDlpJob(request, optionsOrCallback, callback) {
1151
- var _a;
1152
1651
  request = request || {};
1153
1652
  let options;
1154
1653
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1163,13 +1662,26 @@ class DlpServiceClient {
1163
1662
  options.otherArgs.headers = options.otherArgs.headers || {};
1164
1663
  options.otherArgs.headers['x-goog-request-params'] =
1165
1664
  this._gaxModule.routingHeader.fromParams({
1166
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1665
+ name: request.name ?? '',
1167
1666
  });
1168
- this.initialize();
1169
- return this.innerApiCalls.hybridInspectDlpJob(request, options, callback);
1667
+ this.initialize().catch(err => {
1668
+ throw err;
1669
+ });
1670
+ this._log.info('hybridInspectDlpJob request %j', request);
1671
+ const wrappedCallback = callback
1672
+ ? (error, response, options, rawResponse) => {
1673
+ this._log.info('hybridInspectDlpJob response %j', response);
1674
+ callback(error, response, options, rawResponse); // We verified callback above.
1675
+ }
1676
+ : undefined;
1677
+ return this.innerApiCalls
1678
+ .hybridInspectDlpJob(request, options, wrappedCallback)
1679
+ ?.then(([response, options, rawResponse]) => {
1680
+ this._log.info('hybridInspectDlpJob response %j', response);
1681
+ return [response, options, rawResponse];
1682
+ });
1170
1683
  }
1171
1684
  finishDlpJob(request, optionsOrCallback, callback) {
1172
- var _a;
1173
1685
  request = request || {};
1174
1686
  let options;
1175
1687
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1184,13 +1696,26 @@ class DlpServiceClient {
1184
1696
  options.otherArgs.headers = options.otherArgs.headers || {};
1185
1697
  options.otherArgs.headers['x-goog-request-params'] =
1186
1698
  this._gaxModule.routingHeader.fromParams({
1187
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1699
+ name: request.name ?? '',
1188
1700
  });
1189
- this.initialize();
1190
- return this.innerApiCalls.finishDlpJob(request, options, callback);
1701
+ this.initialize().catch(err => {
1702
+ throw err;
1703
+ });
1704
+ this._log.info('finishDlpJob request %j', request);
1705
+ const wrappedCallback = callback
1706
+ ? (error, response, options, rawResponse) => {
1707
+ this._log.info('finishDlpJob response %j', response);
1708
+ callback(error, response, options, rawResponse); // We verified callback above.
1709
+ }
1710
+ : undefined;
1711
+ return this.innerApiCalls
1712
+ .finishDlpJob(request, options, wrappedCallback)
1713
+ ?.then(([response, options, rawResponse]) => {
1714
+ this._log.info('finishDlpJob response %j', response);
1715
+ return [response, options, rawResponse];
1716
+ });
1191
1717
  }
1192
1718
  createConnection(request, optionsOrCallback, callback) {
1193
- var _a;
1194
1719
  request = request || {};
1195
1720
  let options;
1196
1721
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1205,13 +1730,26 @@ class DlpServiceClient {
1205
1730
  options.otherArgs.headers = options.otherArgs.headers || {};
1206
1731
  options.otherArgs.headers['x-goog-request-params'] =
1207
1732
  this._gaxModule.routingHeader.fromParams({
1208
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1733
+ parent: request.parent ?? '',
1209
1734
  });
1210
- this.initialize();
1211
- return this.innerApiCalls.createConnection(request, options, callback);
1735
+ this.initialize().catch(err => {
1736
+ throw err;
1737
+ });
1738
+ this._log.info('createConnection request %j', request);
1739
+ const wrappedCallback = callback
1740
+ ? (error, response, options, rawResponse) => {
1741
+ this._log.info('createConnection response %j', response);
1742
+ callback(error, response, options, rawResponse); // We verified callback above.
1743
+ }
1744
+ : undefined;
1745
+ return this.innerApiCalls
1746
+ .createConnection(request, options, wrappedCallback)
1747
+ ?.then(([response, options, rawResponse]) => {
1748
+ this._log.info('createConnection response %j', response);
1749
+ return [response, options, rawResponse];
1750
+ });
1212
1751
  }
1213
1752
  getConnection(request, optionsOrCallback, callback) {
1214
- var _a;
1215
1753
  request = request || {};
1216
1754
  let options;
1217
1755
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1226,13 +1764,26 @@ class DlpServiceClient {
1226
1764
  options.otherArgs.headers = options.otherArgs.headers || {};
1227
1765
  options.otherArgs.headers['x-goog-request-params'] =
1228
1766
  this._gaxModule.routingHeader.fromParams({
1229
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1767
+ name: request.name ?? '',
1230
1768
  });
1231
- this.initialize();
1232
- return this.innerApiCalls.getConnection(request, options, callback);
1769
+ this.initialize().catch(err => {
1770
+ throw err;
1771
+ });
1772
+ this._log.info('getConnection request %j', request);
1773
+ const wrappedCallback = callback
1774
+ ? (error, response, options, rawResponse) => {
1775
+ this._log.info('getConnection response %j', response);
1776
+ callback(error, response, options, rawResponse); // We verified callback above.
1777
+ }
1778
+ : undefined;
1779
+ return this.innerApiCalls
1780
+ .getConnection(request, options, wrappedCallback)
1781
+ ?.then(([response, options, rawResponse]) => {
1782
+ this._log.info('getConnection response %j', response);
1783
+ return [response, options, rawResponse];
1784
+ });
1233
1785
  }
1234
1786
  deleteConnection(request, optionsOrCallback, callback) {
1235
- var _a;
1236
1787
  request = request || {};
1237
1788
  let options;
1238
1789
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1247,13 +1798,26 @@ class DlpServiceClient {
1247
1798
  options.otherArgs.headers = options.otherArgs.headers || {};
1248
1799
  options.otherArgs.headers['x-goog-request-params'] =
1249
1800
  this._gaxModule.routingHeader.fromParams({
1250
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1801
+ name: request.name ?? '',
1251
1802
  });
1252
- this.initialize();
1253
- return this.innerApiCalls.deleteConnection(request, options, callback);
1803
+ this.initialize().catch(err => {
1804
+ throw err;
1805
+ });
1806
+ this._log.info('deleteConnection request %j', request);
1807
+ const wrappedCallback = callback
1808
+ ? (error, response, options, rawResponse) => {
1809
+ this._log.info('deleteConnection response %j', response);
1810
+ callback(error, response, options, rawResponse); // We verified callback above.
1811
+ }
1812
+ : undefined;
1813
+ return this.innerApiCalls
1814
+ .deleteConnection(request, options, wrappedCallback)
1815
+ ?.then(([response, options, rawResponse]) => {
1816
+ this._log.info('deleteConnection response %j', response);
1817
+ return [response, options, rawResponse];
1818
+ });
1254
1819
  }
1255
1820
  updateConnection(request, optionsOrCallback, callback) {
1256
- var _a;
1257
1821
  request = request || {};
1258
1822
  let options;
1259
1823
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1268,13 +1832,26 @@ class DlpServiceClient {
1268
1832
  options.otherArgs.headers = options.otherArgs.headers || {};
1269
1833
  options.otherArgs.headers['x-goog-request-params'] =
1270
1834
  this._gaxModule.routingHeader.fromParams({
1271
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1835
+ name: request.name ?? '',
1272
1836
  });
1273
- this.initialize();
1274
- return this.innerApiCalls.updateConnection(request, options, callback);
1837
+ this.initialize().catch(err => {
1838
+ throw err;
1839
+ });
1840
+ this._log.info('updateConnection request %j', request);
1841
+ const wrappedCallback = callback
1842
+ ? (error, response, options, rawResponse) => {
1843
+ this._log.info('updateConnection response %j', response);
1844
+ callback(error, response, options, rawResponse); // We verified callback above.
1845
+ }
1846
+ : undefined;
1847
+ return this.innerApiCalls
1848
+ .updateConnection(request, options, wrappedCallback)
1849
+ ?.then(([response, options, rawResponse]) => {
1850
+ this._log.info('updateConnection response %j', response);
1851
+ return [response, options, rawResponse];
1852
+ });
1275
1853
  }
1276
1854
  listInspectTemplates(request, optionsOrCallback, callback) {
1277
- var _a;
1278
1855
  request = request || {};
1279
1856
  let options;
1280
1857
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1289,10 +1866,24 @@ class DlpServiceClient {
1289
1866
  options.otherArgs.headers = options.otherArgs.headers || {};
1290
1867
  options.otherArgs.headers['x-goog-request-params'] =
1291
1868
  this._gaxModule.routingHeader.fromParams({
1292
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1869
+ parent: request.parent ?? '',
1293
1870
  });
1294
- this.initialize();
1295
- return this.innerApiCalls.listInspectTemplates(request, options, callback);
1871
+ this.initialize().catch(err => {
1872
+ throw err;
1873
+ });
1874
+ const wrappedCallback = callback
1875
+ ? (error, values, nextPageRequest, rawResponse) => {
1876
+ this._log.info('listInspectTemplates values %j', values);
1877
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1878
+ }
1879
+ : undefined;
1880
+ this._log.info('listInspectTemplates request %j', request);
1881
+ return this.innerApiCalls
1882
+ .listInspectTemplates(request, options, wrappedCallback)
1883
+ ?.then(([response, input, output]) => {
1884
+ this._log.info('listInspectTemplates values %j', response);
1885
+ return [response, input, output];
1886
+ });
1296
1887
  }
1297
1888
  /**
1298
1889
  * Equivalent to `listInspectTemplates`, but returns a NodeJS Stream object.
@@ -1353,18 +1944,20 @@ class DlpServiceClient {
1353
1944
  * for more details and examples.
1354
1945
  */
1355
1946
  listInspectTemplatesStream(request, options) {
1356
- var _a;
1357
1947
  request = request || {};
1358
1948
  options = options || {};
1359
1949
  options.otherArgs = options.otherArgs || {};
1360
1950
  options.otherArgs.headers = options.otherArgs.headers || {};
1361
1951
  options.otherArgs.headers['x-goog-request-params'] =
1362
1952
  this._gaxModule.routingHeader.fromParams({
1363
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1953
+ parent: request.parent ?? '',
1364
1954
  });
1365
1955
  const defaultCallSettings = this._defaults['listInspectTemplates'];
1366
1956
  const callSettings = defaultCallSettings.merge(options);
1367
- this.initialize();
1957
+ this.initialize().catch(err => {
1958
+ throw err;
1959
+ });
1960
+ this._log.info('listInspectTemplates stream %j', request);
1368
1961
  return this.descriptors.page.listInspectTemplates.createStream(this.innerApiCalls.listInspectTemplates, request, callSettings);
1369
1962
  }
1370
1963
  /**
@@ -1429,22 +2022,23 @@ class DlpServiceClient {
1429
2022
  * region_tag:dlp_v2_generated_DlpService_ListInspectTemplates_async
1430
2023
  */
1431
2024
  listInspectTemplatesAsync(request, options) {
1432
- var _a;
1433
2025
  request = request || {};
1434
2026
  options = options || {};
1435
2027
  options.otherArgs = options.otherArgs || {};
1436
2028
  options.otherArgs.headers = options.otherArgs.headers || {};
1437
2029
  options.otherArgs.headers['x-goog-request-params'] =
1438
2030
  this._gaxModule.routingHeader.fromParams({
1439
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2031
+ parent: request.parent ?? '',
1440
2032
  });
1441
2033
  const defaultCallSettings = this._defaults['listInspectTemplates'];
1442
2034
  const callSettings = defaultCallSettings.merge(options);
1443
- this.initialize();
2035
+ this.initialize().catch(err => {
2036
+ throw err;
2037
+ });
2038
+ this._log.info('listInspectTemplates iterate %j', request);
1444
2039
  return this.descriptors.page.listInspectTemplates.asyncIterate(this.innerApiCalls['listInspectTemplates'], request, callSettings);
1445
2040
  }
1446
2041
  listDeidentifyTemplates(request, optionsOrCallback, callback) {
1447
- var _a;
1448
2042
  request = request || {};
1449
2043
  let options;
1450
2044
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1459,10 +2053,24 @@ class DlpServiceClient {
1459
2053
  options.otherArgs.headers = options.otherArgs.headers || {};
1460
2054
  options.otherArgs.headers['x-goog-request-params'] =
1461
2055
  this._gaxModule.routingHeader.fromParams({
1462
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2056
+ parent: request.parent ?? '',
1463
2057
  });
1464
- this.initialize();
1465
- return this.innerApiCalls.listDeidentifyTemplates(request, options, callback);
2058
+ this.initialize().catch(err => {
2059
+ throw err;
2060
+ });
2061
+ const wrappedCallback = callback
2062
+ ? (error, values, nextPageRequest, rawResponse) => {
2063
+ this._log.info('listDeidentifyTemplates values %j', values);
2064
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
2065
+ }
2066
+ : undefined;
2067
+ this._log.info('listDeidentifyTemplates request %j', request);
2068
+ return this.innerApiCalls
2069
+ .listDeidentifyTemplates(request, options, wrappedCallback)
2070
+ ?.then(([response, input, output]) => {
2071
+ this._log.info('listDeidentifyTemplates values %j', response);
2072
+ return [response, input, output];
2073
+ });
1466
2074
  }
1467
2075
  /**
1468
2076
  * Equivalent to `listDeidentifyTemplates`, but returns a NodeJS Stream object.
@@ -1523,18 +2131,20 @@ class DlpServiceClient {
1523
2131
  * for more details and examples.
1524
2132
  */
1525
2133
  listDeidentifyTemplatesStream(request, options) {
1526
- var _a;
1527
2134
  request = request || {};
1528
2135
  options = options || {};
1529
2136
  options.otherArgs = options.otherArgs || {};
1530
2137
  options.otherArgs.headers = options.otherArgs.headers || {};
1531
2138
  options.otherArgs.headers['x-goog-request-params'] =
1532
2139
  this._gaxModule.routingHeader.fromParams({
1533
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2140
+ parent: request.parent ?? '',
1534
2141
  });
1535
2142
  const defaultCallSettings = this._defaults['listDeidentifyTemplates'];
1536
2143
  const callSettings = defaultCallSettings.merge(options);
1537
- this.initialize();
2144
+ this.initialize().catch(err => {
2145
+ throw err;
2146
+ });
2147
+ this._log.info('listDeidentifyTemplates stream %j', request);
1538
2148
  return this.descriptors.page.listDeidentifyTemplates.createStream(this.innerApiCalls.listDeidentifyTemplates, request, callSettings);
1539
2149
  }
1540
2150
  /**
@@ -1599,22 +2209,23 @@ class DlpServiceClient {
1599
2209
  * region_tag:dlp_v2_generated_DlpService_ListDeidentifyTemplates_async
1600
2210
  */
1601
2211
  listDeidentifyTemplatesAsync(request, options) {
1602
- var _a;
1603
2212
  request = request || {};
1604
2213
  options = options || {};
1605
2214
  options.otherArgs = options.otherArgs || {};
1606
2215
  options.otherArgs.headers = options.otherArgs.headers || {};
1607
2216
  options.otherArgs.headers['x-goog-request-params'] =
1608
2217
  this._gaxModule.routingHeader.fromParams({
1609
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2218
+ parent: request.parent ?? '',
1610
2219
  });
1611
2220
  const defaultCallSettings = this._defaults['listDeidentifyTemplates'];
1612
2221
  const callSettings = defaultCallSettings.merge(options);
1613
- this.initialize();
2222
+ this.initialize().catch(err => {
2223
+ throw err;
2224
+ });
2225
+ this._log.info('listDeidentifyTemplates iterate %j', request);
1614
2226
  return this.descriptors.page.listDeidentifyTemplates.asyncIterate(this.innerApiCalls['listDeidentifyTemplates'], request, callSettings);
1615
2227
  }
1616
2228
  listJobTriggers(request, optionsOrCallback, callback) {
1617
- var _a;
1618
2229
  request = request || {};
1619
2230
  let options;
1620
2231
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1629,10 +2240,24 @@ class DlpServiceClient {
1629
2240
  options.otherArgs.headers = options.otherArgs.headers || {};
1630
2241
  options.otherArgs.headers['x-goog-request-params'] =
1631
2242
  this._gaxModule.routingHeader.fromParams({
1632
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2243
+ parent: request.parent ?? '',
1633
2244
  });
1634
- this.initialize();
1635
- return this.innerApiCalls.listJobTriggers(request, options, callback);
2245
+ this.initialize().catch(err => {
2246
+ throw err;
2247
+ });
2248
+ const wrappedCallback = callback
2249
+ ? (error, values, nextPageRequest, rawResponse) => {
2250
+ this._log.info('listJobTriggers values %j', values);
2251
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
2252
+ }
2253
+ : undefined;
2254
+ this._log.info('listJobTriggers request %j', request);
2255
+ return this.innerApiCalls
2256
+ .listJobTriggers(request, options, wrappedCallback)
2257
+ ?.then(([response, input, output]) => {
2258
+ this._log.info('listJobTriggers values %j', response);
2259
+ return [response, input, output];
2260
+ });
1636
2261
  }
1637
2262
  /**
1638
2263
  * Equivalent to `listJobTriggers`, but returns a NodeJS Stream object.
@@ -1718,18 +2343,20 @@ class DlpServiceClient {
1718
2343
  * for more details and examples.
1719
2344
  */
1720
2345
  listJobTriggersStream(request, options) {
1721
- var _a;
1722
2346
  request = request || {};
1723
2347
  options = options || {};
1724
2348
  options.otherArgs = options.otherArgs || {};
1725
2349
  options.otherArgs.headers = options.otherArgs.headers || {};
1726
2350
  options.otherArgs.headers['x-goog-request-params'] =
1727
2351
  this._gaxModule.routingHeader.fromParams({
1728
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2352
+ parent: request.parent ?? '',
1729
2353
  });
1730
2354
  const defaultCallSettings = this._defaults['listJobTriggers'];
1731
2355
  const callSettings = defaultCallSettings.merge(options);
1732
- this.initialize();
2356
+ this.initialize().catch(err => {
2357
+ throw err;
2358
+ });
2359
+ this._log.info('listJobTriggers stream %j', request);
1733
2360
  return this.descriptors.page.listJobTriggers.createStream(this.innerApiCalls.listJobTriggers, request, callSettings);
1734
2361
  }
1735
2362
  /**
@@ -1819,22 +2446,23 @@ class DlpServiceClient {
1819
2446
  * region_tag:dlp_v2_generated_DlpService_ListJobTriggers_async
1820
2447
  */
1821
2448
  listJobTriggersAsync(request, options) {
1822
- var _a;
1823
2449
  request = request || {};
1824
2450
  options = options || {};
1825
2451
  options.otherArgs = options.otherArgs || {};
1826
2452
  options.otherArgs.headers = options.otherArgs.headers || {};
1827
2453
  options.otherArgs.headers['x-goog-request-params'] =
1828
2454
  this._gaxModule.routingHeader.fromParams({
1829
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2455
+ parent: request.parent ?? '',
1830
2456
  });
1831
2457
  const defaultCallSettings = this._defaults['listJobTriggers'];
1832
2458
  const callSettings = defaultCallSettings.merge(options);
1833
- this.initialize();
2459
+ this.initialize().catch(err => {
2460
+ throw err;
2461
+ });
2462
+ this._log.info('listJobTriggers iterate %j', request);
1834
2463
  return this.descriptors.page.listJobTriggers.asyncIterate(this.innerApiCalls['listJobTriggers'], request, callSettings);
1835
2464
  }
1836
2465
  listDiscoveryConfigs(request, optionsOrCallback, callback) {
1837
- var _a;
1838
2466
  request = request || {};
1839
2467
  let options;
1840
2468
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1849,10 +2477,24 @@ class DlpServiceClient {
1849
2477
  options.otherArgs.headers = options.otherArgs.headers || {};
1850
2478
  options.otherArgs.headers['x-goog-request-params'] =
1851
2479
  this._gaxModule.routingHeader.fromParams({
1852
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2480
+ parent: request.parent ?? '',
1853
2481
  });
1854
- this.initialize();
1855
- return this.innerApiCalls.listDiscoveryConfigs(request, options, callback);
2482
+ this.initialize().catch(err => {
2483
+ throw err;
2484
+ });
2485
+ const wrappedCallback = callback
2486
+ ? (error, values, nextPageRequest, rawResponse) => {
2487
+ this._log.info('listDiscoveryConfigs values %j', values);
2488
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
2489
+ }
2490
+ : undefined;
2491
+ this._log.info('listDiscoveryConfigs request %j', request);
2492
+ return this.innerApiCalls
2493
+ .listDiscoveryConfigs(request, options, wrappedCallback)
2494
+ ?.then(([response, input, output]) => {
2495
+ this._log.info('listDiscoveryConfigs values %j', response);
2496
+ return [response, input, output];
2497
+ });
1856
2498
  }
1857
2499
  /**
1858
2500
  * Equivalent to `listDiscoveryConfigs`, but returns a NodeJS Stream object.
@@ -1900,18 +2542,20 @@ class DlpServiceClient {
1900
2542
  * for more details and examples.
1901
2543
  */
1902
2544
  listDiscoveryConfigsStream(request, options) {
1903
- var _a;
1904
2545
  request = request || {};
1905
2546
  options = options || {};
1906
2547
  options.otherArgs = options.otherArgs || {};
1907
2548
  options.otherArgs.headers = options.otherArgs.headers || {};
1908
2549
  options.otherArgs.headers['x-goog-request-params'] =
1909
2550
  this._gaxModule.routingHeader.fromParams({
1910
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2551
+ parent: request.parent ?? '',
1911
2552
  });
1912
2553
  const defaultCallSettings = this._defaults['listDiscoveryConfigs'];
1913
2554
  const callSettings = defaultCallSettings.merge(options);
1914
- this.initialize();
2555
+ this.initialize().catch(err => {
2556
+ throw err;
2557
+ });
2558
+ this._log.info('listDiscoveryConfigs stream %j', request);
1915
2559
  return this.descriptors.page.listDiscoveryConfigs.createStream(this.innerApiCalls.listDiscoveryConfigs, request, callSettings);
1916
2560
  }
1917
2561
  /**
@@ -1963,22 +2607,23 @@ class DlpServiceClient {
1963
2607
  * region_tag:dlp_v2_generated_DlpService_ListDiscoveryConfigs_async
1964
2608
  */
1965
2609
  listDiscoveryConfigsAsync(request, options) {
1966
- var _a;
1967
2610
  request = request || {};
1968
2611
  options = options || {};
1969
2612
  options.otherArgs = options.otherArgs || {};
1970
2613
  options.otherArgs.headers = options.otherArgs.headers || {};
1971
2614
  options.otherArgs.headers['x-goog-request-params'] =
1972
2615
  this._gaxModule.routingHeader.fromParams({
1973
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2616
+ parent: request.parent ?? '',
1974
2617
  });
1975
2618
  const defaultCallSettings = this._defaults['listDiscoveryConfigs'];
1976
2619
  const callSettings = defaultCallSettings.merge(options);
1977
- this.initialize();
2620
+ this.initialize().catch(err => {
2621
+ throw err;
2622
+ });
2623
+ this._log.info('listDiscoveryConfigs iterate %j', request);
1978
2624
  return this.descriptors.page.listDiscoveryConfigs.asyncIterate(this.innerApiCalls['listDiscoveryConfigs'], request, callSettings);
1979
2625
  }
1980
2626
  listDlpJobs(request, optionsOrCallback, callback) {
1981
- var _a;
1982
2627
  request = request || {};
1983
2628
  let options;
1984
2629
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1993,10 +2638,24 @@ class DlpServiceClient {
1993
2638
  options.otherArgs.headers = options.otherArgs.headers || {};
1994
2639
  options.otherArgs.headers['x-goog-request-params'] =
1995
2640
  this._gaxModule.routingHeader.fromParams({
1996
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2641
+ parent: request.parent ?? '',
1997
2642
  });
1998
- this.initialize();
1999
- return this.innerApiCalls.listDlpJobs(request, options, callback);
2643
+ this.initialize().catch(err => {
2644
+ throw err;
2645
+ });
2646
+ const wrappedCallback = callback
2647
+ ? (error, values, nextPageRequest, rawResponse) => {
2648
+ this._log.info('listDlpJobs values %j', values);
2649
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
2650
+ }
2651
+ : undefined;
2652
+ this._log.info('listDlpJobs request %j', request);
2653
+ return this.innerApiCalls
2654
+ .listDlpJobs(request, options, wrappedCallback)
2655
+ ?.then(([response, input, output]) => {
2656
+ this._log.info('listDlpJobs values %j', response);
2657
+ return [response, input, output];
2658
+ });
2000
2659
  }
2001
2660
  /**
2002
2661
  * Equivalent to `listDlpJobs`, but returns a NodeJS Stream object.
@@ -2082,18 +2741,20 @@ class DlpServiceClient {
2082
2741
  * for more details and examples.
2083
2742
  */
2084
2743
  listDlpJobsStream(request, options) {
2085
- var _a;
2086
2744
  request = request || {};
2087
2745
  options = options || {};
2088
2746
  options.otherArgs = options.otherArgs || {};
2089
2747
  options.otherArgs.headers = options.otherArgs.headers || {};
2090
2748
  options.otherArgs.headers['x-goog-request-params'] =
2091
2749
  this._gaxModule.routingHeader.fromParams({
2092
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2750
+ parent: request.parent ?? '',
2093
2751
  });
2094
2752
  const defaultCallSettings = this._defaults['listDlpJobs'];
2095
2753
  const callSettings = defaultCallSettings.merge(options);
2096
- this.initialize();
2754
+ this.initialize().catch(err => {
2755
+ throw err;
2756
+ });
2757
+ this._log.info('listDlpJobs stream %j', request);
2097
2758
  return this.descriptors.page.listDlpJobs.createStream(this.innerApiCalls.listDlpJobs, request, callSettings);
2098
2759
  }
2099
2760
  /**
@@ -2183,22 +2844,23 @@ class DlpServiceClient {
2183
2844
  * region_tag:dlp_v2_generated_DlpService_ListDlpJobs_async
2184
2845
  */
2185
2846
  listDlpJobsAsync(request, options) {
2186
- var _a;
2187
2847
  request = request || {};
2188
2848
  options = options || {};
2189
2849
  options.otherArgs = options.otherArgs || {};
2190
2850
  options.otherArgs.headers = options.otherArgs.headers || {};
2191
2851
  options.otherArgs.headers['x-goog-request-params'] =
2192
2852
  this._gaxModule.routingHeader.fromParams({
2193
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2853
+ parent: request.parent ?? '',
2194
2854
  });
2195
2855
  const defaultCallSettings = this._defaults['listDlpJobs'];
2196
2856
  const callSettings = defaultCallSettings.merge(options);
2197
- this.initialize();
2857
+ this.initialize().catch(err => {
2858
+ throw err;
2859
+ });
2860
+ this._log.info('listDlpJobs iterate %j', request);
2198
2861
  return this.descriptors.page.listDlpJobs.asyncIterate(this.innerApiCalls['listDlpJobs'], request, callSettings);
2199
2862
  }
2200
2863
  listStoredInfoTypes(request, optionsOrCallback, callback) {
2201
- var _a;
2202
2864
  request = request || {};
2203
2865
  let options;
2204
2866
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -2213,10 +2875,24 @@ class DlpServiceClient {
2213
2875
  options.otherArgs.headers = options.otherArgs.headers || {};
2214
2876
  options.otherArgs.headers['x-goog-request-params'] =
2215
2877
  this._gaxModule.routingHeader.fromParams({
2216
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2878
+ parent: request.parent ?? '',
2217
2879
  });
2218
- this.initialize();
2219
- return this.innerApiCalls.listStoredInfoTypes(request, options, callback);
2880
+ this.initialize().catch(err => {
2881
+ throw err;
2882
+ });
2883
+ const wrappedCallback = callback
2884
+ ? (error, values, nextPageRequest, rawResponse) => {
2885
+ this._log.info('listStoredInfoTypes values %j', values);
2886
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
2887
+ }
2888
+ : undefined;
2889
+ this._log.info('listStoredInfoTypes request %j', request);
2890
+ return this.innerApiCalls
2891
+ .listStoredInfoTypes(request, options, wrappedCallback)
2892
+ ?.then(([response, input, output]) => {
2893
+ this._log.info('listStoredInfoTypes values %j', response);
2894
+ return [response, input, output];
2895
+ });
2220
2896
  }
2221
2897
  /**
2222
2898
  * Equivalent to `listStoredInfoTypes`, but returns a NodeJS Stream object.
@@ -2274,18 +2950,20 @@ class DlpServiceClient {
2274
2950
  * for more details and examples.
2275
2951
  */
2276
2952
  listStoredInfoTypesStream(request, options) {
2277
- var _a;
2278
2953
  request = request || {};
2279
2954
  options = options || {};
2280
2955
  options.otherArgs = options.otherArgs || {};
2281
2956
  options.otherArgs.headers = options.otherArgs.headers || {};
2282
2957
  options.otherArgs.headers['x-goog-request-params'] =
2283
2958
  this._gaxModule.routingHeader.fromParams({
2284
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2959
+ parent: request.parent ?? '',
2285
2960
  });
2286
2961
  const defaultCallSettings = this._defaults['listStoredInfoTypes'];
2287
2962
  const callSettings = defaultCallSettings.merge(options);
2288
- this.initialize();
2963
+ this.initialize().catch(err => {
2964
+ throw err;
2965
+ });
2966
+ this._log.info('listStoredInfoTypes stream %j', request);
2289
2967
  return this.descriptors.page.listStoredInfoTypes.createStream(this.innerApiCalls.listStoredInfoTypes, request, callSettings);
2290
2968
  }
2291
2969
  /**
@@ -2347,22 +3025,23 @@ class DlpServiceClient {
2347
3025
  * region_tag:dlp_v2_generated_DlpService_ListStoredInfoTypes_async
2348
3026
  */
2349
3027
  listStoredInfoTypesAsync(request, options) {
2350
- var _a;
2351
3028
  request = request || {};
2352
3029
  options = options || {};
2353
3030
  options.otherArgs = options.otherArgs || {};
2354
3031
  options.otherArgs.headers = options.otherArgs.headers || {};
2355
3032
  options.otherArgs.headers['x-goog-request-params'] =
2356
3033
  this._gaxModule.routingHeader.fromParams({
2357
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3034
+ parent: request.parent ?? '',
2358
3035
  });
2359
3036
  const defaultCallSettings = this._defaults['listStoredInfoTypes'];
2360
3037
  const callSettings = defaultCallSettings.merge(options);
2361
- this.initialize();
3038
+ this.initialize().catch(err => {
3039
+ throw err;
3040
+ });
3041
+ this._log.info('listStoredInfoTypes iterate %j', request);
2362
3042
  return this.descriptors.page.listStoredInfoTypes.asyncIterate(this.innerApiCalls['listStoredInfoTypes'], request, callSettings);
2363
3043
  }
2364
3044
  listProjectDataProfiles(request, optionsOrCallback, callback) {
2365
- var _a;
2366
3045
  request = request || {};
2367
3046
  let options;
2368
3047
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -2377,10 +3056,24 @@ class DlpServiceClient {
2377
3056
  options.otherArgs.headers = options.otherArgs.headers || {};
2378
3057
  options.otherArgs.headers['x-goog-request-params'] =
2379
3058
  this._gaxModule.routingHeader.fromParams({
2380
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3059
+ parent: request.parent ?? '',
2381
3060
  });
2382
- this.initialize();
2383
- return this.innerApiCalls.listProjectDataProfiles(request, options, callback);
3061
+ this.initialize().catch(err => {
3062
+ throw err;
3063
+ });
3064
+ const wrappedCallback = callback
3065
+ ? (error, values, nextPageRequest, rawResponse) => {
3066
+ this._log.info('listProjectDataProfiles values %j', values);
3067
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
3068
+ }
3069
+ : undefined;
3070
+ this._log.info('listProjectDataProfiles request %j', request);
3071
+ return this.innerApiCalls
3072
+ .listProjectDataProfiles(request, options, wrappedCallback)
3073
+ ?.then(([response, input, output]) => {
3074
+ this._log.info('listProjectDataProfiles values %j', response);
3075
+ return [response, input, output];
3076
+ });
2384
3077
  }
2385
3078
  /**
2386
3079
  * Equivalent to `listProjectDataProfiles`, but returns a NodeJS Stream object.
@@ -2444,18 +3137,20 @@ class DlpServiceClient {
2444
3137
  * for more details and examples.
2445
3138
  */
2446
3139
  listProjectDataProfilesStream(request, options) {
2447
- var _a;
2448
3140
  request = request || {};
2449
3141
  options = options || {};
2450
3142
  options.otherArgs = options.otherArgs || {};
2451
3143
  options.otherArgs.headers = options.otherArgs.headers || {};
2452
3144
  options.otherArgs.headers['x-goog-request-params'] =
2453
3145
  this._gaxModule.routingHeader.fromParams({
2454
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3146
+ parent: request.parent ?? '',
2455
3147
  });
2456
3148
  const defaultCallSettings = this._defaults['listProjectDataProfiles'];
2457
3149
  const callSettings = defaultCallSettings.merge(options);
2458
- this.initialize();
3150
+ this.initialize().catch(err => {
3151
+ throw err;
3152
+ });
3153
+ this._log.info('listProjectDataProfiles stream %j', request);
2459
3154
  return this.descriptors.page.listProjectDataProfiles.createStream(this.innerApiCalls.listProjectDataProfiles, request, callSettings);
2460
3155
  }
2461
3156
  /**
@@ -2523,22 +3218,23 @@ class DlpServiceClient {
2523
3218
  * region_tag:dlp_v2_generated_DlpService_ListProjectDataProfiles_async
2524
3219
  */
2525
3220
  listProjectDataProfilesAsync(request, options) {
2526
- var _a;
2527
3221
  request = request || {};
2528
3222
  options = options || {};
2529
3223
  options.otherArgs = options.otherArgs || {};
2530
3224
  options.otherArgs.headers = options.otherArgs.headers || {};
2531
3225
  options.otherArgs.headers['x-goog-request-params'] =
2532
3226
  this._gaxModule.routingHeader.fromParams({
2533
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3227
+ parent: request.parent ?? '',
2534
3228
  });
2535
3229
  const defaultCallSettings = this._defaults['listProjectDataProfiles'];
2536
3230
  const callSettings = defaultCallSettings.merge(options);
2537
- this.initialize();
3231
+ this.initialize().catch(err => {
3232
+ throw err;
3233
+ });
3234
+ this._log.info('listProjectDataProfiles iterate %j', request);
2538
3235
  return this.descriptors.page.listProjectDataProfiles.asyncIterate(this.innerApiCalls['listProjectDataProfiles'], request, callSettings);
2539
3236
  }
2540
3237
  listTableDataProfiles(request, optionsOrCallback, callback) {
2541
- var _a;
2542
3238
  request = request || {};
2543
3239
  let options;
2544
3240
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -2553,10 +3249,24 @@ class DlpServiceClient {
2553
3249
  options.otherArgs.headers = options.otherArgs.headers || {};
2554
3250
  options.otherArgs.headers['x-goog-request-params'] =
2555
3251
  this._gaxModule.routingHeader.fromParams({
2556
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3252
+ parent: request.parent ?? '',
2557
3253
  });
2558
- this.initialize();
2559
- return this.innerApiCalls.listTableDataProfiles(request, options, callback);
3254
+ this.initialize().catch(err => {
3255
+ throw err;
3256
+ });
3257
+ const wrappedCallback = callback
3258
+ ? (error, values, nextPageRequest, rawResponse) => {
3259
+ this._log.info('listTableDataProfiles values %j', values);
3260
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
3261
+ }
3262
+ : undefined;
3263
+ this._log.info('listTableDataProfiles request %j', request);
3264
+ return this.innerApiCalls
3265
+ .listTableDataProfiles(request, options, wrappedCallback)
3266
+ ?.then(([response, input, output]) => {
3267
+ this._log.info('listTableDataProfiles values %j', response);
3268
+ return [response, input, output];
3269
+ });
2560
3270
  }
2561
3271
  /**
2562
3272
  * Equivalent to `listTableDataProfiles`, but returns a NodeJS Stream object.
@@ -2633,18 +3343,20 @@ class DlpServiceClient {
2633
3343
  * for more details and examples.
2634
3344
  */
2635
3345
  listTableDataProfilesStream(request, options) {
2636
- var _a;
2637
3346
  request = request || {};
2638
3347
  options = options || {};
2639
3348
  options.otherArgs = options.otherArgs || {};
2640
3349
  options.otherArgs.headers = options.otherArgs.headers || {};
2641
3350
  options.otherArgs.headers['x-goog-request-params'] =
2642
3351
  this._gaxModule.routingHeader.fromParams({
2643
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3352
+ parent: request.parent ?? '',
2644
3353
  });
2645
3354
  const defaultCallSettings = this._defaults['listTableDataProfiles'];
2646
3355
  const callSettings = defaultCallSettings.merge(options);
2647
- this.initialize();
3356
+ this.initialize().catch(err => {
3357
+ throw err;
3358
+ });
3359
+ this._log.info('listTableDataProfiles stream %j', request);
2648
3360
  return this.descriptors.page.listTableDataProfiles.createStream(this.innerApiCalls.listTableDataProfiles, request, callSettings);
2649
3361
  }
2650
3362
  /**
@@ -2725,22 +3437,23 @@ class DlpServiceClient {
2725
3437
  * region_tag:dlp_v2_generated_DlpService_ListTableDataProfiles_async
2726
3438
  */
2727
3439
  listTableDataProfilesAsync(request, options) {
2728
- var _a;
2729
3440
  request = request || {};
2730
3441
  options = options || {};
2731
3442
  options.otherArgs = options.otherArgs || {};
2732
3443
  options.otherArgs.headers = options.otherArgs.headers || {};
2733
3444
  options.otherArgs.headers['x-goog-request-params'] =
2734
3445
  this._gaxModule.routingHeader.fromParams({
2735
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3446
+ parent: request.parent ?? '',
2736
3447
  });
2737
3448
  const defaultCallSettings = this._defaults['listTableDataProfiles'];
2738
3449
  const callSettings = defaultCallSettings.merge(options);
2739
- this.initialize();
3450
+ this.initialize().catch(err => {
3451
+ throw err;
3452
+ });
3453
+ this._log.info('listTableDataProfiles iterate %j', request);
2740
3454
  return this.descriptors.page.listTableDataProfiles.asyncIterate(this.innerApiCalls['listTableDataProfiles'], request, callSettings);
2741
3455
  }
2742
3456
  listColumnDataProfiles(request, optionsOrCallback, callback) {
2743
- var _a;
2744
3457
  request = request || {};
2745
3458
  let options;
2746
3459
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -2755,10 +3468,24 @@ class DlpServiceClient {
2755
3468
  options.otherArgs.headers = options.otherArgs.headers || {};
2756
3469
  options.otherArgs.headers['x-goog-request-params'] =
2757
3470
  this._gaxModule.routingHeader.fromParams({
2758
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3471
+ parent: request.parent ?? '',
2759
3472
  });
2760
- this.initialize();
2761
- return this.innerApiCalls.listColumnDataProfiles(request, options, callback);
3473
+ this.initialize().catch(err => {
3474
+ throw err;
3475
+ });
3476
+ const wrappedCallback = callback
3477
+ ? (error, values, nextPageRequest, rawResponse) => {
3478
+ this._log.info('listColumnDataProfiles values %j', values);
3479
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
3480
+ }
3481
+ : undefined;
3482
+ this._log.info('listColumnDataProfiles request %j', request);
3483
+ return this.innerApiCalls
3484
+ .listColumnDataProfiles(request, options, wrappedCallback)
3485
+ ?.then(([response, input, output]) => {
3486
+ this._log.info('listColumnDataProfiles values %j', response);
3487
+ return [response, input, output];
3488
+ });
2762
3489
  }
2763
3490
  /**
2764
3491
  * Equivalent to `listColumnDataProfiles`, but returns a NodeJS Stream object.
@@ -2837,18 +3564,20 @@ class DlpServiceClient {
2837
3564
  * for more details and examples.
2838
3565
  */
2839
3566
  listColumnDataProfilesStream(request, options) {
2840
- var _a;
2841
3567
  request = request || {};
2842
3568
  options = options || {};
2843
3569
  options.otherArgs = options.otherArgs || {};
2844
3570
  options.otherArgs.headers = options.otherArgs.headers || {};
2845
3571
  options.otherArgs.headers['x-goog-request-params'] =
2846
3572
  this._gaxModule.routingHeader.fromParams({
2847
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3573
+ parent: request.parent ?? '',
2848
3574
  });
2849
3575
  const defaultCallSettings = this._defaults['listColumnDataProfiles'];
2850
3576
  const callSettings = defaultCallSettings.merge(options);
2851
- this.initialize();
3577
+ this.initialize().catch(err => {
3578
+ throw err;
3579
+ });
3580
+ this._log.info('listColumnDataProfiles stream %j', request);
2852
3581
  return this.descriptors.page.listColumnDataProfiles.createStream(this.innerApiCalls.listColumnDataProfiles, request, callSettings);
2853
3582
  }
2854
3583
  /**
@@ -2931,22 +3660,23 @@ class DlpServiceClient {
2931
3660
  * region_tag:dlp_v2_generated_DlpService_ListColumnDataProfiles_async
2932
3661
  */
2933
3662
  listColumnDataProfilesAsync(request, options) {
2934
- var _a;
2935
3663
  request = request || {};
2936
3664
  options = options || {};
2937
3665
  options.otherArgs = options.otherArgs || {};
2938
3666
  options.otherArgs.headers = options.otherArgs.headers || {};
2939
3667
  options.otherArgs.headers['x-goog-request-params'] =
2940
3668
  this._gaxModule.routingHeader.fromParams({
2941
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3669
+ parent: request.parent ?? '',
2942
3670
  });
2943
3671
  const defaultCallSettings = this._defaults['listColumnDataProfiles'];
2944
3672
  const callSettings = defaultCallSettings.merge(options);
2945
- this.initialize();
3673
+ this.initialize().catch(err => {
3674
+ throw err;
3675
+ });
3676
+ this._log.info('listColumnDataProfiles iterate %j', request);
2946
3677
  return this.descriptors.page.listColumnDataProfiles.asyncIterate(this.innerApiCalls['listColumnDataProfiles'], request, callSettings);
2947
3678
  }
2948
3679
  listFileStoreDataProfiles(request, optionsOrCallback, callback) {
2949
- var _a;
2950
3680
  request = request || {};
2951
3681
  let options;
2952
3682
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -2961,10 +3691,24 @@ class DlpServiceClient {
2961
3691
  options.otherArgs.headers = options.otherArgs.headers || {};
2962
3692
  options.otherArgs.headers['x-goog-request-params'] =
2963
3693
  this._gaxModule.routingHeader.fromParams({
2964
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3694
+ parent: request.parent ?? '',
2965
3695
  });
2966
- this.initialize();
2967
- return this.innerApiCalls.listFileStoreDataProfiles(request, options, callback);
3696
+ this.initialize().catch(err => {
3697
+ throw err;
3698
+ });
3699
+ const wrappedCallback = callback
3700
+ ? (error, values, nextPageRequest, rawResponse) => {
3701
+ this._log.info('listFileStoreDataProfiles values %j', values);
3702
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
3703
+ }
3704
+ : undefined;
3705
+ this._log.info('listFileStoreDataProfiles request %j', request);
3706
+ return this.innerApiCalls
3707
+ .listFileStoreDataProfiles(request, options, wrappedCallback)
3708
+ ?.then(([response, input, output]) => {
3709
+ this._log.info('listFileStoreDataProfiles values %j', response);
3710
+ return [response, input, output];
3711
+ });
2968
3712
  }
2969
3713
  /**
2970
3714
  * Equivalent to `listFileStoreDataProfiles`, but returns a NodeJS Stream object.
@@ -3046,18 +3790,20 @@ class DlpServiceClient {
3046
3790
  * for more details and examples.
3047
3791
  */
3048
3792
  listFileStoreDataProfilesStream(request, options) {
3049
- var _a;
3050
3793
  request = request || {};
3051
3794
  options = options || {};
3052
3795
  options.otherArgs = options.otherArgs || {};
3053
3796
  options.otherArgs.headers = options.otherArgs.headers || {};
3054
3797
  options.otherArgs.headers['x-goog-request-params'] =
3055
3798
  this._gaxModule.routingHeader.fromParams({
3056
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3799
+ parent: request.parent ?? '',
3057
3800
  });
3058
3801
  const defaultCallSettings = this._defaults['listFileStoreDataProfiles'];
3059
3802
  const callSettings = defaultCallSettings.merge(options);
3060
- this.initialize();
3803
+ this.initialize().catch(err => {
3804
+ throw err;
3805
+ });
3806
+ this._log.info('listFileStoreDataProfiles stream %j', request);
3061
3807
  return this.descriptors.page.listFileStoreDataProfiles.createStream(this.innerApiCalls.listFileStoreDataProfiles, request, callSettings);
3062
3808
  }
3063
3809
  /**
@@ -3143,22 +3889,23 @@ class DlpServiceClient {
3143
3889
  * region_tag:dlp_v2_generated_DlpService_ListFileStoreDataProfiles_async
3144
3890
  */
3145
3891
  listFileStoreDataProfilesAsync(request, options) {
3146
- var _a;
3147
3892
  request = request || {};
3148
3893
  options = options || {};
3149
3894
  options.otherArgs = options.otherArgs || {};
3150
3895
  options.otherArgs.headers = options.otherArgs.headers || {};
3151
3896
  options.otherArgs.headers['x-goog-request-params'] =
3152
3897
  this._gaxModule.routingHeader.fromParams({
3153
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3898
+ parent: request.parent ?? '',
3154
3899
  });
3155
3900
  const defaultCallSettings = this._defaults['listFileStoreDataProfiles'];
3156
3901
  const callSettings = defaultCallSettings.merge(options);
3157
- this.initialize();
3902
+ this.initialize().catch(err => {
3903
+ throw err;
3904
+ });
3905
+ this._log.info('listFileStoreDataProfiles iterate %j', request);
3158
3906
  return this.descriptors.page.listFileStoreDataProfiles.asyncIterate(this.innerApiCalls['listFileStoreDataProfiles'], request, callSettings);
3159
3907
  }
3160
3908
  listConnections(request, optionsOrCallback, callback) {
3161
- var _a;
3162
3909
  request = request || {};
3163
3910
  let options;
3164
3911
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -3173,10 +3920,24 @@ class DlpServiceClient {
3173
3920
  options.otherArgs.headers = options.otherArgs.headers || {};
3174
3921
  options.otherArgs.headers['x-goog-request-params'] =
3175
3922
  this._gaxModule.routingHeader.fromParams({
3176
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3923
+ parent: request.parent ?? '',
3177
3924
  });
3178
- this.initialize();
3179
- return this.innerApiCalls.listConnections(request, options, callback);
3925
+ this.initialize().catch(err => {
3926
+ throw err;
3927
+ });
3928
+ const wrappedCallback = callback
3929
+ ? (error, values, nextPageRequest, rawResponse) => {
3930
+ this._log.info('listConnections values %j', values);
3931
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
3932
+ }
3933
+ : undefined;
3934
+ this._log.info('listConnections request %j', request);
3935
+ return this.innerApiCalls
3936
+ .listConnections(request, options, wrappedCallback)
3937
+ ?.then(([response, input, output]) => {
3938
+ this._log.info('listConnections values %j', response);
3939
+ return [response, input, output];
3940
+ });
3180
3941
  }
3181
3942
  /**
3182
3943
  * Equivalent to `listConnections`, but returns a NodeJS Stream object.
@@ -3205,18 +3966,20 @@ class DlpServiceClient {
3205
3966
  * for more details and examples.
3206
3967
  */
3207
3968
  listConnectionsStream(request, options) {
3208
- var _a;
3209
3969
  request = request || {};
3210
3970
  options = options || {};
3211
3971
  options.otherArgs = options.otherArgs || {};
3212
3972
  options.otherArgs.headers = options.otherArgs.headers || {};
3213
3973
  options.otherArgs.headers['x-goog-request-params'] =
3214
3974
  this._gaxModule.routingHeader.fromParams({
3215
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
3975
+ parent: request.parent ?? '',
3216
3976
  });
3217
3977
  const defaultCallSettings = this._defaults['listConnections'];
3218
3978
  const callSettings = defaultCallSettings.merge(options);
3219
- this.initialize();
3979
+ this.initialize().catch(err => {
3980
+ throw err;
3981
+ });
3982
+ this._log.info('listConnections stream %j', request);
3220
3983
  return this.descriptors.page.listConnections.createStream(this.innerApiCalls.listConnections, request, callSettings);
3221
3984
  }
3222
3985
  /**
@@ -3249,22 +4012,23 @@ class DlpServiceClient {
3249
4012
  * region_tag:dlp_v2_generated_DlpService_ListConnections_async
3250
4013
  */
3251
4014
  listConnectionsAsync(request, options) {
3252
- var _a;
3253
4015
  request = request || {};
3254
4016
  options = options || {};
3255
4017
  options.otherArgs = options.otherArgs || {};
3256
4018
  options.otherArgs.headers = options.otherArgs.headers || {};
3257
4019
  options.otherArgs.headers['x-goog-request-params'] =
3258
4020
  this._gaxModule.routingHeader.fromParams({
3259
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
4021
+ parent: request.parent ?? '',
3260
4022
  });
3261
4023
  const defaultCallSettings = this._defaults['listConnections'];
3262
4024
  const callSettings = defaultCallSettings.merge(options);
3263
- this.initialize();
4025
+ this.initialize().catch(err => {
4026
+ throw err;
4027
+ });
4028
+ this._log.info('listConnections iterate %j', request);
3264
4029
  return this.descriptors.page.listConnections.asyncIterate(this.innerApiCalls['listConnections'], request, callSettings);
3265
4030
  }
3266
4031
  searchConnections(request, optionsOrCallback, callback) {
3267
- var _a;
3268
4032
  request = request || {};
3269
4033
  let options;
3270
4034
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -3279,10 +4043,24 @@ class DlpServiceClient {
3279
4043
  options.otherArgs.headers = options.otherArgs.headers || {};
3280
4044
  options.otherArgs.headers['x-goog-request-params'] =
3281
4045
  this._gaxModule.routingHeader.fromParams({
3282
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
4046
+ parent: request.parent ?? '',
3283
4047
  });
3284
- this.initialize();
3285
- return this.innerApiCalls.searchConnections(request, options, callback);
4048
+ this.initialize().catch(err => {
4049
+ throw err;
4050
+ });
4051
+ const wrappedCallback = callback
4052
+ ? (error, values, nextPageRequest, rawResponse) => {
4053
+ this._log.info('searchConnections values %j', values);
4054
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
4055
+ }
4056
+ : undefined;
4057
+ this._log.info('searchConnections request %j', request);
4058
+ return this.innerApiCalls
4059
+ .searchConnections(request, options, wrappedCallback)
4060
+ ?.then(([response, input, output]) => {
4061
+ this._log.info('searchConnections values %j', response);
4062
+ return [response, input, output];
4063
+ });
3286
4064
  }
3287
4065
  /**
3288
4066
  * Equivalent to `searchConnections`, but returns a NodeJS Stream object.
@@ -3311,18 +4089,20 @@ class DlpServiceClient {
3311
4089
  * for more details and examples.
3312
4090
  */
3313
4091
  searchConnectionsStream(request, options) {
3314
- var _a;
3315
4092
  request = request || {};
3316
4093
  options = options || {};
3317
4094
  options.otherArgs = options.otherArgs || {};
3318
4095
  options.otherArgs.headers = options.otherArgs.headers || {};
3319
4096
  options.otherArgs.headers['x-goog-request-params'] =
3320
4097
  this._gaxModule.routingHeader.fromParams({
3321
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
4098
+ parent: request.parent ?? '',
3322
4099
  });
3323
4100
  const defaultCallSettings = this._defaults['searchConnections'];
3324
4101
  const callSettings = defaultCallSettings.merge(options);
3325
- this.initialize();
4102
+ this.initialize().catch(err => {
4103
+ throw err;
4104
+ });
4105
+ this._log.info('searchConnections stream %j', request);
3326
4106
  return this.descriptors.page.searchConnections.createStream(this.innerApiCalls.searchConnections, request, callSettings);
3327
4107
  }
3328
4108
  /**
@@ -3355,18 +4135,20 @@ class DlpServiceClient {
3355
4135
  * region_tag:dlp_v2_generated_DlpService_SearchConnections_async
3356
4136
  */
3357
4137
  searchConnectionsAsync(request, options) {
3358
- var _a;
3359
4138
  request = request || {};
3360
4139
  options = options || {};
3361
4140
  options.otherArgs = options.otherArgs || {};
3362
4141
  options.otherArgs.headers = options.otherArgs.headers || {};
3363
4142
  options.otherArgs.headers['x-goog-request-params'] =
3364
4143
  this._gaxModule.routingHeader.fromParams({
3365
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
4144
+ parent: request.parent ?? '',
3366
4145
  });
3367
4146
  const defaultCallSettings = this._defaults['searchConnections'];
3368
4147
  const callSettings = defaultCallSettings.merge(options);
3369
- this.initialize();
4148
+ this.initialize().catch(err => {
4149
+ throw err;
4150
+ });
4151
+ this._log.info('searchConnections iterate %j', request);
3370
4152
  return this.descriptors.page.searchConnections.asyncIterate(this.innerApiCalls['searchConnections'], request, callSettings);
3371
4153
  }
3372
4154
  /**
@@ -4732,6 +5514,7 @@ class DlpServiceClient {
4732
5514
  close() {
4733
5515
  if (this.dlpServiceStub && !this._terminated) {
4734
5516
  return this.dlpServiceStub.then(stub => {
5517
+ this._log.info('ending gRPC channel');
4735
5518
  this._terminated = true;
4736
5519
  stub.close();
4737
5520
  this.locationsClient.close();