@google-cloud/containeranalysis 5.6.0 → 6.1.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,26 @@ 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
- this.initialize();
313
- return this.innerApiCalls.getOccurrence(request, options, callback);
328
+ this.initialize().catch(err => {
329
+ throw err;
330
+ });
331
+ this._log.info('getOccurrence request %j', request);
332
+ const wrappedCallback = callback
333
+ ? (error, response, options, rawResponse) => {
334
+ this._log.info('getOccurrence response %j', response);
335
+ callback(error, response, options, rawResponse); // We verified callback above.
336
+ }
337
+ : undefined;
338
+ return this.innerApiCalls
339
+ .getOccurrence(request, options, wrappedCallback)
340
+ ?.then(([response, options, rawResponse]) => {
341
+ this._log.info('getOccurrence response %j', response);
342
+ return [response, options, rawResponse];
343
+ });
314
344
  }
315
345
  deleteOccurrence(request, optionsOrCallback, callback) {
316
- var _a;
317
346
  request = request || {};
318
347
  let options;
319
348
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -328,13 +357,26 @@ class GrafeasV1Beta1Client {
328
357
  options.otherArgs.headers = options.otherArgs.headers || {};
329
358
  options.otherArgs.headers['x-goog-request-params'] =
330
359
  this._gaxModule.routingHeader.fromParams({
331
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
360
+ name: request.name ?? '',
332
361
  });
333
- this.initialize();
334
- return this.innerApiCalls.deleteOccurrence(request, options, callback);
362
+ this.initialize().catch(err => {
363
+ throw err;
364
+ });
365
+ this._log.info('deleteOccurrence request %j', request);
366
+ const wrappedCallback = callback
367
+ ? (error, response, options, rawResponse) => {
368
+ this._log.info('deleteOccurrence response %j', response);
369
+ callback(error, response, options, rawResponse); // We verified callback above.
370
+ }
371
+ : undefined;
372
+ return this.innerApiCalls
373
+ .deleteOccurrence(request, options, wrappedCallback)
374
+ ?.then(([response, options, rawResponse]) => {
375
+ this._log.info('deleteOccurrence response %j', response);
376
+ return [response, options, rawResponse];
377
+ });
335
378
  }
336
379
  createOccurrence(request, optionsOrCallback, callback) {
337
- var _a;
338
380
  request = request || {};
339
381
  let options;
340
382
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -349,13 +391,26 @@ class GrafeasV1Beta1Client {
349
391
  options.otherArgs.headers = options.otherArgs.headers || {};
350
392
  options.otherArgs.headers['x-goog-request-params'] =
351
393
  this._gaxModule.routingHeader.fromParams({
352
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
394
+ parent: request.parent ?? '',
353
395
  });
354
- this.initialize();
355
- return this.innerApiCalls.createOccurrence(request, options, callback);
396
+ this.initialize().catch(err => {
397
+ throw err;
398
+ });
399
+ this._log.info('createOccurrence request %j', request);
400
+ const wrappedCallback = callback
401
+ ? (error, response, options, rawResponse) => {
402
+ this._log.info('createOccurrence response %j', response);
403
+ callback(error, response, options, rawResponse); // We verified callback above.
404
+ }
405
+ : undefined;
406
+ return this.innerApiCalls
407
+ .createOccurrence(request, options, wrappedCallback)
408
+ ?.then(([response, options, rawResponse]) => {
409
+ this._log.info('createOccurrence response %j', response);
410
+ return [response, options, rawResponse];
411
+ });
356
412
  }
357
413
  batchCreateOccurrences(request, optionsOrCallback, callback) {
358
- var _a;
359
414
  request = request || {};
360
415
  let options;
361
416
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -370,13 +425,26 @@ class GrafeasV1Beta1Client {
370
425
  options.otherArgs.headers = options.otherArgs.headers || {};
371
426
  options.otherArgs.headers['x-goog-request-params'] =
372
427
  this._gaxModule.routingHeader.fromParams({
373
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
428
+ parent: request.parent ?? '',
374
429
  });
375
- this.initialize();
376
- return this.innerApiCalls.batchCreateOccurrences(request, options, callback);
430
+ this.initialize().catch(err => {
431
+ throw err;
432
+ });
433
+ this._log.info('batchCreateOccurrences request %j', request);
434
+ const wrappedCallback = callback
435
+ ? (error, response, options, rawResponse) => {
436
+ this._log.info('batchCreateOccurrences response %j', response);
437
+ callback(error, response, options, rawResponse); // We verified callback above.
438
+ }
439
+ : undefined;
440
+ return this.innerApiCalls
441
+ .batchCreateOccurrences(request, options, wrappedCallback)
442
+ ?.then(([response, options, rawResponse]) => {
443
+ this._log.info('batchCreateOccurrences response %j', response);
444
+ return [response, options, rawResponse];
445
+ });
377
446
  }
378
447
  updateOccurrence(request, optionsOrCallback, callback) {
379
- var _a;
380
448
  request = request || {};
381
449
  let options;
382
450
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -391,13 +459,26 @@ class GrafeasV1Beta1Client {
391
459
  options.otherArgs.headers = options.otherArgs.headers || {};
392
460
  options.otherArgs.headers['x-goog-request-params'] =
393
461
  this._gaxModule.routingHeader.fromParams({
394
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
462
+ name: request.name ?? '',
395
463
  });
396
- this.initialize();
397
- return this.innerApiCalls.updateOccurrence(request, options, callback);
464
+ this.initialize().catch(err => {
465
+ throw err;
466
+ });
467
+ this._log.info('updateOccurrence request %j', request);
468
+ const wrappedCallback = callback
469
+ ? (error, response, options, rawResponse) => {
470
+ this._log.info('updateOccurrence response %j', response);
471
+ callback(error, response, options, rawResponse); // We verified callback above.
472
+ }
473
+ : undefined;
474
+ return this.innerApiCalls
475
+ .updateOccurrence(request, options, wrappedCallback)
476
+ ?.then(([response, options, rawResponse]) => {
477
+ this._log.info('updateOccurrence response %j', response);
478
+ return [response, options, rawResponse];
479
+ });
398
480
  }
399
481
  getOccurrenceNote(request, optionsOrCallback, callback) {
400
- var _a;
401
482
  request = request || {};
402
483
  let options;
403
484
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -412,13 +493,26 @@ class GrafeasV1Beta1Client {
412
493
  options.otherArgs.headers = options.otherArgs.headers || {};
413
494
  options.otherArgs.headers['x-goog-request-params'] =
414
495
  this._gaxModule.routingHeader.fromParams({
415
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
496
+ name: request.name ?? '',
416
497
  });
417
- this.initialize();
418
- return this.innerApiCalls.getOccurrenceNote(request, options, callback);
498
+ this.initialize().catch(err => {
499
+ throw err;
500
+ });
501
+ this._log.info('getOccurrenceNote request %j', request);
502
+ const wrappedCallback = callback
503
+ ? (error, response, options, rawResponse) => {
504
+ this._log.info('getOccurrenceNote response %j', response);
505
+ callback(error, response, options, rawResponse); // We verified callback above.
506
+ }
507
+ : undefined;
508
+ return this.innerApiCalls
509
+ .getOccurrenceNote(request, options, wrappedCallback)
510
+ ?.then(([response, options, rawResponse]) => {
511
+ this._log.info('getOccurrenceNote response %j', response);
512
+ return [response, options, rawResponse];
513
+ });
419
514
  }
420
515
  getNote(request, optionsOrCallback, callback) {
421
- var _a;
422
516
  request = request || {};
423
517
  let options;
424
518
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -433,13 +527,26 @@ class GrafeasV1Beta1Client {
433
527
  options.otherArgs.headers = options.otherArgs.headers || {};
434
528
  options.otherArgs.headers['x-goog-request-params'] =
435
529
  this._gaxModule.routingHeader.fromParams({
436
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
530
+ name: request.name ?? '',
437
531
  });
438
- this.initialize();
439
- return this.innerApiCalls.getNote(request, options, callback);
532
+ this.initialize().catch(err => {
533
+ throw err;
534
+ });
535
+ this._log.info('getNote request %j', request);
536
+ const wrappedCallback = callback
537
+ ? (error, response, options, rawResponse) => {
538
+ this._log.info('getNote response %j', response);
539
+ callback(error, response, options, rawResponse); // We verified callback above.
540
+ }
541
+ : undefined;
542
+ return this.innerApiCalls
543
+ .getNote(request, options, wrappedCallback)
544
+ ?.then(([response, options, rawResponse]) => {
545
+ this._log.info('getNote response %j', response);
546
+ return [response, options, rawResponse];
547
+ });
440
548
  }
441
549
  deleteNote(request, optionsOrCallback, callback) {
442
- var _a;
443
550
  request = request || {};
444
551
  let options;
445
552
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -454,13 +561,26 @@ class GrafeasV1Beta1Client {
454
561
  options.otherArgs.headers = options.otherArgs.headers || {};
455
562
  options.otherArgs.headers['x-goog-request-params'] =
456
563
  this._gaxModule.routingHeader.fromParams({
457
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
564
+ name: request.name ?? '',
458
565
  });
459
- this.initialize();
460
- return this.innerApiCalls.deleteNote(request, options, callback);
566
+ this.initialize().catch(err => {
567
+ throw err;
568
+ });
569
+ this._log.info('deleteNote request %j', request);
570
+ const wrappedCallback = callback
571
+ ? (error, response, options, rawResponse) => {
572
+ this._log.info('deleteNote response %j', response);
573
+ callback(error, response, options, rawResponse); // We verified callback above.
574
+ }
575
+ : undefined;
576
+ return this.innerApiCalls
577
+ .deleteNote(request, options, wrappedCallback)
578
+ ?.then(([response, options, rawResponse]) => {
579
+ this._log.info('deleteNote response %j', response);
580
+ return [response, options, rawResponse];
581
+ });
461
582
  }
462
583
  createNote(request, optionsOrCallback, callback) {
463
- var _a;
464
584
  request = request || {};
465
585
  let options;
466
586
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -475,13 +595,26 @@ class GrafeasV1Beta1Client {
475
595
  options.otherArgs.headers = options.otherArgs.headers || {};
476
596
  options.otherArgs.headers['x-goog-request-params'] =
477
597
  this._gaxModule.routingHeader.fromParams({
478
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
598
+ parent: request.parent ?? '',
479
599
  });
480
- this.initialize();
481
- return this.innerApiCalls.createNote(request, options, callback);
600
+ this.initialize().catch(err => {
601
+ throw err;
602
+ });
603
+ this._log.info('createNote request %j', request);
604
+ const wrappedCallback = callback
605
+ ? (error, response, options, rawResponse) => {
606
+ this._log.info('createNote response %j', response);
607
+ callback(error, response, options, rawResponse); // We verified callback above.
608
+ }
609
+ : undefined;
610
+ return this.innerApiCalls
611
+ .createNote(request, options, wrappedCallback)
612
+ ?.then(([response, options, rawResponse]) => {
613
+ this._log.info('createNote response %j', response);
614
+ return [response, options, rawResponse];
615
+ });
482
616
  }
483
617
  batchCreateNotes(request, optionsOrCallback, callback) {
484
- var _a;
485
618
  request = request || {};
486
619
  let options;
487
620
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -496,13 +629,26 @@ class GrafeasV1Beta1Client {
496
629
  options.otherArgs.headers = options.otherArgs.headers || {};
497
630
  options.otherArgs.headers['x-goog-request-params'] =
498
631
  this._gaxModule.routingHeader.fromParams({
499
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
632
+ parent: request.parent ?? '',
500
633
  });
501
- this.initialize();
502
- return this.innerApiCalls.batchCreateNotes(request, options, callback);
634
+ this.initialize().catch(err => {
635
+ throw err;
636
+ });
637
+ this._log.info('batchCreateNotes request %j', request);
638
+ const wrappedCallback = callback
639
+ ? (error, response, options, rawResponse) => {
640
+ this._log.info('batchCreateNotes response %j', response);
641
+ callback(error, response, options, rawResponse); // We verified callback above.
642
+ }
643
+ : undefined;
644
+ return this.innerApiCalls
645
+ .batchCreateNotes(request, options, wrappedCallback)
646
+ ?.then(([response, options, rawResponse]) => {
647
+ this._log.info('batchCreateNotes response %j', response);
648
+ return [response, options, rawResponse];
649
+ });
503
650
  }
504
651
  updateNote(request, optionsOrCallback, callback) {
505
- var _a;
506
652
  request = request || {};
507
653
  let options;
508
654
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -517,13 +663,26 @@ class GrafeasV1Beta1Client {
517
663
  options.otherArgs.headers = options.otherArgs.headers || {};
518
664
  options.otherArgs.headers['x-goog-request-params'] =
519
665
  this._gaxModule.routingHeader.fromParams({
520
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
666
+ name: request.name ?? '',
521
667
  });
522
- this.initialize();
523
- return this.innerApiCalls.updateNote(request, options, callback);
668
+ this.initialize().catch(err => {
669
+ throw err;
670
+ });
671
+ this._log.info('updateNote request %j', request);
672
+ const wrappedCallback = callback
673
+ ? (error, response, options, rawResponse) => {
674
+ this._log.info('updateNote response %j', response);
675
+ callback(error, response, options, rawResponse); // We verified callback above.
676
+ }
677
+ : undefined;
678
+ return this.innerApiCalls
679
+ .updateNote(request, options, wrappedCallback)
680
+ ?.then(([response, options, rawResponse]) => {
681
+ this._log.info('updateNote response %j', response);
682
+ return [response, options, rawResponse];
683
+ });
524
684
  }
525
685
  getVulnerabilityOccurrencesSummary(request, optionsOrCallback, callback) {
526
- var _a;
527
686
  request = request || {};
528
687
  let options;
529
688
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -538,13 +697,26 @@ class GrafeasV1Beta1Client {
538
697
  options.otherArgs.headers = options.otherArgs.headers || {};
539
698
  options.otherArgs.headers['x-goog-request-params'] =
540
699
  this._gaxModule.routingHeader.fromParams({
541
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
700
+ parent: request.parent ?? '',
542
701
  });
543
- this.initialize();
544
- return this.innerApiCalls.getVulnerabilityOccurrencesSummary(request, options, callback);
702
+ this.initialize().catch(err => {
703
+ throw err;
704
+ });
705
+ this._log.info('getVulnerabilityOccurrencesSummary request %j', request);
706
+ const wrappedCallback = callback
707
+ ? (error, response, options, rawResponse) => {
708
+ this._log.info('getVulnerabilityOccurrencesSummary response %j', response);
709
+ callback(error, response, options, rawResponse); // We verified callback above.
710
+ }
711
+ : undefined;
712
+ return this.innerApiCalls
713
+ .getVulnerabilityOccurrencesSummary(request, options, wrappedCallback)
714
+ ?.then(([response, options, rawResponse]) => {
715
+ this._log.info('getVulnerabilityOccurrencesSummary response %j', response);
716
+ return [response, options, rawResponse];
717
+ });
545
718
  }
546
719
  listOccurrences(request, optionsOrCallback, callback) {
547
- var _a;
548
720
  request = request || {};
549
721
  let options;
550
722
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -559,13 +731,27 @@ class GrafeasV1Beta1Client {
559
731
  options.otherArgs.headers = options.otherArgs.headers || {};
560
732
  options.otherArgs.headers['x-goog-request-params'] =
561
733
  this._gaxModule.routingHeader.fromParams({
562
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
734
+ parent: request.parent ?? '',
563
735
  });
564
- this.initialize();
565
- return this.innerApiCalls.listOccurrences(request, options, callback);
736
+ this.initialize().catch(err => {
737
+ throw err;
738
+ });
739
+ const wrappedCallback = callback
740
+ ? (error, values, nextPageRequest, rawResponse) => {
741
+ this._log.info('listOccurrences values %j', values);
742
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
743
+ }
744
+ : undefined;
745
+ this._log.info('listOccurrences request %j', request);
746
+ return this.innerApiCalls
747
+ .listOccurrences(request, options, wrappedCallback)
748
+ ?.then(([response, input, output]) => {
749
+ this._log.info('listOccurrences values %j', response);
750
+ return [response, input, output];
751
+ });
566
752
  }
567
753
  /**
568
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
754
+ * Equivalent to `listOccurrences`, but returns a NodeJS Stream object.
569
755
  * @param {Object} request
570
756
  * The request object that will be sent.
571
757
  * @param {string} request.parent
@@ -589,18 +775,20 @@ class GrafeasV1Beta1Client {
589
775
  * for more details and examples.
590
776
  */
591
777
  listOccurrencesStream(request, options) {
592
- var _a;
593
778
  request = request || {};
594
779
  options = options || {};
595
780
  options.otherArgs = options.otherArgs || {};
596
781
  options.otherArgs.headers = options.otherArgs.headers || {};
597
782
  options.otherArgs.headers['x-goog-request-params'] =
598
783
  this._gaxModule.routingHeader.fromParams({
599
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
784
+ parent: request.parent ?? '',
600
785
  });
601
786
  const defaultCallSettings = this._defaults['listOccurrences'];
602
787
  const callSettings = defaultCallSettings.merge(options);
603
- this.initialize();
788
+ this.initialize().catch(err => {
789
+ throw err;
790
+ });
791
+ this._log.info('listOccurrences stream %j', request);
604
792
  return this.descriptors.page.listOccurrences.createStream(this.innerApiCalls.listOccurrences, request, callSettings);
605
793
  }
606
794
  /**
@@ -631,22 +819,23 @@ class GrafeasV1Beta1Client {
631
819
  * region_tag:containeranalysis_v1beta1_generated_GrafeasV1Beta1_ListOccurrences_async
632
820
  */
633
821
  listOccurrencesAsync(request, options) {
634
- var _a;
635
822
  request = request || {};
636
823
  options = options || {};
637
824
  options.otherArgs = options.otherArgs || {};
638
825
  options.otherArgs.headers = options.otherArgs.headers || {};
639
826
  options.otherArgs.headers['x-goog-request-params'] =
640
827
  this._gaxModule.routingHeader.fromParams({
641
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
828
+ parent: request.parent ?? '',
642
829
  });
643
830
  const defaultCallSettings = this._defaults['listOccurrences'];
644
831
  const callSettings = defaultCallSettings.merge(options);
645
- this.initialize();
832
+ this.initialize().catch(err => {
833
+ throw err;
834
+ });
835
+ this._log.info('listOccurrences iterate %j', request);
646
836
  return this.descriptors.page.listOccurrences.asyncIterate(this.innerApiCalls['listOccurrences'], request, callSettings);
647
837
  }
648
838
  listNotes(request, optionsOrCallback, callback) {
649
- var _a;
650
839
  request = request || {};
651
840
  let options;
652
841
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -661,13 +850,27 @@ class GrafeasV1Beta1Client {
661
850
  options.otherArgs.headers = options.otherArgs.headers || {};
662
851
  options.otherArgs.headers['x-goog-request-params'] =
663
852
  this._gaxModule.routingHeader.fromParams({
664
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
853
+ parent: request.parent ?? '',
665
854
  });
666
- this.initialize();
667
- return this.innerApiCalls.listNotes(request, options, callback);
855
+ this.initialize().catch(err => {
856
+ throw err;
857
+ });
858
+ const wrappedCallback = callback
859
+ ? (error, values, nextPageRequest, rawResponse) => {
860
+ this._log.info('listNotes values %j', values);
861
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
862
+ }
863
+ : undefined;
864
+ this._log.info('listNotes request %j', request);
865
+ return this.innerApiCalls
866
+ .listNotes(request, options, wrappedCallback)
867
+ ?.then(([response, input, output]) => {
868
+ this._log.info('listNotes values %j', response);
869
+ return [response, input, output];
870
+ });
668
871
  }
669
872
  /**
670
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
873
+ * Equivalent to `listNotes`, but returns a NodeJS Stream object.
671
874
  * @param {Object} request
672
875
  * The request object that will be sent.
673
876
  * @param {string} request.parent
@@ -691,18 +894,20 @@ class GrafeasV1Beta1Client {
691
894
  * for more details and examples.
692
895
  */
693
896
  listNotesStream(request, options) {
694
- var _a;
695
897
  request = request || {};
696
898
  options = options || {};
697
899
  options.otherArgs = options.otherArgs || {};
698
900
  options.otherArgs.headers = options.otherArgs.headers || {};
699
901
  options.otherArgs.headers['x-goog-request-params'] =
700
902
  this._gaxModule.routingHeader.fromParams({
701
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
903
+ parent: request.parent ?? '',
702
904
  });
703
905
  const defaultCallSettings = this._defaults['listNotes'];
704
906
  const callSettings = defaultCallSettings.merge(options);
705
- this.initialize();
907
+ this.initialize().catch(err => {
908
+ throw err;
909
+ });
910
+ this._log.info('listNotes stream %j', request);
706
911
  return this.descriptors.page.listNotes.createStream(this.innerApiCalls.listNotes, request, callSettings);
707
912
  }
708
913
  /**
@@ -733,22 +938,23 @@ class GrafeasV1Beta1Client {
733
938
  * region_tag:containeranalysis_v1beta1_generated_GrafeasV1Beta1_ListNotes_async
734
939
  */
735
940
  listNotesAsync(request, options) {
736
- var _a;
737
941
  request = request || {};
738
942
  options = options || {};
739
943
  options.otherArgs = options.otherArgs || {};
740
944
  options.otherArgs.headers = options.otherArgs.headers || {};
741
945
  options.otherArgs.headers['x-goog-request-params'] =
742
946
  this._gaxModule.routingHeader.fromParams({
743
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
947
+ parent: request.parent ?? '',
744
948
  });
745
949
  const defaultCallSettings = this._defaults['listNotes'];
746
950
  const callSettings = defaultCallSettings.merge(options);
747
- this.initialize();
951
+ this.initialize().catch(err => {
952
+ throw err;
953
+ });
954
+ this._log.info('listNotes iterate %j', request);
748
955
  return this.descriptors.page.listNotes.asyncIterate(this.innerApiCalls['listNotes'], request, callSettings);
749
956
  }
750
957
  listNoteOccurrences(request, optionsOrCallback, callback) {
751
- var _a;
752
958
  request = request || {};
753
959
  let options;
754
960
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -763,13 +969,27 @@ class GrafeasV1Beta1Client {
763
969
  options.otherArgs.headers = options.otherArgs.headers || {};
764
970
  options.otherArgs.headers['x-goog-request-params'] =
765
971
  this._gaxModule.routingHeader.fromParams({
766
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
972
+ name: request.name ?? '',
767
973
  });
768
- this.initialize();
769
- return this.innerApiCalls.listNoteOccurrences(request, options, callback);
974
+ this.initialize().catch(err => {
975
+ throw err;
976
+ });
977
+ const wrappedCallback = callback
978
+ ? (error, values, nextPageRequest, rawResponse) => {
979
+ this._log.info('listNoteOccurrences values %j', values);
980
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
981
+ }
982
+ : undefined;
983
+ this._log.info('listNoteOccurrences request %j', request);
984
+ return this.innerApiCalls
985
+ .listNoteOccurrences(request, options, wrappedCallback)
986
+ ?.then(([response, input, output]) => {
987
+ this._log.info('listNoteOccurrences values %j', response);
988
+ return [response, input, output];
989
+ });
770
990
  }
771
991
  /**
772
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
992
+ * Equivalent to `listNoteOccurrences`, but returns a NodeJS Stream object.
773
993
  * @param {Object} request
774
994
  * The request object that will be sent.
775
995
  * @param {string} request.name
@@ -793,18 +1013,20 @@ class GrafeasV1Beta1Client {
793
1013
  * for more details and examples.
794
1014
  */
795
1015
  listNoteOccurrencesStream(request, options) {
796
- var _a;
797
1016
  request = request || {};
798
1017
  options = options || {};
799
1018
  options.otherArgs = options.otherArgs || {};
800
1019
  options.otherArgs.headers = options.otherArgs.headers || {};
801
1020
  options.otherArgs.headers['x-goog-request-params'] =
802
1021
  this._gaxModule.routingHeader.fromParams({
803
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1022
+ name: request.name ?? '',
804
1023
  });
805
1024
  const defaultCallSettings = this._defaults['listNoteOccurrences'];
806
1025
  const callSettings = defaultCallSettings.merge(options);
807
- this.initialize();
1026
+ this.initialize().catch(err => {
1027
+ throw err;
1028
+ });
1029
+ this._log.info('listNoteOccurrences stream %j', request);
808
1030
  return this.descriptors.page.listNoteOccurrences.createStream(this.innerApiCalls.listNoteOccurrences, request, callSettings);
809
1031
  }
810
1032
  /**
@@ -835,18 +1057,20 @@ class GrafeasV1Beta1Client {
835
1057
  * region_tag:containeranalysis_v1beta1_generated_GrafeasV1Beta1_ListNoteOccurrences_async
836
1058
  */
837
1059
  listNoteOccurrencesAsync(request, options) {
838
- var _a;
839
1060
  request = request || {};
840
1061
  options = options || {};
841
1062
  options.otherArgs = options.otherArgs || {};
842
1063
  options.otherArgs.headers = options.otherArgs.headers || {};
843
1064
  options.otherArgs.headers['x-goog-request-params'] =
844
1065
  this._gaxModule.routingHeader.fromParams({
845
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1066
+ name: request.name ?? '',
846
1067
  });
847
1068
  const defaultCallSettings = this._defaults['listNoteOccurrences'];
848
1069
  const callSettings = defaultCallSettings.merge(options);
849
- this.initialize();
1070
+ this.initialize().catch(err => {
1071
+ throw err;
1072
+ });
1073
+ this._log.info('listNoteOccurrences iterate %j', request);
850
1074
  return this.descriptors.page.listNoteOccurrences.asyncIterate(this.innerApiCalls['listNoteOccurrences'], request, callSettings);
851
1075
  }
852
1076
  /**
@@ -858,6 +1082,7 @@ class GrafeasV1Beta1Client {
858
1082
  close() {
859
1083
  if (this.grafeasV1Beta1Stub && !this._terminated) {
860
1084
  return this.grafeasV1Beta1Stub.then(stub => {
1085
+ this._log.info('ending gRPC channel');
861
1086
  this._terminated = true;
862
1087
  stub.close();
863
1088
  });