/
Note.php
757 lines (673 loc) · 21.2 KB
/
Note.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: grafeas/v1/grafeas.proto
namespace Grafeas\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A type of analysis that can be done for a resource.
*
* Generated from protobuf message <code>grafeas.v1.Note</code>
*/
class Note extends \Google\Protobuf\Internal\Message
{
/**
* Output only. The name of the note in the form of
* `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
*
* Generated from protobuf field <code>string name = 1;</code>
*/
private $name = '';
/**
* A one sentence description of this note.
*
* Generated from protobuf field <code>string short_description = 2;</code>
*/
private $short_description = '';
/**
* A detailed description of this note.
*
* Generated from protobuf field <code>string long_description = 3;</code>
*/
private $long_description = '';
/**
* Output only. The type of analysis. This field can be used as a filter in
* list requests.
*
* Generated from protobuf field <code>.grafeas.v1.NoteKind kind = 4;</code>
*/
private $kind = 0;
/**
* URLs associated with this note.
*
* Generated from protobuf field <code>repeated .grafeas.v1.RelatedUrl related_url = 5;</code>
*/
private $related_url;
/**
* Time of expiration for this note. Empty if note does not expire.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp expiration_time = 6;</code>
*/
private $expiration_time = null;
/**
* Output only. The time this note was created. This field can be used as a
* filter in list requests.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 7;</code>
*/
private $create_time = null;
/**
* Output only. The time this note was last updated. This field can be used as
* a filter in list requests.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 8;</code>
*/
private $update_time = null;
/**
* Other notes related to this note.
*
* Generated from protobuf field <code>repeated string related_note_names = 9;</code>
*/
private $related_note_names;
protected $type;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $name
* Output only. The name of the note in the form of
* `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
* @type string $short_description
* A one sentence description of this note.
* @type string $long_description
* A detailed description of this note.
* @type int $kind
* Output only. The type of analysis. This field can be used as a filter in
* list requests.
* @type array<\Grafeas\V1\RelatedUrl>|\Google\Protobuf\Internal\RepeatedField $related_url
* URLs associated with this note.
* @type \Google\Protobuf\Timestamp $expiration_time
* Time of expiration for this note. Empty if note does not expire.
* @type \Google\Protobuf\Timestamp $create_time
* Output only. The time this note was created. This field can be used as a
* filter in list requests.
* @type \Google\Protobuf\Timestamp $update_time
* Output only. The time this note was last updated. This field can be used as
* a filter in list requests.
* @type array<string>|\Google\Protobuf\Internal\RepeatedField $related_note_names
* Other notes related to this note.
* @type \Grafeas\V1\VulnerabilityNote $vulnerability
* A note describing a package vulnerability.
* @type \Grafeas\V1\BuildNote $build
* A note describing build provenance for a verifiable build.
* @type \Grafeas\V1\ImageNote $image
* A note describing a base image.
* @type \Grafeas\V1\PackageNote $package
* A note describing a package hosted by various package managers.
* @type \Grafeas\V1\DeploymentNote $deployment
* A note describing something that can be deployed.
* @type \Grafeas\V1\DiscoveryNote $discovery
* A note describing the initial analysis of a resource.
* @type \Grafeas\V1\AttestationNote $attestation
* A note describing an attestation role.
* @type \Grafeas\V1\UpgradeNote $upgrade
* A note describing available package upgrades.
* @type \Grafeas\V1\ComplianceNote $compliance
* A note describing a compliance check.
* @type \Grafeas\V1\DSSEAttestationNote $dsse_attestation
* A note describing a dsse attestation note.
* @type \Grafeas\V1\VulnerabilityAssessmentNote $vulnerability_assessment
* A note describing a vulnerability assessment.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Grafeas\V1\Grafeas::initOnce();
parent::__construct($data);
}
/**
* Output only. The name of the note in the form of
* `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
*
* Generated from protobuf field <code>string name = 1;</code>
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Output only. The name of the note in the form of
* `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
*
* Generated from protobuf field <code>string name = 1;</code>
* @param string $var
* @return $this
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
return $this;
}
/**
* A one sentence description of this note.
*
* Generated from protobuf field <code>string short_description = 2;</code>
* @return string
*/
public function getShortDescription()
{
return $this->short_description;
}
/**
* A one sentence description of this note.
*
* Generated from protobuf field <code>string short_description = 2;</code>
* @param string $var
* @return $this
*/
public function setShortDescription($var)
{
GPBUtil::checkString($var, True);
$this->short_description = $var;
return $this;
}
/**
* A detailed description of this note.
*
* Generated from protobuf field <code>string long_description = 3;</code>
* @return string
*/
public function getLongDescription()
{
return $this->long_description;
}
/**
* A detailed description of this note.
*
* Generated from protobuf field <code>string long_description = 3;</code>
* @param string $var
* @return $this
*/
public function setLongDescription($var)
{
GPBUtil::checkString($var, True);
$this->long_description = $var;
return $this;
}
/**
* Output only. The type of analysis. This field can be used as a filter in
* list requests.
*
* Generated from protobuf field <code>.grafeas.v1.NoteKind kind = 4;</code>
* @return int
*/
public function getKind()
{
return $this->kind;
}
/**
* Output only. The type of analysis. This field can be used as a filter in
* list requests.
*
* Generated from protobuf field <code>.grafeas.v1.NoteKind kind = 4;</code>
* @param int $var
* @return $this
*/
public function setKind($var)
{
GPBUtil::checkEnum($var, \Grafeas\V1\NoteKind::class);
$this->kind = $var;
return $this;
}
/**
* URLs associated with this note.
*
* Generated from protobuf field <code>repeated .grafeas.v1.RelatedUrl related_url = 5;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getRelatedUrl()
{
return $this->related_url;
}
/**
* URLs associated with this note.
*
* Generated from protobuf field <code>repeated .grafeas.v1.RelatedUrl related_url = 5;</code>
* @param array<\Grafeas\V1\RelatedUrl>|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setRelatedUrl($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grafeas\V1\RelatedUrl::class);
$this->related_url = $arr;
return $this;
}
/**
* Time of expiration for this note. Empty if note does not expire.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp expiration_time = 6;</code>
* @return \Google\Protobuf\Timestamp|null
*/
public function getExpirationTime()
{
return $this->expiration_time;
}
public function hasExpirationTime()
{
return isset($this->expiration_time);
}
public function clearExpirationTime()
{
unset($this->expiration_time);
}
/**
* Time of expiration for this note. Empty if note does not expire.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp expiration_time = 6;</code>
* @param \Google\Protobuf\Timestamp $var
* @return $this
*/
public function setExpirationTime($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
$this->expiration_time = $var;
return $this;
}
/**
* Output only. The time this note was created. This field can be used as a
* filter in list requests.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 7;</code>
* @return \Google\Protobuf\Timestamp|null
*/
public function getCreateTime()
{
return $this->create_time;
}
public function hasCreateTime()
{
return isset($this->create_time);
}
public function clearCreateTime()
{
unset($this->create_time);
}
/**
* Output only. The time this note was created. This field can be used as a
* filter in list requests.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 7;</code>
* @param \Google\Protobuf\Timestamp $var
* @return $this
*/
public function setCreateTime($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
$this->create_time = $var;
return $this;
}
/**
* Output only. The time this note was last updated. This field can be used as
* a filter in list requests.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 8;</code>
* @return \Google\Protobuf\Timestamp|null
*/
public function getUpdateTime()
{
return $this->update_time;
}
public function hasUpdateTime()
{
return isset($this->update_time);
}
public function clearUpdateTime()
{
unset($this->update_time);
}
/**
* Output only. The time this note was last updated. This field can be used as
* a filter in list requests.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 8;</code>
* @param \Google\Protobuf\Timestamp $var
* @return $this
*/
public function setUpdateTime($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
$this->update_time = $var;
return $this;
}
/**
* Other notes related to this note.
*
* Generated from protobuf field <code>repeated string related_note_names = 9;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getRelatedNoteNames()
{
return $this->related_note_names;
}
/**
* Other notes related to this note.
*
* Generated from protobuf field <code>repeated string related_note_names = 9;</code>
* @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setRelatedNoteNames($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->related_note_names = $arr;
return $this;
}
/**
* A note describing a package vulnerability.
*
* Generated from protobuf field <code>.grafeas.v1.VulnerabilityNote vulnerability = 10;</code>
* @return \Grafeas\V1\VulnerabilityNote|null
*/
public function getVulnerability()
{
return $this->readOneof(10);
}
public function hasVulnerability()
{
return $this->hasOneof(10);
}
/**
* A note describing a package vulnerability.
*
* Generated from protobuf field <code>.grafeas.v1.VulnerabilityNote vulnerability = 10;</code>
* @param \Grafeas\V1\VulnerabilityNote $var
* @return $this
*/
public function setVulnerability($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\VulnerabilityNote::class);
$this->writeOneof(10, $var);
return $this;
}
/**
* A note describing build provenance for a verifiable build.
*
* Generated from protobuf field <code>.grafeas.v1.BuildNote build = 11;</code>
* @return \Grafeas\V1\BuildNote|null
*/
public function getBuild()
{
return $this->readOneof(11);
}
public function hasBuild()
{
return $this->hasOneof(11);
}
/**
* A note describing build provenance for a verifiable build.
*
* Generated from protobuf field <code>.grafeas.v1.BuildNote build = 11;</code>
* @param \Grafeas\V1\BuildNote $var
* @return $this
*/
public function setBuild($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\BuildNote::class);
$this->writeOneof(11, $var);
return $this;
}
/**
* A note describing a base image.
*
* Generated from protobuf field <code>.grafeas.v1.ImageNote image = 12;</code>
* @return \Grafeas\V1\ImageNote|null
*/
public function getImage()
{
return $this->readOneof(12);
}
public function hasImage()
{
return $this->hasOneof(12);
}
/**
* A note describing a base image.
*
* Generated from protobuf field <code>.grafeas.v1.ImageNote image = 12;</code>
* @param \Grafeas\V1\ImageNote $var
* @return $this
*/
public function setImage($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\ImageNote::class);
$this->writeOneof(12, $var);
return $this;
}
/**
* A note describing a package hosted by various package managers.
*
* Generated from protobuf field <code>.grafeas.v1.PackageNote package = 13;</code>
* @return \Grafeas\V1\PackageNote|null
*/
public function getPackage()
{
return $this->readOneof(13);
}
public function hasPackage()
{
return $this->hasOneof(13);
}
/**
* A note describing a package hosted by various package managers.
*
* Generated from protobuf field <code>.grafeas.v1.PackageNote package = 13;</code>
* @param \Grafeas\V1\PackageNote $var
* @return $this
*/
public function setPackage($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\PackageNote::class);
$this->writeOneof(13, $var);
return $this;
}
/**
* A note describing something that can be deployed.
*
* Generated from protobuf field <code>.grafeas.v1.DeploymentNote deployment = 14;</code>
* @return \Grafeas\V1\DeploymentNote|null
*/
public function getDeployment()
{
return $this->readOneof(14);
}
public function hasDeployment()
{
return $this->hasOneof(14);
}
/**
* A note describing something that can be deployed.
*
* Generated from protobuf field <code>.grafeas.v1.DeploymentNote deployment = 14;</code>
* @param \Grafeas\V1\DeploymentNote $var
* @return $this
*/
public function setDeployment($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\DeploymentNote::class);
$this->writeOneof(14, $var);
return $this;
}
/**
* A note describing the initial analysis of a resource.
*
* Generated from protobuf field <code>.grafeas.v1.DiscoveryNote discovery = 15;</code>
* @return \Grafeas\V1\DiscoveryNote|null
*/
public function getDiscovery()
{
return $this->readOneof(15);
}
public function hasDiscovery()
{
return $this->hasOneof(15);
}
/**
* A note describing the initial analysis of a resource.
*
* Generated from protobuf field <code>.grafeas.v1.DiscoveryNote discovery = 15;</code>
* @param \Grafeas\V1\DiscoveryNote $var
* @return $this
*/
public function setDiscovery($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\DiscoveryNote::class);
$this->writeOneof(15, $var);
return $this;
}
/**
* A note describing an attestation role.
*
* Generated from protobuf field <code>.grafeas.v1.AttestationNote attestation = 16;</code>
* @return \Grafeas\V1\AttestationNote|null
*/
public function getAttestation()
{
return $this->readOneof(16);
}
public function hasAttestation()
{
return $this->hasOneof(16);
}
/**
* A note describing an attestation role.
*
* Generated from protobuf field <code>.grafeas.v1.AttestationNote attestation = 16;</code>
* @param \Grafeas\V1\AttestationNote $var
* @return $this
*/
public function setAttestation($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\AttestationNote::class);
$this->writeOneof(16, $var);
return $this;
}
/**
* A note describing available package upgrades.
*
* Generated from protobuf field <code>.grafeas.v1.UpgradeNote upgrade = 17;</code>
* @return \Grafeas\V1\UpgradeNote|null
*/
public function getUpgrade()
{
return $this->readOneof(17);
}
public function hasUpgrade()
{
return $this->hasOneof(17);
}
/**
* A note describing available package upgrades.
*
* Generated from protobuf field <code>.grafeas.v1.UpgradeNote upgrade = 17;</code>
* @param \Grafeas\V1\UpgradeNote $var
* @return $this
*/
public function setUpgrade($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\UpgradeNote::class);
$this->writeOneof(17, $var);
return $this;
}
/**
* A note describing a compliance check.
*
* Generated from protobuf field <code>.grafeas.v1.ComplianceNote compliance = 18;</code>
* @return \Grafeas\V1\ComplianceNote|null
*/
public function getCompliance()
{
return $this->readOneof(18);
}
public function hasCompliance()
{
return $this->hasOneof(18);
}
/**
* A note describing a compliance check.
*
* Generated from protobuf field <code>.grafeas.v1.ComplianceNote compliance = 18;</code>
* @param \Grafeas\V1\ComplianceNote $var
* @return $this
*/
public function setCompliance($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\ComplianceNote::class);
$this->writeOneof(18, $var);
return $this;
}
/**
* A note describing a dsse attestation note.
*
* Generated from protobuf field <code>.grafeas.v1.DSSEAttestationNote dsse_attestation = 19;</code>
* @return \Grafeas\V1\DSSEAttestationNote|null
*/
public function getDsseAttestation()
{
return $this->readOneof(19);
}
public function hasDsseAttestation()
{
return $this->hasOneof(19);
}
/**
* A note describing a dsse attestation note.
*
* Generated from protobuf field <code>.grafeas.v1.DSSEAttestationNote dsse_attestation = 19;</code>
* @param \Grafeas\V1\DSSEAttestationNote $var
* @return $this
*/
public function setDsseAttestation($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\DSSEAttestationNote::class);
$this->writeOneof(19, $var);
return $this;
}
/**
* A note describing a vulnerability assessment.
*
* Generated from protobuf field <code>.grafeas.v1.VulnerabilityAssessmentNote vulnerability_assessment = 20;</code>
* @return \Grafeas\V1\VulnerabilityAssessmentNote|null
*/
public function getVulnerabilityAssessment()
{
return $this->readOneof(20);
}
public function hasVulnerabilityAssessment()
{
return $this->hasOneof(20);
}
/**
* A note describing a vulnerability assessment.
*
* Generated from protobuf field <code>.grafeas.v1.VulnerabilityAssessmentNote vulnerability_assessment = 20;</code>
* @param \Grafeas\V1\VulnerabilityAssessmentNote $var
* @return $this
*/
public function setVulnerabilityAssessment($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\VulnerabilityAssessmentNote::class);
$this->writeOneof(20, $var);
return $this;
}
/**
* @return string
*/
public function getType()
{
return $this->whichOneof("type");
}
}