@google-cloud/containeranalysis 5.5.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2024 Google LLC
2
+ // Copyright 2025 Google LLC
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.GrafeasV1Beta1Client = 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/v1beta1/grafeas_v1_beta1_client_config.json`.
@@ -45,6 +46,26 @@ const version = require('../../../package.json').version;
45
46
  * @memberof v1beta1
46
47
  */
47
48
  class GrafeasV1Beta1Client {
49
+ _terminated = false;
50
+ _opts;
51
+ _providedCustomServicePath;
52
+ _gaxModule;
53
+ _gaxGrpc;
54
+ _protos;
55
+ _defaults;
56
+ _universeDomain;
57
+ _servicePath;
58
+ _log = google_gax_1.loggingUtils.log('containeranalysis');
59
+ auth;
60
+ descriptors = {
61
+ page: {},
62
+ stream: {},
63
+ longrunning: {},
64
+ batching: {},
65
+ };
66
+ warn;
67
+ innerApiCalls;
68
+ grafeasV1Beta1Stub;
48
69
  /**
49
70
  * Construct an instance of GrafeasV1Beta1Client.
50
71
  *
@@ -67,7 +88,7 @@ class GrafeasV1Beta1Client {
67
88
  * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
68
89
  * the environment variable GCLOUD_PROJECT for your project ID. If your
69
90
  * app is running in an environment which supports
70
- * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
91
+ * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
71
92
  * your project ID will be detected automatically.
72
93
  * @param {string} [options.apiEndpoint] - The domain name of the
73
94
  * API remote host.
@@ -85,32 +106,28 @@ class GrafeasV1Beta1Client {
85
106
  * ```
86
107
  */
87
108
  constructor(opts, gaxInstance) {
88
- var _a, _b, _c, _d, _e;
89
- this._terminated = false;
90
- this.descriptors = {
91
- page: {},
92
- stream: {},
93
- longrunning: {},
94
- batching: {},
95
- };
96
109
  // Ensure that options include all the required fields.
97
110
  const staticMembers = this.constructor;
98
- if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
99
- (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
100
- (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
111
+ if (opts?.universe_domain &&
112
+ opts?.universeDomain &&
113
+ opts?.universe_domain !== opts?.universeDomain) {
101
114
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
102
115
  }
103
116
  const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
104
117
  ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
105
118
  : undefined;
106
119
  this._universeDomain =
107
- (_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';
120
+ opts?.universeDomain ??
121
+ opts?.universe_domain ??
122
+ universeDomainEnvVar ??
123
+ 'googleapis.com';
108
124
  this._servicePath = 'containeranalysis.' + this._universeDomain;
109
- const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
110
- this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
111
- const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
112
- const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
113
- 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');
125
+ const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
126
+ this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
127
+ const port = opts?.port || staticMembers.port;
128
+ const clientConfig = opts?.clientConfig ?? {};
129
+ const fallback = opts?.fallback ??
130
+ (typeof window !== 'undefined' && typeof window?.fetch === 'function');
114
131
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
115
132
  // Request numeric enum values if REST transport is used.
116
133
  opts.numericEnums = true;
@@ -292,7 +309,6 @@ class GrafeasV1Beta1Client {
292
309
  return this.auth.getProjectId();
293
310
  }
294
311
  getOccurrence(request, optionsOrCallback, callback) {
295
- var _a;
296
312
  request = request || {};
297
313
  let options;
298
314
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -307,13 +323,24 @@ class GrafeasV1Beta1Client {
307
323
  options.otherArgs.headers = options.otherArgs.headers || {};
308
324
  options.otherArgs.headers['x-goog-request-params'] =
309
325
  this._gaxModule.routingHeader.fromParams({
310
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
326
+ name: request.name ?? '',
311
327
  });
312
328
  this.initialize();
313
- return this.innerApiCalls.getOccurrence(request, options, callback);
329
+ this._log.info('getOccurrence request %j', request);
330
+ const wrappedCallback = callback
331
+ ? (error, response, options, rawResponse) => {
332
+ this._log.info('getOccurrence response %j', response);
333
+ callback(error, response, options, rawResponse); // We verified callback above.
334
+ }
335
+ : undefined;
336
+ return this.innerApiCalls
337
+ .getOccurrence(request, options, wrappedCallback)
338
+ ?.then(([response, options, rawResponse]) => {
339
+ this._log.info('getOccurrence response %j', response);
340
+ return [response, options, rawResponse];
341
+ });
314
342
  }
315
343
  deleteOccurrence(request, optionsOrCallback, callback) {
316
- var _a;
317
344
  request = request || {};
318
345
  let options;
319
346
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -328,13 +355,24 @@ class GrafeasV1Beta1Client {
328
355
  options.otherArgs.headers = options.otherArgs.headers || {};
329
356
  options.otherArgs.headers['x-goog-request-params'] =
330
357
  this._gaxModule.routingHeader.fromParams({
331
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
358
+ name: request.name ?? '',
332
359
  });
333
360
  this.initialize();
334
- return this.innerApiCalls.deleteOccurrence(request, options, callback);
361
+ this._log.info('deleteOccurrence request %j', request);
362
+ const wrappedCallback = callback
363
+ ? (error, response, options, rawResponse) => {
364
+ this._log.info('deleteOccurrence response %j', response);
365
+ callback(error, response, options, rawResponse); // We verified callback above.
366
+ }
367
+ : undefined;
368
+ return this.innerApiCalls
369
+ .deleteOccurrence(request, options, wrappedCallback)
370
+ ?.then(([response, options, rawResponse]) => {
371
+ this._log.info('deleteOccurrence response %j', response);
372
+ return [response, options, rawResponse];
373
+ });
335
374
  }
336
375
  createOccurrence(request, optionsOrCallback, callback) {
337
- var _a;
338
376
  request = request || {};
339
377
  let options;
340
378
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -349,13 +387,24 @@ class GrafeasV1Beta1Client {
349
387
  options.otherArgs.headers = options.otherArgs.headers || {};
350
388
  options.otherArgs.headers['x-goog-request-params'] =
351
389
  this._gaxModule.routingHeader.fromParams({
352
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
390
+ parent: request.parent ?? '',
353
391
  });
354
392
  this.initialize();
355
- return this.innerApiCalls.createOccurrence(request, options, callback);
393
+ this._log.info('createOccurrence request %j', request);
394
+ const wrappedCallback = callback
395
+ ? (error, response, options, rawResponse) => {
396
+ this._log.info('createOccurrence response %j', response);
397
+ callback(error, response, options, rawResponse); // We verified callback above.
398
+ }
399
+ : undefined;
400
+ return this.innerApiCalls
401
+ .createOccurrence(request, options, wrappedCallback)
402
+ ?.then(([response, options, rawResponse]) => {
403
+ this._log.info('createOccurrence response %j', response);
404
+ return [response, options, rawResponse];
405
+ });
356
406
  }
357
407
  batchCreateOccurrences(request, optionsOrCallback, callback) {
358
- var _a;
359
408
  request = request || {};
360
409
  let options;
361
410
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -370,13 +419,24 @@ class GrafeasV1Beta1Client {
370
419
  options.otherArgs.headers = options.otherArgs.headers || {};
371
420
  options.otherArgs.headers['x-goog-request-params'] =
372
421
  this._gaxModule.routingHeader.fromParams({
373
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
422
+ parent: request.parent ?? '',
374
423
  });
375
424
  this.initialize();
376
- return this.innerApiCalls.batchCreateOccurrences(request, options, callback);
425
+ this._log.info('batchCreateOccurrences request %j', request);
426
+ const wrappedCallback = callback
427
+ ? (error, response, options, rawResponse) => {
428
+ this._log.info('batchCreateOccurrences response %j', response);
429
+ callback(error, response, options, rawResponse); // We verified callback above.
430
+ }
431
+ : undefined;
432
+ return this.innerApiCalls
433
+ .batchCreateOccurrences(request, options, wrappedCallback)
434
+ ?.then(([response, options, rawResponse]) => {
435
+ this._log.info('batchCreateOccurrences response %j', response);
436
+ return [response, options, rawResponse];
437
+ });
377
438
  }
378
439
  updateOccurrence(request, optionsOrCallback, callback) {
379
- var _a;
380
440
  request = request || {};
381
441
  let options;
382
442
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -391,13 +451,24 @@ class GrafeasV1Beta1Client {
391
451
  options.otherArgs.headers = options.otherArgs.headers || {};
392
452
  options.otherArgs.headers['x-goog-request-params'] =
393
453
  this._gaxModule.routingHeader.fromParams({
394
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
454
+ name: request.name ?? '',
395
455
  });
396
456
  this.initialize();
397
- return this.innerApiCalls.updateOccurrence(request, options, callback);
457
+ this._log.info('updateOccurrence request %j', request);
458
+ const wrappedCallback = callback
459
+ ? (error, response, options, rawResponse) => {
460
+ this._log.info('updateOccurrence response %j', response);
461
+ callback(error, response, options, rawResponse); // We verified callback above.
462
+ }
463
+ : undefined;
464
+ return this.innerApiCalls
465
+ .updateOccurrence(request, options, wrappedCallback)
466
+ ?.then(([response, options, rawResponse]) => {
467
+ this._log.info('updateOccurrence response %j', response);
468
+ return [response, options, rawResponse];
469
+ });
398
470
  }
399
471
  getOccurrenceNote(request, optionsOrCallback, callback) {
400
- var _a;
401
472
  request = request || {};
402
473
  let options;
403
474
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -412,13 +483,24 @@ class GrafeasV1Beta1Client {
412
483
  options.otherArgs.headers = options.otherArgs.headers || {};
413
484
  options.otherArgs.headers['x-goog-request-params'] =
414
485
  this._gaxModule.routingHeader.fromParams({
415
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
486
+ name: request.name ?? '',
416
487
  });
417
488
  this.initialize();
418
- return this.innerApiCalls.getOccurrenceNote(request, options, callback);
489
+ this._log.info('getOccurrenceNote request %j', request);
490
+ const wrappedCallback = callback
491
+ ? (error, response, options, rawResponse) => {
492
+ this._log.info('getOccurrenceNote response %j', response);
493
+ callback(error, response, options, rawResponse); // We verified callback above.
494
+ }
495
+ : undefined;
496
+ return this.innerApiCalls
497
+ .getOccurrenceNote(request, options, wrappedCallback)
498
+ ?.then(([response, options, rawResponse]) => {
499
+ this._log.info('getOccurrenceNote response %j', response);
500
+ return [response, options, rawResponse];
501
+ });
419
502
  }
420
503
  getNote(request, optionsOrCallback, callback) {
421
- var _a;
422
504
  request = request || {};
423
505
  let options;
424
506
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -433,13 +515,24 @@ class GrafeasV1Beta1Client {
433
515
  options.otherArgs.headers = options.otherArgs.headers || {};
434
516
  options.otherArgs.headers['x-goog-request-params'] =
435
517
  this._gaxModule.routingHeader.fromParams({
436
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
518
+ name: request.name ?? '',
437
519
  });
438
520
  this.initialize();
439
- return this.innerApiCalls.getNote(request, options, callback);
521
+ this._log.info('getNote request %j', request);
522
+ const wrappedCallback = callback
523
+ ? (error, response, options, rawResponse) => {
524
+ this._log.info('getNote response %j', response);
525
+ callback(error, response, options, rawResponse); // We verified callback above.
526
+ }
527
+ : undefined;
528
+ return this.innerApiCalls
529
+ .getNote(request, options, wrappedCallback)
530
+ ?.then(([response, options, rawResponse]) => {
531
+ this._log.info('getNote response %j', response);
532
+ return [response, options, rawResponse];
533
+ });
440
534
  }
441
535
  deleteNote(request, optionsOrCallback, callback) {
442
- var _a;
443
536
  request = request || {};
444
537
  let options;
445
538
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -454,13 +547,24 @@ class GrafeasV1Beta1Client {
454
547
  options.otherArgs.headers = options.otherArgs.headers || {};
455
548
  options.otherArgs.headers['x-goog-request-params'] =
456
549
  this._gaxModule.routingHeader.fromParams({
457
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
550
+ name: request.name ?? '',
458
551
  });
459
552
  this.initialize();
460
- return this.innerApiCalls.deleteNote(request, options, callback);
553
+ this._log.info('deleteNote request %j', request);
554
+ const wrappedCallback = callback
555
+ ? (error, response, options, rawResponse) => {
556
+ this._log.info('deleteNote response %j', response);
557
+ callback(error, response, options, rawResponse); // We verified callback above.
558
+ }
559
+ : undefined;
560
+ return this.innerApiCalls
561
+ .deleteNote(request, options, wrappedCallback)
562
+ ?.then(([response, options, rawResponse]) => {
563
+ this._log.info('deleteNote response %j', response);
564
+ return [response, options, rawResponse];
565
+ });
461
566
  }
462
567
  createNote(request, optionsOrCallback, callback) {
463
- var _a;
464
568
  request = request || {};
465
569
  let options;
466
570
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -475,13 +579,24 @@ class GrafeasV1Beta1Client {
475
579
  options.otherArgs.headers = options.otherArgs.headers || {};
476
580
  options.otherArgs.headers['x-goog-request-params'] =
477
581
  this._gaxModule.routingHeader.fromParams({
478
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
582
+ parent: request.parent ?? '',
479
583
  });
480
584
  this.initialize();
481
- return this.innerApiCalls.createNote(request, options, callback);
585
+ this._log.info('createNote request %j', request);
586
+ const wrappedCallback = callback
587
+ ? (error, response, options, rawResponse) => {
588
+ this._log.info('createNote response %j', response);
589
+ callback(error, response, options, rawResponse); // We verified callback above.
590
+ }
591
+ : undefined;
592
+ return this.innerApiCalls
593
+ .createNote(request, options, wrappedCallback)
594
+ ?.then(([response, options, rawResponse]) => {
595
+ this._log.info('createNote response %j', response);
596
+ return [response, options, rawResponse];
597
+ });
482
598
  }
483
599
  batchCreateNotes(request, optionsOrCallback, callback) {
484
- var _a;
485
600
  request = request || {};
486
601
  let options;
487
602
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -496,13 +611,24 @@ class GrafeasV1Beta1Client {
496
611
  options.otherArgs.headers = options.otherArgs.headers || {};
497
612
  options.otherArgs.headers['x-goog-request-params'] =
498
613
  this._gaxModule.routingHeader.fromParams({
499
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
614
+ parent: request.parent ?? '',
500
615
  });
501
616
  this.initialize();
502
- return this.innerApiCalls.batchCreateNotes(request, options, callback);
617
+ this._log.info('batchCreateNotes request %j', request);
618
+ const wrappedCallback = callback
619
+ ? (error, response, options, rawResponse) => {
620
+ this._log.info('batchCreateNotes response %j', response);
621
+ callback(error, response, options, rawResponse); // We verified callback above.
622
+ }
623
+ : undefined;
624
+ return this.innerApiCalls
625
+ .batchCreateNotes(request, options, wrappedCallback)
626
+ ?.then(([response, options, rawResponse]) => {
627
+ this._log.info('batchCreateNotes response %j', response);
628
+ return [response, options, rawResponse];
629
+ });
503
630
  }
504
631
  updateNote(request, optionsOrCallback, callback) {
505
- var _a;
506
632
  request = request || {};
507
633
  let options;
508
634
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -517,13 +643,24 @@ class GrafeasV1Beta1Client {
517
643
  options.otherArgs.headers = options.otherArgs.headers || {};
518
644
  options.otherArgs.headers['x-goog-request-params'] =
519
645
  this._gaxModule.routingHeader.fromParams({
520
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
646
+ name: request.name ?? '',
521
647
  });
522
648
  this.initialize();
523
- return this.innerApiCalls.updateNote(request, options, callback);
649
+ this._log.info('updateNote request %j', request);
650
+ const wrappedCallback = callback
651
+ ? (error, response, options, rawResponse) => {
652
+ this._log.info('updateNote response %j', response);
653
+ callback(error, response, options, rawResponse); // We verified callback above.
654
+ }
655
+ : undefined;
656
+ return this.innerApiCalls
657
+ .updateNote(request, options, wrappedCallback)
658
+ ?.then(([response, options, rawResponse]) => {
659
+ this._log.info('updateNote response %j', response);
660
+ return [response, options, rawResponse];
661
+ });
524
662
  }
525
663
  getVulnerabilityOccurrencesSummary(request, optionsOrCallback, callback) {
526
- var _a;
527
664
  request = request || {};
528
665
  let options;
529
666
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -538,13 +675,24 @@ class GrafeasV1Beta1Client {
538
675
  options.otherArgs.headers = options.otherArgs.headers || {};
539
676
  options.otherArgs.headers['x-goog-request-params'] =
540
677
  this._gaxModule.routingHeader.fromParams({
541
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
678
+ parent: request.parent ?? '',
542
679
  });
543
680
  this.initialize();
544
- return this.innerApiCalls.getVulnerabilityOccurrencesSummary(request, options, callback);
681
+ this._log.info('getVulnerabilityOccurrencesSummary request %j', request);
682
+ const wrappedCallback = callback
683
+ ? (error, response, options, rawResponse) => {
684
+ this._log.info('getVulnerabilityOccurrencesSummary response %j', response);
685
+ callback(error, response, options, rawResponse); // We verified callback above.
686
+ }
687
+ : undefined;
688
+ return this.innerApiCalls
689
+ .getVulnerabilityOccurrencesSummary(request, options, wrappedCallback)
690
+ ?.then(([response, options, rawResponse]) => {
691
+ this._log.info('getVulnerabilityOccurrencesSummary response %j', response);
692
+ return [response, options, rawResponse];
693
+ });
545
694
  }
546
695
  listOccurrences(request, optionsOrCallback, callback) {
547
- var _a;
548
696
  request = request || {};
549
697
  let options;
550
698
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -559,13 +707,25 @@ class GrafeasV1Beta1Client {
559
707
  options.otherArgs.headers = options.otherArgs.headers || {};
560
708
  options.otherArgs.headers['x-goog-request-params'] =
561
709
  this._gaxModule.routingHeader.fromParams({
562
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
710
+ parent: request.parent ?? '',
563
711
  });
564
712
  this.initialize();
565
- return this.innerApiCalls.listOccurrences(request, options, callback);
713
+ const wrappedCallback = callback
714
+ ? (error, values, nextPageRequest, rawResponse) => {
715
+ this._log.info('listOccurrences values %j', values);
716
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
717
+ }
718
+ : undefined;
719
+ this._log.info('listOccurrences request %j', request);
720
+ return this.innerApiCalls
721
+ .listOccurrences(request, options, wrappedCallback)
722
+ ?.then(([response, input, output]) => {
723
+ this._log.info('listOccurrences values %j', response);
724
+ return [response, input, output];
725
+ });
566
726
  }
567
727
  /**
568
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
728
+ * Equivalent to `listOccurrences`, but returns a NodeJS Stream object.
569
729
  * @param {Object} request
570
730
  * The request object that will be sent.
571
731
  * @param {string} request.parent
@@ -589,18 +749,18 @@ class GrafeasV1Beta1Client {
589
749
  * for more details and examples.
590
750
  */
591
751
  listOccurrencesStream(request, options) {
592
- var _a;
593
752
  request = request || {};
594
753
  options = options || {};
595
754
  options.otherArgs = options.otherArgs || {};
596
755
  options.otherArgs.headers = options.otherArgs.headers || {};
597
756
  options.otherArgs.headers['x-goog-request-params'] =
598
757
  this._gaxModule.routingHeader.fromParams({
599
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
758
+ parent: request.parent ?? '',
600
759
  });
601
760
  const defaultCallSettings = this._defaults['listOccurrences'];
602
761
  const callSettings = defaultCallSettings.merge(options);
603
762
  this.initialize();
763
+ this._log.info('listOccurrences stream %j', request);
604
764
  return this.descriptors.page.listOccurrences.createStream(this.innerApiCalls.listOccurrences, request, callSettings);
605
765
  }
606
766
  /**
@@ -631,22 +791,21 @@ class GrafeasV1Beta1Client {
631
791
  * region_tag:containeranalysis_v1beta1_generated_GrafeasV1Beta1_ListOccurrences_async
632
792
  */
633
793
  listOccurrencesAsync(request, options) {
634
- var _a;
635
794
  request = request || {};
636
795
  options = options || {};
637
796
  options.otherArgs = options.otherArgs || {};
638
797
  options.otherArgs.headers = options.otherArgs.headers || {};
639
798
  options.otherArgs.headers['x-goog-request-params'] =
640
799
  this._gaxModule.routingHeader.fromParams({
641
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
800
+ parent: request.parent ?? '',
642
801
  });
643
802
  const defaultCallSettings = this._defaults['listOccurrences'];
644
803
  const callSettings = defaultCallSettings.merge(options);
645
804
  this.initialize();
805
+ this._log.info('listOccurrences iterate %j', request);
646
806
  return this.descriptors.page.listOccurrences.asyncIterate(this.innerApiCalls['listOccurrences'], request, callSettings);
647
807
  }
648
808
  listNotes(request, optionsOrCallback, callback) {
649
- var _a;
650
809
  request = request || {};
651
810
  let options;
652
811
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -661,13 +820,25 @@ class GrafeasV1Beta1Client {
661
820
  options.otherArgs.headers = options.otherArgs.headers || {};
662
821
  options.otherArgs.headers['x-goog-request-params'] =
663
822
  this._gaxModule.routingHeader.fromParams({
664
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
823
+ parent: request.parent ?? '',
665
824
  });
666
825
  this.initialize();
667
- return this.innerApiCalls.listNotes(request, options, callback);
826
+ const wrappedCallback = callback
827
+ ? (error, values, nextPageRequest, rawResponse) => {
828
+ this._log.info('listNotes values %j', values);
829
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
830
+ }
831
+ : undefined;
832
+ this._log.info('listNotes request %j', request);
833
+ return this.innerApiCalls
834
+ .listNotes(request, options, wrappedCallback)
835
+ ?.then(([response, input, output]) => {
836
+ this._log.info('listNotes values %j', response);
837
+ return [response, input, output];
838
+ });
668
839
  }
669
840
  /**
670
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
841
+ * Equivalent to `listNotes`, but returns a NodeJS Stream object.
671
842
  * @param {Object} request
672
843
  * The request object that will be sent.
673
844
  * @param {string} request.parent
@@ -691,18 +862,18 @@ class GrafeasV1Beta1Client {
691
862
  * for more details and examples.
692
863
  */
693
864
  listNotesStream(request, options) {
694
- var _a;
695
865
  request = request || {};
696
866
  options = options || {};
697
867
  options.otherArgs = options.otherArgs || {};
698
868
  options.otherArgs.headers = options.otherArgs.headers || {};
699
869
  options.otherArgs.headers['x-goog-request-params'] =
700
870
  this._gaxModule.routingHeader.fromParams({
701
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
871
+ parent: request.parent ?? '',
702
872
  });
703
873
  const defaultCallSettings = this._defaults['listNotes'];
704
874
  const callSettings = defaultCallSettings.merge(options);
705
875
  this.initialize();
876
+ this._log.info('listNotes stream %j', request);
706
877
  return this.descriptors.page.listNotes.createStream(this.innerApiCalls.listNotes, request, callSettings);
707
878
  }
708
879
  /**
@@ -733,22 +904,21 @@ class GrafeasV1Beta1Client {
733
904
  * region_tag:containeranalysis_v1beta1_generated_GrafeasV1Beta1_ListNotes_async
734
905
  */
735
906
  listNotesAsync(request, options) {
736
- var _a;
737
907
  request = request || {};
738
908
  options = options || {};
739
909
  options.otherArgs = options.otherArgs || {};
740
910
  options.otherArgs.headers = options.otherArgs.headers || {};
741
911
  options.otherArgs.headers['x-goog-request-params'] =
742
912
  this._gaxModule.routingHeader.fromParams({
743
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
913
+ parent: request.parent ?? '',
744
914
  });
745
915
  const defaultCallSettings = this._defaults['listNotes'];
746
916
  const callSettings = defaultCallSettings.merge(options);
747
917
  this.initialize();
918
+ this._log.info('listNotes iterate %j', request);
748
919
  return this.descriptors.page.listNotes.asyncIterate(this.innerApiCalls['listNotes'], request, callSettings);
749
920
  }
750
921
  listNoteOccurrences(request, optionsOrCallback, callback) {
751
- var _a;
752
922
  request = request || {};
753
923
  let options;
754
924
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -763,13 +933,25 @@ class GrafeasV1Beta1Client {
763
933
  options.otherArgs.headers = options.otherArgs.headers || {};
764
934
  options.otherArgs.headers['x-goog-request-params'] =
765
935
  this._gaxModule.routingHeader.fromParams({
766
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
936
+ name: request.name ?? '',
767
937
  });
768
938
  this.initialize();
769
- return this.innerApiCalls.listNoteOccurrences(request, options, callback);
939
+ const wrappedCallback = callback
940
+ ? (error, values, nextPageRequest, rawResponse) => {
941
+ this._log.info('listNoteOccurrences values %j', values);
942
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
943
+ }
944
+ : undefined;
945
+ this._log.info('listNoteOccurrences request %j', request);
946
+ return this.innerApiCalls
947
+ .listNoteOccurrences(request, options, wrappedCallback)
948
+ ?.then(([response, input, output]) => {
949
+ this._log.info('listNoteOccurrences values %j', response);
950
+ return [response, input, output];
951
+ });
770
952
  }
771
953
  /**
772
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
954
+ * Equivalent to `listNoteOccurrences`, but returns a NodeJS Stream object.
773
955
  * @param {Object} request
774
956
  * The request object that will be sent.
775
957
  * @param {string} request.name
@@ -793,18 +975,18 @@ class GrafeasV1Beta1Client {
793
975
  * for more details and examples.
794
976
  */
795
977
  listNoteOccurrencesStream(request, options) {
796
- var _a;
797
978
  request = request || {};
798
979
  options = options || {};
799
980
  options.otherArgs = options.otherArgs || {};
800
981
  options.otherArgs.headers = options.otherArgs.headers || {};
801
982
  options.otherArgs.headers['x-goog-request-params'] =
802
983
  this._gaxModule.routingHeader.fromParams({
803
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
984
+ name: request.name ?? '',
804
985
  });
805
986
  const defaultCallSettings = this._defaults['listNoteOccurrences'];
806
987
  const callSettings = defaultCallSettings.merge(options);
807
988
  this.initialize();
989
+ this._log.info('listNoteOccurrences stream %j', request);
808
990
  return this.descriptors.page.listNoteOccurrences.createStream(this.innerApiCalls.listNoteOccurrences, request, callSettings);
809
991
  }
810
992
  /**
@@ -835,18 +1017,18 @@ class GrafeasV1Beta1Client {
835
1017
  * region_tag:containeranalysis_v1beta1_generated_GrafeasV1Beta1_ListNoteOccurrences_async
836
1018
  */
837
1019
  listNoteOccurrencesAsync(request, options) {
838
- var _a;
839
1020
  request = request || {};
840
1021
  options = options || {};
841
1022
  options.otherArgs = options.otherArgs || {};
842
1023
  options.otherArgs.headers = options.otherArgs.headers || {};
843
1024
  options.otherArgs.headers['x-goog-request-params'] =
844
1025
  this._gaxModule.routingHeader.fromParams({
845
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1026
+ name: request.name ?? '',
846
1027
  });
847
1028
  const defaultCallSettings = this._defaults['listNoteOccurrences'];
848
1029
  const callSettings = defaultCallSettings.merge(options);
849
1030
  this.initialize();
1031
+ this._log.info('listNoteOccurrences iterate %j', request);
850
1032
  return this.descriptors.page.listNoteOccurrences.asyncIterate(this.innerApiCalls['listNoteOccurrences'], request, callSettings);
851
1033
  }
852
1034
  /**
@@ -858,6 +1040,7 @@ class GrafeasV1Beta1Client {
858
1040
  close() {
859
1041
  if (this.grafeasV1Beta1Stub && !this._terminated) {
860
1042
  return this.grafeasV1Beta1Stub.then(stub => {
1043
+ this._log.info('ending gRPC channel');
861
1044
  this._terminated = true;
862
1045
  stub.close();
863
1046
  });