@google-cloud/containeranalysis 6.2.0 → 6.3.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.
@@ -109,26 +109,17 @@ class ContainerAnalysisClient {
109
109
  constructor(opts, gaxInstance) {
110
110
  // Ensure that options include all the required fields.
111
111
  const staticMembers = this.constructor;
112
- if (opts?.universe_domain &&
113
- opts?.universeDomain &&
114
- opts?.universe_domain !== opts?.universeDomain) {
112
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
115
113
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
116
114
  }
117
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
118
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
119
- : undefined;
120
- this._universeDomain =
121
- opts?.universeDomain ??
122
- opts?.universe_domain ??
123
- universeDomainEnvVar ??
124
- 'googleapis.com';
115
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
116
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
125
117
  this._servicePath = 'containeranalysis.' + this._universeDomain;
126
118
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
127
119
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
128
120
  const port = opts?.port || staticMembers.port;
129
121
  const clientConfig = opts?.clientConfig ?? {};
130
- const fallback = opts?.fallback ??
131
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
122
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
132
123
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
133
124
  // Request numeric enum values if REST transport is used.
134
125
  opts.numericEnums = true;
@@ -157,7 +148,10 @@ class ContainerAnalysisClient {
157
148
  this.auth.defaultScopes = staticMembers.scopes;
158
149
  }
159
150
  // Determine the client header string.
160
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
151
+ const clientHeader = [
152
+ `gax/${this._gaxModule.version}`,
153
+ `gapic/${version}`,
154
+ ];
161
155
  if (typeof process === 'object' && 'versions' in process) {
162
156
  clientHeader.push(`gl-node/${process.versions.node}`);
163
157
  }
@@ -210,20 +204,13 @@ class ContainerAnalysisClient {
210
204
  }
211
205
  // Put together the "service stub" for
212
206
  // google.devtools.containeranalysis.v1.ContainerAnalysis.
213
- this.containerAnalysisStub = this._gaxGrpc.createStub(this._opts.fallback
214
- ? this._protos.lookupService('google.devtools.containeranalysis.v1.ContainerAnalysis')
215
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
216
- this._protos.google.devtools.containeranalysis.v1
217
- .ContainerAnalysis, this._opts, this._providedCustomServicePath);
207
+ this.containerAnalysisStub = this._gaxGrpc.createStub(this._opts.fallback ?
208
+ this._protos.lookupService('google.devtools.containeranalysis.v1.ContainerAnalysis') :
209
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
210
+ this._protos.google.devtools.containeranalysis.v1.ContainerAnalysis, this._opts, this._providedCustomServicePath);
218
211
  // Iterate over each of the methods that the service provides
219
212
  // and create an API call method for each.
220
- const containerAnalysisStubMethods = [
221
- 'setIamPolicy',
222
- 'getIamPolicy',
223
- 'testIamPermissions',
224
- 'getVulnerabilityOccurrencesSummary',
225
- 'exportSboM',
226
- ];
213
+ const containerAnalysisStubMethods = ['setIamPolicy', 'getIamPolicy', 'testIamPermissions', 'getVulnerabilityOccurrencesSummary', 'exportSboM'];
227
214
  for (const methodName of containerAnalysisStubMethods) {
228
215
  const callPromise = this.containerAnalysisStub.then(stub => (...args) => {
229
216
  if (this._terminated) {
@@ -246,8 +233,7 @@ class ContainerAnalysisClient {
246
233
  * @returns {string} The DNS address for this service.
247
234
  */
248
235
  static get servicePath() {
249
- if (typeof process === 'object' &&
250
- typeof process.emitWarning === 'function') {
236
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
251
237
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
252
238
  }
253
239
  return 'containeranalysis.googleapis.com';
@@ -258,8 +244,7 @@ class ContainerAnalysisClient {
258
244
  * @returns {string} The DNS address for this service.
259
245
  */
260
246
  static get apiEndpoint() {
261
- if (typeof process === 'object' &&
262
- typeof process.emitWarning === 'function') {
247
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
263
248
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
264
249
  }
265
250
  return 'containeranalysis.googleapis.com';
@@ -287,7 +272,9 @@ class ContainerAnalysisClient {
287
272
  * @returns {string[]} List of default scopes.
288
273
  */
289
274
  static get scopes() {
290
- return ['https://www.googleapis.com/auth/cloud-platform'];
275
+ return [
276
+ 'https://www.googleapis.com/auth/cloud-platform'
277
+ ];
291
278
  }
292
279
  /**
293
280
  * Return the project ID used by this class.
@@ -313,13 +300,10 @@ class ContainerAnalysisClient {
313
300
  options = options || {};
314
301
  options.otherArgs = options.otherArgs || {};
315
302
  options.otherArgs.headers = options.otherArgs.headers || {};
316
- options.otherArgs.headers['x-goog-request-params'] =
317
- this._gaxModule.routingHeader.fromParams({
318
- resource: request.resource ?? '',
319
- });
320
- this.initialize().catch(err => {
321
- throw err;
303
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
304
+ 'resource': request.resource ?? '',
322
305
  });
306
+ this.initialize().catch(err => { throw err; });
323
307
  this._log.info('setIamPolicy request %j', request);
324
308
  const wrappedCallback = callback
325
309
  ? (error, response, options, rawResponse) => {
@@ -327,11 +311,16 @@ class ContainerAnalysisClient {
327
311
  callback(error, response, options, rawResponse); // We verified callback above.
328
312
  }
329
313
  : undefined;
330
- return this.innerApiCalls
331
- .setIamPolicy(request, options, wrappedCallback)
314
+ return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback)
332
315
  ?.then(([response, options, rawResponse]) => {
333
316
  this._log.info('setIamPolicy response %j', response);
334
317
  return [response, options, rawResponse];
318
+ }).catch((error) => {
319
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
320
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
321
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
322
+ }
323
+ throw error;
335
324
  });
336
325
  }
337
326
  getIamPolicy(request, optionsOrCallback, callback) {
@@ -347,13 +336,10 @@ class ContainerAnalysisClient {
347
336
  options = options || {};
348
337
  options.otherArgs = options.otherArgs || {};
349
338
  options.otherArgs.headers = options.otherArgs.headers || {};
350
- options.otherArgs.headers['x-goog-request-params'] =
351
- this._gaxModule.routingHeader.fromParams({
352
- resource: request.resource ?? '',
353
- });
354
- this.initialize().catch(err => {
355
- throw err;
339
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
340
+ 'resource': request.resource ?? '',
356
341
  });
342
+ this.initialize().catch(err => { throw err; });
357
343
  this._log.info('getIamPolicy request %j', request);
358
344
  const wrappedCallback = callback
359
345
  ? (error, response, options, rawResponse) => {
@@ -361,11 +347,16 @@ class ContainerAnalysisClient {
361
347
  callback(error, response, options, rawResponse); // We verified callback above.
362
348
  }
363
349
  : undefined;
364
- return this.innerApiCalls
365
- .getIamPolicy(request, options, wrappedCallback)
350
+ return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback)
366
351
  ?.then(([response, options, rawResponse]) => {
367
352
  this._log.info('getIamPolicy response %j', response);
368
353
  return [response, options, rawResponse];
354
+ }).catch((error) => {
355
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
356
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
357
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
358
+ }
359
+ throw error;
369
360
  });
370
361
  }
371
362
  testIamPermissions(request, optionsOrCallback, callback) {
@@ -381,13 +372,10 @@ class ContainerAnalysisClient {
381
372
  options = options || {};
382
373
  options.otherArgs = options.otherArgs || {};
383
374
  options.otherArgs.headers = options.otherArgs.headers || {};
384
- options.otherArgs.headers['x-goog-request-params'] =
385
- this._gaxModule.routingHeader.fromParams({
386
- resource: request.resource ?? '',
387
- });
388
- this.initialize().catch(err => {
389
- throw err;
375
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
376
+ 'resource': request.resource ?? '',
390
377
  });
378
+ this.initialize().catch(err => { throw err; });
391
379
  this._log.info('testIamPermissions request %j', request);
392
380
  const wrappedCallback = callback
393
381
  ? (error, response, options, rawResponse) => {
@@ -395,11 +383,16 @@ class ContainerAnalysisClient {
395
383
  callback(error, response, options, rawResponse); // We verified callback above.
396
384
  }
397
385
  : undefined;
398
- return this.innerApiCalls
399
- .testIamPermissions(request, options, wrappedCallback)
386
+ return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback)
400
387
  ?.then(([response, options, rawResponse]) => {
401
388
  this._log.info('testIamPermissions response %j', response);
402
389
  return [response, options, rawResponse];
390
+ }).catch((error) => {
391
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
392
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
393
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
394
+ }
395
+ throw error;
403
396
  });
404
397
  }
405
398
  getVulnerabilityOccurrencesSummary(request, optionsOrCallback, callback) {
@@ -415,13 +408,10 @@ class ContainerAnalysisClient {
415
408
  options = options || {};
416
409
  options.otherArgs = options.otherArgs || {};
417
410
  options.otherArgs.headers = options.otherArgs.headers || {};
418
- options.otherArgs.headers['x-goog-request-params'] =
419
- this._gaxModule.routingHeader.fromParams({
420
- parent: request.parent ?? '',
421
- });
422
- this.initialize().catch(err => {
423
- throw err;
411
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
412
+ 'parent': request.parent ?? '',
424
413
  });
414
+ this.initialize().catch(err => { throw err; });
425
415
  this._log.info('getVulnerabilityOccurrencesSummary request %j', request);
426
416
  const wrappedCallback = callback
427
417
  ? (error, response, options, rawResponse) => {
@@ -429,11 +419,16 @@ class ContainerAnalysisClient {
429
419
  callback(error, response, options, rawResponse); // We verified callback above.
430
420
  }
431
421
  : undefined;
432
- return this.innerApiCalls
433
- .getVulnerabilityOccurrencesSummary(request, options, wrappedCallback)
422
+ return this.innerApiCalls.getVulnerabilityOccurrencesSummary(request, options, wrappedCallback)
434
423
  ?.then(([response, options, rawResponse]) => {
435
424
  this._log.info('getVulnerabilityOccurrencesSummary response %j', response);
436
425
  return [response, options, rawResponse];
426
+ }).catch((error) => {
427
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
428
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
429
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
430
+ }
431
+ throw error;
437
432
  });
438
433
  }
439
434
  exportSBOM(request, optionsOrCallback, callback) {
@@ -449,13 +444,10 @@ class ContainerAnalysisClient {
449
444
  options = options || {};
450
445
  options.otherArgs = options.otherArgs || {};
451
446
  options.otherArgs.headers = options.otherArgs.headers || {};
452
- options.otherArgs.headers['x-goog-request-params'] =
453
- this._gaxModule.routingHeader.fromParams({
454
- name: request.name ?? '',
455
- });
456
- this.initialize().catch(err => {
457
- throw err;
447
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
448
+ 'name': request.name ?? '',
458
449
  });
450
+ this.initialize().catch(err => { throw err; });
459
451
  this._log.info('exportSBOM request %j', request);
460
452
  const wrappedCallback = callback
461
453
  ? (error, response, options, rawResponse) => {
@@ -463,11 +455,16 @@ class ContainerAnalysisClient {
463
455
  callback(error, response, options, rawResponse); // We verified callback above.
464
456
  }
465
457
  : undefined;
466
- return this.innerApiCalls
467
- .exportSboM(request, options, wrappedCallback)
458
+ return this.innerApiCalls.exportSboM(request, options, wrappedCallback)
468
459
  ?.then(([response, options, rawResponse]) => {
469
460
  this._log.info('exportSBOM response %j', response);
470
461
  return [response, options, rawResponse];
462
+ }).catch((error) => {
463
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
464
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
465
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
466
+ }
467
+ throw error;
471
468
  });
472
469
  }
473
470
  // --------------------
@@ -527,8 +524,7 @@ class ContainerAnalysisClient {
527
524
  * @returns {string} A string representing the project.
528
525
  */
529
526
  matchProjectFromOccurrenceName(occurrenceName) {
530
- return this.pathTemplates.occurrencePathTemplate.match(occurrenceName)
531
- .project;
527
+ return this.pathTemplates.occurrencePathTemplate.match(occurrenceName).project;
532
528
  }
533
529
  /**
534
530
  * Parse the occurrence from Occurrence resource.
@@ -538,8 +534,7 @@ class ContainerAnalysisClient {
538
534
  * @returns {string} A string representing the occurrence.
539
535
  */
540
536
  matchOccurrenceFromOccurrenceName(occurrenceName) {
541
- return this.pathTemplates.occurrencePathTemplate.match(occurrenceName)
542
- .occurrence;
537
+ return this.pathTemplates.occurrencePathTemplate.match(occurrenceName).occurrence;
543
538
  }
544
539
  /**
545
540
  * Return a fully-qualified project resource name string.
@@ -579,14 +574,14 @@ class ContainerAnalysisClient {
579
574
  return Promise.resolve();
580
575
  }
581
576
  /**
582
- * Returns an instance of a @google-cloud/grafeas client, configured to
583
- * connect to Google Cloud's Container Analysis API. For documentation
584
- * on this client, see:
585
- * <a href="https://googleapis.dev/nodejs/grafeas/latest/index.html">https://googleapis.dev/nodejs/grafeas/latest/index.html</a>
586
- *
587
- * @returns {GrafeasClient} - An instance of a Grafeas client.
588
- *
589
- */
577
+ * Returns an instance of a @google-cloud/grafeas client, configured to
578
+ * connect to Google Cloud's Container Analysis API. For documentation
579
+ * on this client, see:
580
+ * <a href="https://googleapis.dev/nodejs/grafeas/latest/index.html">https://googleapis.dev/nodejs/grafeas/latest/index.html</a>
581
+ *
582
+ * @returns {GrafeasClient} - An instance of a Grafeas client.
583
+ *
584
+ */
590
585
  getGrafeasClient() {
591
586
  return new grafeas_1.GrafeasClient(this._opts);
592
587
  }
@@ -15,6 +15,7 @@
15
15
  "../../protos/grafeas/v1/package.proto",
16
16
  "../../protos/grafeas/v1/provenance.proto",
17
17
  "../../protos/grafeas/v1/sbom.proto",
18
+ "../../protos/grafeas/v1/secret.proto",
18
19
  "../../protos/grafeas/v1/severity.proto",
19
20
  "../../protos/grafeas/v1/slsa_provenance.proto",
20
21
  "../../protos/grafeas/v1/slsa_provenance_zero_two.proto",
@@ -15,6 +15,7 @@
15
15
  "../../protos/grafeas/v1/package.proto",
16
16
  "../../protos/grafeas/v1/provenance.proto",
17
17
  "../../protos/grafeas/v1/sbom.proto",
18
+ "../../protos/grafeas/v1/secret.proto",
18
19
  "../../protos/grafeas/v1/severity.proto",
19
20
  "../../protos/grafeas/v1/slsa_provenance.proto",
20
21
  "../../protos/grafeas/v1/slsa_provenance_zero_two.proto",
@@ -253,7 +253,7 @@ export declare class ContainerAnalysisV1Beta1Client {
253
253
  */
254
254
  generatePackagesSummary(request?: protos.google.devtools.containeranalysis.v1beta1.IGeneratePackagesSummaryRequest, options?: CallOptions): Promise<[
255
255
  protos.google.devtools.containeranalysis.v1beta1.IPackagesSummaryResponse,
256
- (protos.google.devtools.containeranalysis.v1beta1.IGeneratePackagesSummaryRequest | undefined),
256
+ protos.google.devtools.containeranalysis.v1beta1.IGeneratePackagesSummaryRequest | undefined,
257
257
  {} | undefined
258
258
  ]>;
259
259
  generatePackagesSummary(request: protos.google.devtools.containeranalysis.v1beta1.IGeneratePackagesSummaryRequest, options: CallOptions, callback: Callback<protos.google.devtools.containeranalysis.v1beta1.IPackagesSummaryResponse, protos.google.devtools.containeranalysis.v1beta1.IGeneratePackagesSummaryRequest | null | undefined, {} | null | undefined>): void;
@@ -277,7 +277,7 @@ export declare class ContainerAnalysisV1Beta1Client {
277
277
  */
278
278
  exportSBOM(request?: protos.google.devtools.containeranalysis.v1beta1.IExportSBOMRequest, options?: CallOptions): Promise<[
279
279
  protos.google.devtools.containeranalysis.v1beta1.IExportSBOMResponse,
280
- (protos.google.devtools.containeranalysis.v1beta1.IExportSBOMRequest | undefined),
280
+ protos.google.devtools.containeranalysis.v1beta1.IExportSBOMRequest | undefined,
281
281
  {} | undefined
282
282
  ]>;
283
283
  exportSBOM(request: protos.google.devtools.containeranalysis.v1beta1.IExportSBOMRequest, options: CallOptions, callback: Callback<protos.google.devtools.containeranalysis.v1beta1.IExportSBOMResponse, protos.google.devtools.containeranalysis.v1beta1.IExportSBOMRequest | null | undefined, {} | null | undefined>): void;
@@ -106,28 +106,18 @@ class ContainerAnalysisV1Beta1Client {
106
106
  */
107
107
  constructor(opts, gaxInstance) {
108
108
  // Ensure that options include all the required fields.
109
- const staticMembers = this
110
- .constructor;
111
- if (opts?.universe_domain &&
112
- opts?.universeDomain &&
113
- opts?.universe_domain !== opts?.universeDomain) {
109
+ const staticMembers = this.constructor;
110
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
114
111
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
115
112
  }
116
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
117
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
118
- : undefined;
119
- this._universeDomain =
120
- opts?.universeDomain ??
121
- opts?.universe_domain ??
122
- universeDomainEnvVar ??
123
- 'googleapis.com';
113
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
114
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
124
115
  this._servicePath = 'containeranalysis.' + this._universeDomain;
125
116
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
126
117
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
127
118
  const port = opts?.port || staticMembers.port;
128
119
  const clientConfig = opts?.clientConfig ?? {};
129
- const fallback = opts?.fallback ??
130
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
120
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
131
121
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
132
122
  // Request numeric enum values if REST transport is used.
133
123
  opts.numericEnums = true;
@@ -156,7 +146,10 @@ class ContainerAnalysisV1Beta1Client {
156
146
  this.auth.defaultScopes = staticMembers.scopes;
157
147
  }
158
148
  // Determine the client header string.
159
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
149
+ const clientHeader = [
150
+ `gax/${this._gaxModule.version}`,
151
+ `gapic/${version}`,
152
+ ];
160
153
  if (typeof process === 'object' && 'versions' in process) {
161
154
  clientHeader.push(`gl-node/${process.versions.node}`);
162
155
  }
@@ -201,20 +194,13 @@ class ContainerAnalysisV1Beta1Client {
201
194
  }
202
195
  // Put together the "service stub" for
203
196
  // google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1.
204
- this.containerAnalysisV1Beta1Stub = this._gaxGrpc.createStub(this._opts.fallback
205
- ? this._protos.lookupService('google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1')
206
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
207
- this._protos.google.devtools.containeranalysis.v1beta1
208
- .ContainerAnalysisV1Beta1, this._opts, this._providedCustomServicePath);
197
+ this.containerAnalysisV1Beta1Stub = this._gaxGrpc.createStub(this._opts.fallback ?
198
+ this._protos.lookupService('google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1') :
199
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
200
+ this._protos.google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1, this._opts, this._providedCustomServicePath);
209
201
  // Iterate over each of the methods that the service provides
210
202
  // and create an API call method for each.
211
- const containerAnalysisV1Beta1StubMethods = [
212
- 'setIamPolicy',
213
- 'getIamPolicy',
214
- 'testIamPermissions',
215
- 'generatePackagesSummary',
216
- 'exportSboM',
217
- ];
203
+ const containerAnalysisV1Beta1StubMethods = ['setIamPolicy', 'getIamPolicy', 'testIamPermissions', 'generatePackagesSummary', 'exportSboM'];
218
204
  for (const methodName of containerAnalysisV1Beta1StubMethods) {
219
205
  const callPromise = this.containerAnalysisV1Beta1Stub.then(stub => (...args) => {
220
206
  if (this._terminated) {
@@ -237,8 +223,7 @@ class ContainerAnalysisV1Beta1Client {
237
223
  * @returns {string} The DNS address for this service.
238
224
  */
239
225
  static get servicePath() {
240
- if (typeof process === 'object' &&
241
- typeof process.emitWarning === 'function') {
226
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
242
227
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
243
228
  }
244
229
  return 'containeranalysis.googleapis.com';
@@ -249,8 +234,7 @@ class ContainerAnalysisV1Beta1Client {
249
234
  * @returns {string} The DNS address for this service.
250
235
  */
251
236
  static get apiEndpoint() {
252
- if (typeof process === 'object' &&
253
- typeof process.emitWarning === 'function') {
237
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
254
238
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
255
239
  }
256
240
  return 'containeranalysis.googleapis.com';
@@ -278,7 +262,9 @@ class ContainerAnalysisV1Beta1Client {
278
262
  * @returns {string[]} List of default scopes.
279
263
  */
280
264
  static get scopes() {
281
- return ['https://www.googleapis.com/auth/cloud-platform'];
265
+ return [
266
+ 'https://www.googleapis.com/auth/cloud-platform'
267
+ ];
282
268
  }
283
269
  /**
284
270
  * Return the project ID used by this class.
@@ -304,13 +290,10 @@ class ContainerAnalysisV1Beta1Client {
304
290
  options = options || {};
305
291
  options.otherArgs = options.otherArgs || {};
306
292
  options.otherArgs.headers = options.otherArgs.headers || {};
307
- options.otherArgs.headers['x-goog-request-params'] =
308
- this._gaxModule.routingHeader.fromParams({
309
- resource: request.resource ?? '',
310
- });
311
- this.initialize().catch(err => {
312
- throw err;
293
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
294
+ 'resource': request.resource ?? '',
313
295
  });
296
+ this.initialize().catch(err => { throw err; });
314
297
  this._log.info('setIamPolicy request %j', request);
315
298
  const wrappedCallback = callback
316
299
  ? (error, response, options, rawResponse) => {
@@ -318,11 +301,16 @@ class ContainerAnalysisV1Beta1Client {
318
301
  callback(error, response, options, rawResponse); // We verified callback above.
319
302
  }
320
303
  : undefined;
321
- return this.innerApiCalls
322
- .setIamPolicy(request, options, wrappedCallback)
304
+ return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback)
323
305
  ?.then(([response, options, rawResponse]) => {
324
306
  this._log.info('setIamPolicy response %j', response);
325
307
  return [response, options, rawResponse];
308
+ }).catch((error) => {
309
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
310
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
311
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
312
+ }
313
+ throw error;
326
314
  });
327
315
  }
328
316
  getIamPolicy(request, optionsOrCallback, callback) {
@@ -338,13 +326,10 @@ class ContainerAnalysisV1Beta1Client {
338
326
  options = options || {};
339
327
  options.otherArgs = options.otherArgs || {};
340
328
  options.otherArgs.headers = options.otherArgs.headers || {};
341
- options.otherArgs.headers['x-goog-request-params'] =
342
- this._gaxModule.routingHeader.fromParams({
343
- resource: request.resource ?? '',
344
- });
345
- this.initialize().catch(err => {
346
- throw err;
329
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
330
+ 'resource': request.resource ?? '',
347
331
  });
332
+ this.initialize().catch(err => { throw err; });
348
333
  this._log.info('getIamPolicy request %j', request);
349
334
  const wrappedCallback = callback
350
335
  ? (error, response, options, rawResponse) => {
@@ -352,11 +337,16 @@ class ContainerAnalysisV1Beta1Client {
352
337
  callback(error, response, options, rawResponse); // We verified callback above.
353
338
  }
354
339
  : undefined;
355
- return this.innerApiCalls
356
- .getIamPolicy(request, options, wrappedCallback)
340
+ return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback)
357
341
  ?.then(([response, options, rawResponse]) => {
358
342
  this._log.info('getIamPolicy response %j', response);
359
343
  return [response, options, rawResponse];
344
+ }).catch((error) => {
345
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
346
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
347
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
348
+ }
349
+ throw error;
360
350
  });
361
351
  }
362
352
  testIamPermissions(request, optionsOrCallback, callback) {
@@ -372,13 +362,10 @@ class ContainerAnalysisV1Beta1Client {
372
362
  options = options || {};
373
363
  options.otherArgs = options.otherArgs || {};
374
364
  options.otherArgs.headers = options.otherArgs.headers || {};
375
- options.otherArgs.headers['x-goog-request-params'] =
376
- this._gaxModule.routingHeader.fromParams({
377
- resource: request.resource ?? '',
378
- });
379
- this.initialize().catch(err => {
380
- throw err;
365
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
366
+ 'resource': request.resource ?? '',
381
367
  });
368
+ this.initialize().catch(err => { throw err; });
382
369
  this._log.info('testIamPermissions request %j', request);
383
370
  const wrappedCallback = callback
384
371
  ? (error, response, options, rawResponse) => {
@@ -386,11 +373,16 @@ class ContainerAnalysisV1Beta1Client {
386
373
  callback(error, response, options, rawResponse); // We verified callback above.
387
374
  }
388
375
  : undefined;
389
- return this.innerApiCalls
390
- .testIamPermissions(request, options, wrappedCallback)
376
+ return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback)
391
377
  ?.then(([response, options, rawResponse]) => {
392
378
  this._log.info('testIamPermissions response %j', response);
393
379
  return [response, options, rawResponse];
380
+ }).catch((error) => {
381
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
382
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
383
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
384
+ }
385
+ throw error;
394
386
  });
395
387
  }
396
388
  generatePackagesSummary(request, optionsOrCallback, callback) {
@@ -406,13 +398,10 @@ class ContainerAnalysisV1Beta1Client {
406
398
  options = options || {};
407
399
  options.otherArgs = options.otherArgs || {};
408
400
  options.otherArgs.headers = options.otherArgs.headers || {};
409
- options.otherArgs.headers['x-goog-request-params'] =
410
- this._gaxModule.routingHeader.fromParams({
411
- name: request.name ?? '',
412
- });
413
- this.initialize().catch(err => {
414
- throw err;
401
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
402
+ 'name': request.name ?? '',
415
403
  });
404
+ this.initialize().catch(err => { throw err; });
416
405
  this._log.info('generatePackagesSummary request %j', request);
417
406
  const wrappedCallback = callback
418
407
  ? (error, response, options, rawResponse) => {
@@ -420,11 +409,16 @@ class ContainerAnalysisV1Beta1Client {
420
409
  callback(error, response, options, rawResponse); // We verified callback above.
421
410
  }
422
411
  : undefined;
423
- return this.innerApiCalls
424
- .generatePackagesSummary(request, options, wrappedCallback)
412
+ return this.innerApiCalls.generatePackagesSummary(request, options, wrappedCallback)
425
413
  ?.then(([response, options, rawResponse]) => {
426
414
  this._log.info('generatePackagesSummary response %j', response);
427
415
  return [response, options, rawResponse];
416
+ }).catch((error) => {
417
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
418
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
419
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
420
+ }
421
+ throw error;
428
422
  });
429
423
  }
430
424
  exportSBOM(request, optionsOrCallback, callback) {
@@ -440,13 +434,10 @@ class ContainerAnalysisV1Beta1Client {
440
434
  options = options || {};
441
435
  options.otherArgs = options.otherArgs || {};
442
436
  options.otherArgs.headers = options.otherArgs.headers || {};
443
- options.otherArgs.headers['x-goog-request-params'] =
444
- this._gaxModule.routingHeader.fromParams({
445
- name: request.name ?? '',
446
- });
447
- this.initialize().catch(err => {
448
- throw err;
437
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
438
+ 'name': request.name ?? '',
449
439
  });
440
+ this.initialize().catch(err => { throw err; });
450
441
  this._log.info('exportSBOM request %j', request);
451
442
  const wrappedCallback = callback
452
443
  ? (error, response, options, rawResponse) => {
@@ -454,11 +445,16 @@ class ContainerAnalysisV1Beta1Client {
454
445
  callback(error, response, options, rawResponse); // We verified callback above.
455
446
  }
456
447
  : undefined;
457
- return this.innerApiCalls
458
- .exportSboM(request, options, wrappedCallback)
448
+ return this.innerApiCalls.exportSboM(request, options, wrappedCallback)
459
449
  ?.then(([response, options, rawResponse]) => {
460
450
  this._log.info('exportSBOM response %j', response);
461
451
  return [response, options, rawResponse];
452
+ }).catch((error) => {
453
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
454
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
455
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
456
+ }
457
+ throw error;
462
458
  });
463
459
  }
464
460
  /**