@google-cloud/containeranalysis 6.7.2 → 6.8.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.
- package/README.md +2 -4
- package/build/protos/protos.d.ts +518 -4
- package/build/protos/protos.js +8057 -2686
- package/build/protos/protos.json +203 -25
- package/build/src/v1/container_analysis_client.d.ts +2 -2
- package/build/src/v1/container_analysis_client.js +102 -52
- package/build/src/v1beta1/container_analysis_v1_beta1_client.d.ts +2 -2
- package/build/src/v1beta1/container_analysis_v1_beta1_client.js +100 -51
- package/build/src/v1beta1/grafeas_v1_beta1_client.d.ts +78 -78
- package/build/src/v1beta1/grafeas_v1_beta1_client.js +261 -128
- package/package.json +1 -1
|
@@ -108,17 +108,26 @@ class GrafeasV1Beta1Client {
|
|
|
108
108
|
constructor(opts, gaxInstance) {
|
|
109
109
|
// Ensure that options include all the required fields.
|
|
110
110
|
const staticMembers = this.constructor;
|
|
111
|
-
if (opts?.universe_domain &&
|
|
111
|
+
if (opts?.universe_domain &&
|
|
112
|
+
opts?.universeDomain &&
|
|
113
|
+
opts?.universe_domain !== opts?.universeDomain) {
|
|
112
114
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
113
115
|
}
|
|
114
|
-
const universeDomainEnvVar =
|
|
115
|
-
|
|
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';
|
|
116
124
|
this._servicePath = 'containeranalysis.' + this._universeDomain;
|
|
117
125
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
|
118
126
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
|
119
127
|
const port = opts?.port || staticMembers.port;
|
|
120
128
|
const clientConfig = opts?.clientConfig ?? {};
|
|
121
|
-
const fallback = opts?.fallback ??
|
|
129
|
+
const fallback = opts?.fallback ??
|
|
130
|
+
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
|
122
131
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
123
132
|
// Request numeric enum values if REST transport is used.
|
|
124
133
|
opts.numericEnums = true;
|
|
@@ -147,10 +156,7 @@ class GrafeasV1Beta1Client {
|
|
|
147
156
|
this.auth.defaultScopes = staticMembers.scopes;
|
|
148
157
|
}
|
|
149
158
|
// Determine the client header string.
|
|
150
|
-
const clientHeader = [
|
|
151
|
-
`gax/${this._gaxModule.version}`,
|
|
152
|
-
`gapic/${version}`,
|
|
153
|
-
];
|
|
159
|
+
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
|
|
154
160
|
if (typeof process === 'object' && 'versions' in process) {
|
|
155
161
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
|
156
162
|
}
|
|
@@ -174,7 +180,7 @@ class GrafeasV1Beta1Client {
|
|
|
174
180
|
this.descriptors.page = {
|
|
175
181
|
listOccurrences: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'occurrences'),
|
|
176
182
|
listNotes: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'notes'),
|
|
177
|
-
listNoteOccurrences: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'occurrences')
|
|
183
|
+
listNoteOccurrences: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'occurrences'),
|
|
178
184
|
};
|
|
179
185
|
// Put together the default options sent with requests.
|
|
180
186
|
this._defaults = this._gaxGrpc.constructSettings('grafeas.v1beta1.GrafeasV1Beta1', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
|
@@ -203,15 +209,32 @@ class GrafeasV1Beta1Client {
|
|
|
203
209
|
}
|
|
204
210
|
// Put together the "service stub" for
|
|
205
211
|
// grafeas.v1beta1.GrafeasV1Beta1.
|
|
206
|
-
this.grafeasV1Beta1Stub = this._gaxGrpc.createStub(this._opts.fallback
|
|
207
|
-
this._protos.lookupService('grafeas.v1beta1.GrafeasV1Beta1')
|
|
208
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
209
|
-
|
|
212
|
+
this.grafeasV1Beta1Stub = this._gaxGrpc.createStub(this._opts.fallback
|
|
213
|
+
? this._protos.lookupService('grafeas.v1beta1.GrafeasV1Beta1')
|
|
214
|
+
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
215
|
+
this._protos.grafeas.v1beta1
|
|
216
|
+
.GrafeasV1Beta1, this._opts, this._providedCustomServicePath);
|
|
210
217
|
// Iterate over each of the methods that the service provides
|
|
211
218
|
// and create an API call method for each.
|
|
212
|
-
const grafeasV1Beta1StubMethods = [
|
|
219
|
+
const grafeasV1Beta1StubMethods = [
|
|
220
|
+
'getOccurrence',
|
|
221
|
+
'listOccurrences',
|
|
222
|
+
'deleteOccurrence',
|
|
223
|
+
'createOccurrence',
|
|
224
|
+
'batchCreateOccurrences',
|
|
225
|
+
'updateOccurrence',
|
|
226
|
+
'getOccurrenceNote',
|
|
227
|
+
'getNote',
|
|
228
|
+
'listNotes',
|
|
229
|
+
'deleteNote',
|
|
230
|
+
'createNote',
|
|
231
|
+
'batchCreateNotes',
|
|
232
|
+
'updateNote',
|
|
233
|
+
'listNoteOccurrences',
|
|
234
|
+
'getVulnerabilityOccurrencesSummary',
|
|
235
|
+
];
|
|
213
236
|
for (const methodName of grafeasV1Beta1StubMethods) {
|
|
214
|
-
const callPromise = this.grafeasV1Beta1Stub.then(stub => (...args) => {
|
|
237
|
+
const callPromise = this.grafeasV1Beta1Stub.then((stub) => (...args) => {
|
|
215
238
|
if (this._terminated) {
|
|
216
239
|
return Promise.reject('The client has already been closed.');
|
|
217
240
|
}
|
|
@@ -220,8 +243,7 @@ class GrafeasV1Beta1Client {
|
|
|
220
243
|
}, (err) => () => {
|
|
221
244
|
throw err;
|
|
222
245
|
});
|
|
223
|
-
const descriptor = this.descriptors.page[methodName] ||
|
|
224
|
-
undefined;
|
|
246
|
+
const descriptor = this.descriptors.page[methodName] || undefined;
|
|
225
247
|
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
|
|
226
248
|
this.innerApiCalls[methodName] = apiCall;
|
|
227
249
|
}
|
|
@@ -233,7 +255,8 @@ class GrafeasV1Beta1Client {
|
|
|
233
255
|
* @returns {string} The DNS address for this service.
|
|
234
256
|
*/
|
|
235
257
|
static get servicePath() {
|
|
236
|
-
if (typeof process === 'object' &&
|
|
258
|
+
if (typeof process === 'object' &&
|
|
259
|
+
typeof process.emitWarning === 'function') {
|
|
237
260
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
238
261
|
}
|
|
239
262
|
return 'containeranalysis.googleapis.com';
|
|
@@ -244,7 +267,8 @@ class GrafeasV1Beta1Client {
|
|
|
244
267
|
* @returns {string} The DNS address for this service.
|
|
245
268
|
*/
|
|
246
269
|
static get apiEndpoint() {
|
|
247
|
-
if (typeof process === 'object' &&
|
|
270
|
+
if (typeof process === 'object' &&
|
|
271
|
+
typeof process.emitWarning === 'function') {
|
|
248
272
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
249
273
|
}
|
|
250
274
|
return 'containeranalysis.googleapis.com';
|
|
@@ -272,9 +296,7 @@ class GrafeasV1Beta1Client {
|
|
|
272
296
|
* @returns {string[]} List of default scopes.
|
|
273
297
|
*/
|
|
274
298
|
static get scopes() {
|
|
275
|
-
return [
|
|
276
|
-
'https://www.googleapis.com/auth/cloud-platform'
|
|
277
|
-
];
|
|
299
|
+
return ['https://www.googleapis.com/auth/cloud-platform'];
|
|
278
300
|
}
|
|
279
301
|
/**
|
|
280
302
|
* Return the project ID used by this class.
|
|
@@ -300,10 +322,13 @@ class GrafeasV1Beta1Client {
|
|
|
300
322
|
options = options || {};
|
|
301
323
|
options.otherArgs = options.otherArgs || {};
|
|
302
324
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
303
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
304
|
-
|
|
325
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
326
|
+
this._gaxModule.routingHeader.fromParams({
|
|
327
|
+
name: request.name ?? '',
|
|
328
|
+
});
|
|
329
|
+
this.initialize().catch((err) => {
|
|
330
|
+
throw err;
|
|
305
331
|
});
|
|
306
|
-
this.initialize().catch(err => { throw err; });
|
|
307
332
|
this._log.info('getOccurrence request %j', request);
|
|
308
333
|
const wrappedCallback = callback
|
|
309
334
|
? (error, response, options, rawResponse) => {
|
|
@@ -311,12 +336,16 @@ class GrafeasV1Beta1Client {
|
|
|
311
336
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
312
337
|
}
|
|
313
338
|
: undefined;
|
|
314
|
-
return this.innerApiCalls
|
|
339
|
+
return this.innerApiCalls
|
|
340
|
+
.getOccurrence(request, options, wrappedCallback)
|
|
315
341
|
?.then(([response, options, rawResponse]) => {
|
|
316
342
|
this._log.info('getOccurrence response %j', response);
|
|
317
343
|
return [response, options, rawResponse];
|
|
318
|
-
})
|
|
319
|
-
|
|
344
|
+
})
|
|
345
|
+
.catch((error) => {
|
|
346
|
+
if (error &&
|
|
347
|
+
'statusDetails' in error &&
|
|
348
|
+
error.statusDetails instanceof Array) {
|
|
320
349
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
321
350
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
322
351
|
}
|
|
@@ -336,10 +365,13 @@ class GrafeasV1Beta1Client {
|
|
|
336
365
|
options = options || {};
|
|
337
366
|
options.otherArgs = options.otherArgs || {};
|
|
338
367
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
339
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
340
|
-
|
|
368
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
369
|
+
this._gaxModule.routingHeader.fromParams({
|
|
370
|
+
name: request.name ?? '',
|
|
371
|
+
});
|
|
372
|
+
this.initialize().catch((err) => {
|
|
373
|
+
throw err;
|
|
341
374
|
});
|
|
342
|
-
this.initialize().catch(err => { throw err; });
|
|
343
375
|
this._log.info('deleteOccurrence request %j', request);
|
|
344
376
|
const wrappedCallback = callback
|
|
345
377
|
? (error, response, options, rawResponse) => {
|
|
@@ -347,12 +379,16 @@ class GrafeasV1Beta1Client {
|
|
|
347
379
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
348
380
|
}
|
|
349
381
|
: undefined;
|
|
350
|
-
return this.innerApiCalls
|
|
382
|
+
return this.innerApiCalls
|
|
383
|
+
.deleteOccurrence(request, options, wrappedCallback)
|
|
351
384
|
?.then(([response, options, rawResponse]) => {
|
|
352
385
|
this._log.info('deleteOccurrence response %j', response);
|
|
353
386
|
return [response, options, rawResponse];
|
|
354
|
-
})
|
|
355
|
-
|
|
387
|
+
})
|
|
388
|
+
.catch((error) => {
|
|
389
|
+
if (error &&
|
|
390
|
+
'statusDetails' in error &&
|
|
391
|
+
error.statusDetails instanceof Array) {
|
|
356
392
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
357
393
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
358
394
|
}
|
|
@@ -372,10 +408,13 @@ class GrafeasV1Beta1Client {
|
|
|
372
408
|
options = options || {};
|
|
373
409
|
options.otherArgs = options.otherArgs || {};
|
|
374
410
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
375
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
376
|
-
|
|
411
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
412
|
+
this._gaxModule.routingHeader.fromParams({
|
|
413
|
+
parent: request.parent ?? '',
|
|
414
|
+
});
|
|
415
|
+
this.initialize().catch((err) => {
|
|
416
|
+
throw err;
|
|
377
417
|
});
|
|
378
|
-
this.initialize().catch(err => { throw err; });
|
|
379
418
|
this._log.info('createOccurrence request %j', request);
|
|
380
419
|
const wrappedCallback = callback
|
|
381
420
|
? (error, response, options, rawResponse) => {
|
|
@@ -383,12 +422,16 @@ class GrafeasV1Beta1Client {
|
|
|
383
422
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
384
423
|
}
|
|
385
424
|
: undefined;
|
|
386
|
-
return this.innerApiCalls
|
|
425
|
+
return this.innerApiCalls
|
|
426
|
+
.createOccurrence(request, options, wrappedCallback)
|
|
387
427
|
?.then(([response, options, rawResponse]) => {
|
|
388
428
|
this._log.info('createOccurrence response %j', response);
|
|
389
429
|
return [response, options, rawResponse];
|
|
390
|
-
})
|
|
391
|
-
|
|
430
|
+
})
|
|
431
|
+
.catch((error) => {
|
|
432
|
+
if (error &&
|
|
433
|
+
'statusDetails' in error &&
|
|
434
|
+
error.statusDetails instanceof Array) {
|
|
392
435
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
393
436
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
394
437
|
}
|
|
@@ -408,10 +451,13 @@ class GrafeasV1Beta1Client {
|
|
|
408
451
|
options = options || {};
|
|
409
452
|
options.otherArgs = options.otherArgs || {};
|
|
410
453
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
411
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
412
|
-
|
|
454
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
455
|
+
this._gaxModule.routingHeader.fromParams({
|
|
456
|
+
parent: request.parent ?? '',
|
|
457
|
+
});
|
|
458
|
+
this.initialize().catch((err) => {
|
|
459
|
+
throw err;
|
|
413
460
|
});
|
|
414
|
-
this.initialize().catch(err => { throw err; });
|
|
415
461
|
this._log.info('batchCreateOccurrences request %j', request);
|
|
416
462
|
const wrappedCallback = callback
|
|
417
463
|
? (error, response, options, rawResponse) => {
|
|
@@ -419,12 +465,16 @@ class GrafeasV1Beta1Client {
|
|
|
419
465
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
420
466
|
}
|
|
421
467
|
: undefined;
|
|
422
|
-
return this.innerApiCalls
|
|
468
|
+
return this.innerApiCalls
|
|
469
|
+
.batchCreateOccurrences(request, options, wrappedCallback)
|
|
423
470
|
?.then(([response, options, rawResponse]) => {
|
|
424
471
|
this._log.info('batchCreateOccurrences response %j', response);
|
|
425
472
|
return [response, options, rawResponse];
|
|
426
|
-
})
|
|
427
|
-
|
|
473
|
+
})
|
|
474
|
+
.catch((error) => {
|
|
475
|
+
if (error &&
|
|
476
|
+
'statusDetails' in error &&
|
|
477
|
+
error.statusDetails instanceof Array) {
|
|
428
478
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
429
479
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
430
480
|
}
|
|
@@ -444,10 +494,13 @@ class GrafeasV1Beta1Client {
|
|
|
444
494
|
options = options || {};
|
|
445
495
|
options.otherArgs = options.otherArgs || {};
|
|
446
496
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
447
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
448
|
-
|
|
497
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
498
|
+
this._gaxModule.routingHeader.fromParams({
|
|
499
|
+
name: request.name ?? '',
|
|
500
|
+
});
|
|
501
|
+
this.initialize().catch((err) => {
|
|
502
|
+
throw err;
|
|
449
503
|
});
|
|
450
|
-
this.initialize().catch(err => { throw err; });
|
|
451
504
|
this._log.info('updateOccurrence request %j', request);
|
|
452
505
|
const wrappedCallback = callback
|
|
453
506
|
? (error, response, options, rawResponse) => {
|
|
@@ -455,12 +508,16 @@ class GrafeasV1Beta1Client {
|
|
|
455
508
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
456
509
|
}
|
|
457
510
|
: undefined;
|
|
458
|
-
return this.innerApiCalls
|
|
511
|
+
return this.innerApiCalls
|
|
512
|
+
.updateOccurrence(request, options, wrappedCallback)
|
|
459
513
|
?.then(([response, options, rawResponse]) => {
|
|
460
514
|
this._log.info('updateOccurrence response %j', response);
|
|
461
515
|
return [response, options, rawResponse];
|
|
462
|
-
})
|
|
463
|
-
|
|
516
|
+
})
|
|
517
|
+
.catch((error) => {
|
|
518
|
+
if (error &&
|
|
519
|
+
'statusDetails' in error &&
|
|
520
|
+
error.statusDetails instanceof Array) {
|
|
464
521
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
465
522
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
466
523
|
}
|
|
@@ -480,10 +537,13 @@ class GrafeasV1Beta1Client {
|
|
|
480
537
|
options = options || {};
|
|
481
538
|
options.otherArgs = options.otherArgs || {};
|
|
482
539
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
483
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
484
|
-
|
|
540
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
541
|
+
this._gaxModule.routingHeader.fromParams({
|
|
542
|
+
name: request.name ?? '',
|
|
543
|
+
});
|
|
544
|
+
this.initialize().catch((err) => {
|
|
545
|
+
throw err;
|
|
485
546
|
});
|
|
486
|
-
this.initialize().catch(err => { throw err; });
|
|
487
547
|
this._log.info('getOccurrenceNote request %j', request);
|
|
488
548
|
const wrappedCallback = callback
|
|
489
549
|
? (error, response, options, rawResponse) => {
|
|
@@ -491,12 +551,16 @@ class GrafeasV1Beta1Client {
|
|
|
491
551
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
492
552
|
}
|
|
493
553
|
: undefined;
|
|
494
|
-
return this.innerApiCalls
|
|
554
|
+
return this.innerApiCalls
|
|
555
|
+
.getOccurrenceNote(request, options, wrappedCallback)
|
|
495
556
|
?.then(([response, options, rawResponse]) => {
|
|
496
557
|
this._log.info('getOccurrenceNote response %j', response);
|
|
497
558
|
return [response, options, rawResponse];
|
|
498
|
-
})
|
|
499
|
-
|
|
559
|
+
})
|
|
560
|
+
.catch((error) => {
|
|
561
|
+
if (error &&
|
|
562
|
+
'statusDetails' in error &&
|
|
563
|
+
error.statusDetails instanceof Array) {
|
|
500
564
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
501
565
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
502
566
|
}
|
|
@@ -516,10 +580,13 @@ class GrafeasV1Beta1Client {
|
|
|
516
580
|
options = options || {};
|
|
517
581
|
options.otherArgs = options.otherArgs || {};
|
|
518
582
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
519
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
520
|
-
|
|
583
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
584
|
+
this._gaxModule.routingHeader.fromParams({
|
|
585
|
+
name: request.name ?? '',
|
|
586
|
+
});
|
|
587
|
+
this.initialize().catch((err) => {
|
|
588
|
+
throw err;
|
|
521
589
|
});
|
|
522
|
-
this.initialize().catch(err => { throw err; });
|
|
523
590
|
this._log.info('getNote request %j', request);
|
|
524
591
|
const wrappedCallback = callback
|
|
525
592
|
? (error, response, options, rawResponse) => {
|
|
@@ -527,12 +594,16 @@ class GrafeasV1Beta1Client {
|
|
|
527
594
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
528
595
|
}
|
|
529
596
|
: undefined;
|
|
530
|
-
return this.innerApiCalls
|
|
597
|
+
return this.innerApiCalls
|
|
598
|
+
.getNote(request, options, wrappedCallback)
|
|
531
599
|
?.then(([response, options, rawResponse]) => {
|
|
532
600
|
this._log.info('getNote response %j', response);
|
|
533
601
|
return [response, options, rawResponse];
|
|
534
|
-
})
|
|
535
|
-
|
|
602
|
+
})
|
|
603
|
+
.catch((error) => {
|
|
604
|
+
if (error &&
|
|
605
|
+
'statusDetails' in error &&
|
|
606
|
+
error.statusDetails instanceof Array) {
|
|
536
607
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
537
608
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
538
609
|
}
|
|
@@ -552,10 +623,13 @@ class GrafeasV1Beta1Client {
|
|
|
552
623
|
options = options || {};
|
|
553
624
|
options.otherArgs = options.otherArgs || {};
|
|
554
625
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
555
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
556
|
-
|
|
626
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
627
|
+
this._gaxModule.routingHeader.fromParams({
|
|
628
|
+
name: request.name ?? '',
|
|
629
|
+
});
|
|
630
|
+
this.initialize().catch((err) => {
|
|
631
|
+
throw err;
|
|
557
632
|
});
|
|
558
|
-
this.initialize().catch(err => { throw err; });
|
|
559
633
|
this._log.info('deleteNote request %j', request);
|
|
560
634
|
const wrappedCallback = callback
|
|
561
635
|
? (error, response, options, rawResponse) => {
|
|
@@ -563,12 +637,16 @@ class GrafeasV1Beta1Client {
|
|
|
563
637
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
564
638
|
}
|
|
565
639
|
: undefined;
|
|
566
|
-
return this.innerApiCalls
|
|
640
|
+
return this.innerApiCalls
|
|
641
|
+
.deleteNote(request, options, wrappedCallback)
|
|
567
642
|
?.then(([response, options, rawResponse]) => {
|
|
568
643
|
this._log.info('deleteNote response %j', response);
|
|
569
644
|
return [response, options, rawResponse];
|
|
570
|
-
})
|
|
571
|
-
|
|
645
|
+
})
|
|
646
|
+
.catch((error) => {
|
|
647
|
+
if (error &&
|
|
648
|
+
'statusDetails' in error &&
|
|
649
|
+
error.statusDetails instanceof Array) {
|
|
572
650
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
573
651
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
574
652
|
}
|
|
@@ -588,10 +666,13 @@ class GrafeasV1Beta1Client {
|
|
|
588
666
|
options = options || {};
|
|
589
667
|
options.otherArgs = options.otherArgs || {};
|
|
590
668
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
591
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
592
|
-
|
|
669
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
670
|
+
this._gaxModule.routingHeader.fromParams({
|
|
671
|
+
parent: request.parent ?? '',
|
|
672
|
+
});
|
|
673
|
+
this.initialize().catch((err) => {
|
|
674
|
+
throw err;
|
|
593
675
|
});
|
|
594
|
-
this.initialize().catch(err => { throw err; });
|
|
595
676
|
this._log.info('createNote request %j', request);
|
|
596
677
|
const wrappedCallback = callback
|
|
597
678
|
? (error, response, options, rawResponse) => {
|
|
@@ -599,12 +680,16 @@ class GrafeasV1Beta1Client {
|
|
|
599
680
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
600
681
|
}
|
|
601
682
|
: undefined;
|
|
602
|
-
return this.innerApiCalls
|
|
683
|
+
return this.innerApiCalls
|
|
684
|
+
.createNote(request, options, wrappedCallback)
|
|
603
685
|
?.then(([response, options, rawResponse]) => {
|
|
604
686
|
this._log.info('createNote response %j', response);
|
|
605
687
|
return [response, options, rawResponse];
|
|
606
|
-
})
|
|
607
|
-
|
|
688
|
+
})
|
|
689
|
+
.catch((error) => {
|
|
690
|
+
if (error &&
|
|
691
|
+
'statusDetails' in error &&
|
|
692
|
+
error.statusDetails instanceof Array) {
|
|
608
693
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
609
694
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
610
695
|
}
|
|
@@ -624,10 +709,13 @@ class GrafeasV1Beta1Client {
|
|
|
624
709
|
options = options || {};
|
|
625
710
|
options.otherArgs = options.otherArgs || {};
|
|
626
711
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
627
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
628
|
-
|
|
712
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
713
|
+
this._gaxModule.routingHeader.fromParams({
|
|
714
|
+
parent: request.parent ?? '',
|
|
715
|
+
});
|
|
716
|
+
this.initialize().catch((err) => {
|
|
717
|
+
throw err;
|
|
629
718
|
});
|
|
630
|
-
this.initialize().catch(err => { throw err; });
|
|
631
719
|
this._log.info('batchCreateNotes request %j', request);
|
|
632
720
|
const wrappedCallback = callback
|
|
633
721
|
? (error, response, options, rawResponse) => {
|
|
@@ -635,12 +723,16 @@ class GrafeasV1Beta1Client {
|
|
|
635
723
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
636
724
|
}
|
|
637
725
|
: undefined;
|
|
638
|
-
return this.innerApiCalls
|
|
726
|
+
return this.innerApiCalls
|
|
727
|
+
.batchCreateNotes(request, options, wrappedCallback)
|
|
639
728
|
?.then(([response, options, rawResponse]) => {
|
|
640
729
|
this._log.info('batchCreateNotes response %j', response);
|
|
641
730
|
return [response, options, rawResponse];
|
|
642
|
-
})
|
|
643
|
-
|
|
731
|
+
})
|
|
732
|
+
.catch((error) => {
|
|
733
|
+
if (error &&
|
|
734
|
+
'statusDetails' in error &&
|
|
735
|
+
error.statusDetails instanceof Array) {
|
|
644
736
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
645
737
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
646
738
|
}
|
|
@@ -660,10 +752,13 @@ class GrafeasV1Beta1Client {
|
|
|
660
752
|
options = options || {};
|
|
661
753
|
options.otherArgs = options.otherArgs || {};
|
|
662
754
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
663
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
664
|
-
|
|
755
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
756
|
+
this._gaxModule.routingHeader.fromParams({
|
|
757
|
+
name: request.name ?? '',
|
|
758
|
+
});
|
|
759
|
+
this.initialize().catch((err) => {
|
|
760
|
+
throw err;
|
|
665
761
|
});
|
|
666
|
-
this.initialize().catch(err => { throw err; });
|
|
667
762
|
this._log.info('updateNote request %j', request);
|
|
668
763
|
const wrappedCallback = callback
|
|
669
764
|
? (error, response, options, rawResponse) => {
|
|
@@ -671,12 +766,16 @@ class GrafeasV1Beta1Client {
|
|
|
671
766
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
672
767
|
}
|
|
673
768
|
: undefined;
|
|
674
|
-
return this.innerApiCalls
|
|
769
|
+
return this.innerApiCalls
|
|
770
|
+
.updateNote(request, options, wrappedCallback)
|
|
675
771
|
?.then(([response, options, rawResponse]) => {
|
|
676
772
|
this._log.info('updateNote response %j', response);
|
|
677
773
|
return [response, options, rawResponse];
|
|
678
|
-
})
|
|
679
|
-
|
|
774
|
+
})
|
|
775
|
+
.catch((error) => {
|
|
776
|
+
if (error &&
|
|
777
|
+
'statusDetails' in error &&
|
|
778
|
+
error.statusDetails instanceof Array) {
|
|
680
779
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
681
780
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
682
781
|
}
|
|
@@ -696,10 +795,13 @@ class GrafeasV1Beta1Client {
|
|
|
696
795
|
options = options || {};
|
|
697
796
|
options.otherArgs = options.otherArgs || {};
|
|
698
797
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
699
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
700
|
-
|
|
798
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
799
|
+
this._gaxModule.routingHeader.fromParams({
|
|
800
|
+
parent: request.parent ?? '',
|
|
801
|
+
});
|
|
802
|
+
this.initialize().catch((err) => {
|
|
803
|
+
throw err;
|
|
701
804
|
});
|
|
702
|
-
this.initialize().catch(err => { throw err; });
|
|
703
805
|
this._log.info('getVulnerabilityOccurrencesSummary request %j', request);
|
|
704
806
|
const wrappedCallback = callback
|
|
705
807
|
? (error, response, options, rawResponse) => {
|
|
@@ -707,12 +809,16 @@ class GrafeasV1Beta1Client {
|
|
|
707
809
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
708
810
|
}
|
|
709
811
|
: undefined;
|
|
710
|
-
return this.innerApiCalls
|
|
812
|
+
return this.innerApiCalls
|
|
813
|
+
.getVulnerabilityOccurrencesSummary(request, options, wrappedCallback)
|
|
711
814
|
?.then(([response, options, rawResponse]) => {
|
|
712
815
|
this._log.info('getVulnerabilityOccurrencesSummary response %j', response);
|
|
713
816
|
return [response, options, rawResponse];
|
|
714
|
-
})
|
|
715
|
-
|
|
817
|
+
})
|
|
818
|
+
.catch((error) => {
|
|
819
|
+
if (error &&
|
|
820
|
+
'statusDetails' in error &&
|
|
821
|
+
error.statusDetails instanceof Array) {
|
|
716
822
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
717
823
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
718
824
|
}
|
|
@@ -732,10 +838,13 @@ class GrafeasV1Beta1Client {
|
|
|
732
838
|
options = options || {};
|
|
733
839
|
options.otherArgs = options.otherArgs || {};
|
|
734
840
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
735
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
736
|
-
|
|
841
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
842
|
+
this._gaxModule.routingHeader.fromParams({
|
|
843
|
+
parent: request.parent ?? '',
|
|
844
|
+
});
|
|
845
|
+
this.initialize().catch((err) => {
|
|
846
|
+
throw err;
|
|
737
847
|
});
|
|
738
|
-
this.initialize().catch(err => { throw err; });
|
|
739
848
|
const wrappedCallback = callback
|
|
740
849
|
? (error, values, nextPageRequest, rawResponse) => {
|
|
741
850
|
this._log.info('listOccurrences values %j', values);
|
|
@@ -779,12 +888,15 @@ class GrafeasV1Beta1Client {
|
|
|
779
888
|
options = options || {};
|
|
780
889
|
options.otherArgs = options.otherArgs || {};
|
|
781
890
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
782
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
783
|
-
|
|
784
|
-
|
|
891
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
892
|
+
this._gaxModule.routingHeader.fromParams({
|
|
893
|
+
parent: request.parent ?? '',
|
|
894
|
+
});
|
|
785
895
|
const defaultCallSettings = this._defaults['listOccurrences'];
|
|
786
896
|
const callSettings = defaultCallSettings.merge(options);
|
|
787
|
-
this.initialize().catch(err => {
|
|
897
|
+
this.initialize().catch((err) => {
|
|
898
|
+
throw err;
|
|
899
|
+
});
|
|
788
900
|
this._log.info('listOccurrences stream %j', request);
|
|
789
901
|
return this.descriptors.page.listOccurrences.createStream(this.innerApiCalls.listOccurrences, request, callSettings);
|
|
790
902
|
}
|
|
@@ -820,12 +932,15 @@ class GrafeasV1Beta1Client {
|
|
|
820
932
|
options = options || {};
|
|
821
933
|
options.otherArgs = options.otherArgs || {};
|
|
822
934
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
823
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
824
|
-
|
|
825
|
-
|
|
935
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
936
|
+
this._gaxModule.routingHeader.fromParams({
|
|
937
|
+
parent: request.parent ?? '',
|
|
938
|
+
});
|
|
826
939
|
const defaultCallSettings = this._defaults['listOccurrences'];
|
|
827
940
|
const callSettings = defaultCallSettings.merge(options);
|
|
828
|
-
this.initialize().catch(err => {
|
|
941
|
+
this.initialize().catch((err) => {
|
|
942
|
+
throw err;
|
|
943
|
+
});
|
|
829
944
|
this._log.info('listOccurrences iterate %j', request);
|
|
830
945
|
return this.descriptors.page.listOccurrences.asyncIterate(this.innerApiCalls['listOccurrences'], request, callSettings);
|
|
831
946
|
}
|
|
@@ -842,10 +957,13 @@ class GrafeasV1Beta1Client {
|
|
|
842
957
|
options = options || {};
|
|
843
958
|
options.otherArgs = options.otherArgs || {};
|
|
844
959
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
845
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
846
|
-
|
|
960
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
961
|
+
this._gaxModule.routingHeader.fromParams({
|
|
962
|
+
parent: request.parent ?? '',
|
|
963
|
+
});
|
|
964
|
+
this.initialize().catch((err) => {
|
|
965
|
+
throw err;
|
|
847
966
|
});
|
|
848
|
-
this.initialize().catch(err => { throw err; });
|
|
849
967
|
const wrappedCallback = callback
|
|
850
968
|
? (error, values, nextPageRequest, rawResponse) => {
|
|
851
969
|
this._log.info('listNotes values %j', values);
|
|
@@ -889,12 +1007,15 @@ class GrafeasV1Beta1Client {
|
|
|
889
1007
|
options = options || {};
|
|
890
1008
|
options.otherArgs = options.otherArgs || {};
|
|
891
1009
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
892
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
893
|
-
|
|
894
|
-
|
|
1010
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
1011
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1012
|
+
parent: request.parent ?? '',
|
|
1013
|
+
});
|
|
895
1014
|
const defaultCallSettings = this._defaults['listNotes'];
|
|
896
1015
|
const callSettings = defaultCallSettings.merge(options);
|
|
897
|
-
this.initialize().catch(err => {
|
|
1016
|
+
this.initialize().catch((err) => {
|
|
1017
|
+
throw err;
|
|
1018
|
+
});
|
|
898
1019
|
this._log.info('listNotes stream %j', request);
|
|
899
1020
|
return this.descriptors.page.listNotes.createStream(this.innerApiCalls.listNotes, request, callSettings);
|
|
900
1021
|
}
|
|
@@ -930,12 +1051,15 @@ class GrafeasV1Beta1Client {
|
|
|
930
1051
|
options = options || {};
|
|
931
1052
|
options.otherArgs = options.otherArgs || {};
|
|
932
1053
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
933
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
934
|
-
|
|
935
|
-
|
|
1054
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
1055
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1056
|
+
parent: request.parent ?? '',
|
|
1057
|
+
});
|
|
936
1058
|
const defaultCallSettings = this._defaults['listNotes'];
|
|
937
1059
|
const callSettings = defaultCallSettings.merge(options);
|
|
938
|
-
this.initialize().catch(err => {
|
|
1060
|
+
this.initialize().catch((err) => {
|
|
1061
|
+
throw err;
|
|
1062
|
+
});
|
|
939
1063
|
this._log.info('listNotes iterate %j', request);
|
|
940
1064
|
return this.descriptors.page.listNotes.asyncIterate(this.innerApiCalls['listNotes'], request, callSettings);
|
|
941
1065
|
}
|
|
@@ -952,10 +1076,13 @@ class GrafeasV1Beta1Client {
|
|
|
952
1076
|
options = options || {};
|
|
953
1077
|
options.otherArgs = options.otherArgs || {};
|
|
954
1078
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
955
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
956
|
-
|
|
1079
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
1080
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1081
|
+
name: request.name ?? '',
|
|
1082
|
+
});
|
|
1083
|
+
this.initialize().catch((err) => {
|
|
1084
|
+
throw err;
|
|
957
1085
|
});
|
|
958
|
-
this.initialize().catch(err => { throw err; });
|
|
959
1086
|
const wrappedCallback = callback
|
|
960
1087
|
? (error, values, nextPageRequest, rawResponse) => {
|
|
961
1088
|
this._log.info('listNoteOccurrences values %j', values);
|
|
@@ -999,12 +1126,15 @@ class GrafeasV1Beta1Client {
|
|
|
999
1126
|
options = options || {};
|
|
1000
1127
|
options.otherArgs = options.otherArgs || {};
|
|
1001
1128
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1002
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
1003
|
-
|
|
1004
|
-
|
|
1129
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
1130
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1131
|
+
name: request.name ?? '',
|
|
1132
|
+
});
|
|
1005
1133
|
const defaultCallSettings = this._defaults['listNoteOccurrences'];
|
|
1006
1134
|
const callSettings = defaultCallSettings.merge(options);
|
|
1007
|
-
this.initialize().catch(err => {
|
|
1135
|
+
this.initialize().catch((err) => {
|
|
1136
|
+
throw err;
|
|
1137
|
+
});
|
|
1008
1138
|
this._log.info('listNoteOccurrences stream %j', request);
|
|
1009
1139
|
return this.descriptors.page.listNoteOccurrences.createStream(this.innerApiCalls.listNoteOccurrences, request, callSettings);
|
|
1010
1140
|
}
|
|
@@ -1040,12 +1170,15 @@ class GrafeasV1Beta1Client {
|
|
|
1040
1170
|
options = options || {};
|
|
1041
1171
|
options.otherArgs = options.otherArgs || {};
|
|
1042
1172
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1043
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
1044
|
-
|
|
1045
|
-
|
|
1173
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
1174
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1175
|
+
name: request.name ?? '',
|
|
1176
|
+
});
|
|
1046
1177
|
const defaultCallSettings = this._defaults['listNoteOccurrences'];
|
|
1047
1178
|
const callSettings = defaultCallSettings.merge(options);
|
|
1048
|
-
this.initialize().catch(err => {
|
|
1179
|
+
this.initialize().catch((err) => {
|
|
1180
|
+
throw err;
|
|
1181
|
+
});
|
|
1049
1182
|
this._log.info('listNoteOccurrences iterate %j', request);
|
|
1050
1183
|
return this.descriptors.page.listNoteOccurrences.asyncIterate(this.innerApiCalls['listNoteOccurrences'], request, callSettings);
|
|
1051
1184
|
}
|
|
@@ -1057,7 +1190,7 @@ class GrafeasV1Beta1Client {
|
|
|
1057
1190
|
*/
|
|
1058
1191
|
close() {
|
|
1059
1192
|
if (this.grafeasV1Beta1Stub && !this._terminated) {
|
|
1060
|
-
return this.grafeasV1Beta1Stub.then(stub => {
|
|
1193
|
+
return this.grafeasV1Beta1Stub.then((stub) => {
|
|
1061
1194
|
this._log.info('ending gRPC channel');
|
|
1062
1195
|
this._terminated = true;
|
|
1063
1196
|
stub.close();
|