#[non_exhaustive]pub struct Note {
pub name: String,
pub short_description: String,
pub long_description: String,
pub kind: NoteKind,
pub related_url: Vec<RelatedUrl>,
pub expiration_time: Option<Timestamp>,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
pub related_note_names: Vec<String>,
pub type: Option<Type>,
/* private fields */
}Expand description
A type of analysis that can be done for a resource.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringOutput only. The name of the note in the form of
projects/[PROVIDER_ID]/notes/[NOTE_ID].
short_description: StringA one sentence description of this note.
long_description: StringA detailed description of this note.
kind: NoteKindOutput only. The type of analysis. This field can be used as a filter in list requests.
URLs associated with this note.
expiration_time: Option<Timestamp>Time of expiration for this note. Empty if note does not expire.
create_time: Option<Timestamp>Output only. The time this note was created. This field can be used as a filter in list requests.
update_time: Option<Timestamp>Output only. The time this note was last updated. This field can be used as a filter in list requests.
Other notes related to this note.
type: Option<Type>Required. Immutable. The type of analysis this note represents.
Implementations§
Source§impl Note
impl Note
pub fn new() -> Self
Sourcepub fn set_short_description<T: Into<String>>(self, v: T) -> Self
pub fn set_short_description<T: Into<String>>(self, v: T) -> Self
Sets the value of short_description.
§Example
let x = Note::new().set_short_description("example");Sourcepub fn set_long_description<T: Into<String>>(self, v: T) -> Self
pub fn set_long_description<T: Into<String>>(self, v: T) -> Self
Sets the value of related_url.
§Example
use google_cloud_grafeas_v1::model::RelatedUrl;
let x = Note::new()
.set_related_url([
RelatedUrl::default()/* use setters */,
RelatedUrl::default()/* use (different) setters */,
]);Sourcepub fn set_expiration_time<T>(self, v: T) -> Self
pub fn set_expiration_time<T>(self, v: T) -> Self
Sets the value of expiration_time.
§Example
use wkt::Timestamp;
let x = Note::new().set_expiration_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_expiration_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_expiration_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of expiration_time.
§Example
use wkt::Timestamp;
let x = Note::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
let x = Note::new().set_or_clear_expiration_time(None::<Timestamp>);Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = Note::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = Note::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Note::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_update_time<T>(self, v: T) -> Self
pub fn set_update_time<T>(self, v: T) -> Self
Sets the value of update_time.
§Example
use wkt::Timestamp;
let x = Note::new().set_update_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_time.
§Example
use wkt::Timestamp;
let x = Note::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = Note::new().set_or_clear_update_time(None::<Timestamp>);Sets the value of related_note_names.
§Example
let x = Note::new().set_related_note_names(["a", "b", "c"]);Sourcepub fn vulnerability(&self) -> Option<&Box<VulnerabilityNote>>
pub fn vulnerability(&self) -> Option<&Box<VulnerabilityNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a Vulnerability, None if the field is not set or
holds a different branch.
Sourcepub fn set_vulnerability<T: Into<Box<VulnerabilityNote>>>(self, v: T) -> Self
pub fn set_vulnerability<T: Into<Box<VulnerabilityNote>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a Vulnerability.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::VulnerabilityNote;
let x = Note::new().set_vulnerability(VulnerabilityNote::default()/* use setters */);
assert!(x.vulnerability().is_some());
assert!(x.build().is_none());
assert!(x.image().is_none());
assert!(x.package().is_none());
assert!(x.deployment().is_none());
assert!(x.discovery().is_none());
assert!(x.attestation().is_none());
assert!(x.upgrade().is_none());
assert!(x.compliance().is_none());
assert!(x.dsse_attestation().is_none());
assert!(x.vulnerability_assessment().is_none());
assert!(x.sbom_reference().is_none());
assert!(x.secret().is_none());Sourcepub fn build(&self) -> Option<&Box<BuildNote>>
pub fn build(&self) -> Option<&Box<BuildNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a Build, None if the field is not set or
holds a different branch.
Sourcepub fn set_build<T: Into<Box<BuildNote>>>(self, v: T) -> Self
pub fn set_build<T: Into<Box<BuildNote>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a Build.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::BuildNote;
let x = Note::new().set_build(BuildNote::default()/* use setters */);
assert!(x.build().is_some());
assert!(x.vulnerability().is_none());
assert!(x.image().is_none());
assert!(x.package().is_none());
assert!(x.deployment().is_none());
assert!(x.discovery().is_none());
assert!(x.attestation().is_none());
assert!(x.upgrade().is_none());
assert!(x.compliance().is_none());
assert!(x.dsse_attestation().is_none());
assert!(x.vulnerability_assessment().is_none());
assert!(x.sbom_reference().is_none());
assert!(x.secret().is_none());Sourcepub fn image(&self) -> Option<&Box<ImageNote>>
pub fn image(&self) -> Option<&Box<ImageNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a Image, None if the field is not set or
holds a different branch.
Sourcepub fn set_image<T: Into<Box<ImageNote>>>(self, v: T) -> Self
pub fn set_image<T: Into<Box<ImageNote>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a Image.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::ImageNote;
let x = Note::new().set_image(ImageNote::default()/* use setters */);
assert!(x.image().is_some());
assert!(x.vulnerability().is_none());
assert!(x.build().is_none());
assert!(x.package().is_none());
assert!(x.deployment().is_none());
assert!(x.discovery().is_none());
assert!(x.attestation().is_none());
assert!(x.upgrade().is_none());
assert!(x.compliance().is_none());
assert!(x.dsse_attestation().is_none());
assert!(x.vulnerability_assessment().is_none());
assert!(x.sbom_reference().is_none());
assert!(x.secret().is_none());Sourcepub fn package(&self) -> Option<&Box<PackageNote>>
pub fn package(&self) -> Option<&Box<PackageNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a Package, None if the field is not set or
holds a different branch.
Sourcepub fn set_package<T: Into<Box<PackageNote>>>(self, v: T) -> Self
pub fn set_package<T: Into<Box<PackageNote>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a Package.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::PackageNote;
let x = Note::new().set_package(PackageNote::default()/* use setters */);
assert!(x.package().is_some());
assert!(x.vulnerability().is_none());
assert!(x.build().is_none());
assert!(x.image().is_none());
assert!(x.deployment().is_none());
assert!(x.discovery().is_none());
assert!(x.attestation().is_none());
assert!(x.upgrade().is_none());
assert!(x.compliance().is_none());
assert!(x.dsse_attestation().is_none());
assert!(x.vulnerability_assessment().is_none());
assert!(x.sbom_reference().is_none());
assert!(x.secret().is_none());Sourcepub fn deployment(&self) -> Option<&Box<DeploymentNote>>
pub fn deployment(&self) -> Option<&Box<DeploymentNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a Deployment, None if the field is not set or
holds a different branch.
Sourcepub fn set_deployment<T: Into<Box<DeploymentNote>>>(self, v: T) -> Self
pub fn set_deployment<T: Into<Box<DeploymentNote>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a Deployment.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::DeploymentNote;
let x = Note::new().set_deployment(DeploymentNote::default()/* use setters */);
assert!(x.deployment().is_some());
assert!(x.vulnerability().is_none());
assert!(x.build().is_none());
assert!(x.image().is_none());
assert!(x.package().is_none());
assert!(x.discovery().is_none());
assert!(x.attestation().is_none());
assert!(x.upgrade().is_none());
assert!(x.compliance().is_none());
assert!(x.dsse_attestation().is_none());
assert!(x.vulnerability_assessment().is_none());
assert!(x.sbom_reference().is_none());
assert!(x.secret().is_none());Sourcepub fn discovery(&self) -> Option<&Box<DiscoveryNote>>
pub fn discovery(&self) -> Option<&Box<DiscoveryNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a Discovery, None if the field is not set or
holds a different branch.
Sourcepub fn set_discovery<T: Into<Box<DiscoveryNote>>>(self, v: T) -> Self
pub fn set_discovery<T: Into<Box<DiscoveryNote>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a Discovery.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::DiscoveryNote;
let x = Note::new().set_discovery(DiscoveryNote::default()/* use setters */);
assert!(x.discovery().is_some());
assert!(x.vulnerability().is_none());
assert!(x.build().is_none());
assert!(x.image().is_none());
assert!(x.package().is_none());
assert!(x.deployment().is_none());
assert!(x.attestation().is_none());
assert!(x.upgrade().is_none());
assert!(x.compliance().is_none());
assert!(x.dsse_attestation().is_none());
assert!(x.vulnerability_assessment().is_none());
assert!(x.sbom_reference().is_none());
assert!(x.secret().is_none());Sourcepub fn attestation(&self) -> Option<&Box<AttestationNote>>
pub fn attestation(&self) -> Option<&Box<AttestationNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a Attestation, None if the field is not set or
holds a different branch.
Sourcepub fn set_attestation<T: Into<Box<AttestationNote>>>(self, v: T) -> Self
pub fn set_attestation<T: Into<Box<AttestationNote>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a Attestation.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::AttestationNote;
let x = Note::new().set_attestation(AttestationNote::default()/* use setters */);
assert!(x.attestation().is_some());
assert!(x.vulnerability().is_none());
assert!(x.build().is_none());
assert!(x.image().is_none());
assert!(x.package().is_none());
assert!(x.deployment().is_none());
assert!(x.discovery().is_none());
assert!(x.upgrade().is_none());
assert!(x.compliance().is_none());
assert!(x.dsse_attestation().is_none());
assert!(x.vulnerability_assessment().is_none());
assert!(x.sbom_reference().is_none());
assert!(x.secret().is_none());Sourcepub fn upgrade(&self) -> Option<&Box<UpgradeNote>>
pub fn upgrade(&self) -> Option<&Box<UpgradeNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a Upgrade, None if the field is not set or
holds a different branch.
Sourcepub fn set_upgrade<T: Into<Box<UpgradeNote>>>(self, v: T) -> Self
pub fn set_upgrade<T: Into<Box<UpgradeNote>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a Upgrade.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::UpgradeNote;
let x = Note::new().set_upgrade(UpgradeNote::default()/* use setters */);
assert!(x.upgrade().is_some());
assert!(x.vulnerability().is_none());
assert!(x.build().is_none());
assert!(x.image().is_none());
assert!(x.package().is_none());
assert!(x.deployment().is_none());
assert!(x.discovery().is_none());
assert!(x.attestation().is_none());
assert!(x.compliance().is_none());
assert!(x.dsse_attestation().is_none());
assert!(x.vulnerability_assessment().is_none());
assert!(x.sbom_reference().is_none());
assert!(x.secret().is_none());Sourcepub fn compliance(&self) -> Option<&Box<ComplianceNote>>
pub fn compliance(&self) -> Option<&Box<ComplianceNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a Compliance, None if the field is not set or
holds a different branch.
Sourcepub fn set_compliance<T: Into<Box<ComplianceNote>>>(self, v: T) -> Self
pub fn set_compliance<T: Into<Box<ComplianceNote>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a Compliance.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::ComplianceNote;
let x = Note::new().set_compliance(ComplianceNote::default()/* use setters */);
assert!(x.compliance().is_some());
assert!(x.vulnerability().is_none());
assert!(x.build().is_none());
assert!(x.image().is_none());
assert!(x.package().is_none());
assert!(x.deployment().is_none());
assert!(x.discovery().is_none());
assert!(x.attestation().is_none());
assert!(x.upgrade().is_none());
assert!(x.dsse_attestation().is_none());
assert!(x.vulnerability_assessment().is_none());
assert!(x.sbom_reference().is_none());
assert!(x.secret().is_none());Sourcepub fn dsse_attestation(&self) -> Option<&Box<DSSEAttestationNote>>
pub fn dsse_attestation(&self) -> Option<&Box<DSSEAttestationNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a DsseAttestation, None if the field is not set or
holds a different branch.
Sourcepub fn set_dsse_attestation<T: Into<Box<DSSEAttestationNote>>>(
self,
v: T,
) -> Self
pub fn set_dsse_attestation<T: Into<Box<DSSEAttestationNote>>>( self, v: T, ) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a DsseAttestation.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::DSSEAttestationNote;
let x = Note::new().set_dsse_attestation(DSSEAttestationNote::default()/* use setters */);
assert!(x.dsse_attestation().is_some());
assert!(x.vulnerability().is_none());
assert!(x.build().is_none());
assert!(x.image().is_none());
assert!(x.package().is_none());
assert!(x.deployment().is_none());
assert!(x.discovery().is_none());
assert!(x.attestation().is_none());
assert!(x.upgrade().is_none());
assert!(x.compliance().is_none());
assert!(x.vulnerability_assessment().is_none());
assert!(x.sbom_reference().is_none());
assert!(x.secret().is_none());Sourcepub fn vulnerability_assessment(
&self,
) -> Option<&Box<VulnerabilityAssessmentNote>>
pub fn vulnerability_assessment( &self, ) -> Option<&Box<VulnerabilityAssessmentNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a VulnerabilityAssessment, None if the field is not set or
holds a different branch.
Sourcepub fn set_vulnerability_assessment<T: Into<Box<VulnerabilityAssessmentNote>>>(
self,
v: T,
) -> Self
pub fn set_vulnerability_assessment<T: Into<Box<VulnerabilityAssessmentNote>>>( self, v: T, ) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a VulnerabilityAssessment.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::VulnerabilityAssessmentNote;
let x = Note::new().set_vulnerability_assessment(VulnerabilityAssessmentNote::default()/* use setters */);
assert!(x.vulnerability_assessment().is_some());
assert!(x.vulnerability().is_none());
assert!(x.build().is_none());
assert!(x.image().is_none());
assert!(x.package().is_none());
assert!(x.deployment().is_none());
assert!(x.discovery().is_none());
assert!(x.attestation().is_none());
assert!(x.upgrade().is_none());
assert!(x.compliance().is_none());
assert!(x.dsse_attestation().is_none());
assert!(x.sbom_reference().is_none());
assert!(x.secret().is_none());Sourcepub fn sbom_reference(&self) -> Option<&Box<SBOMReferenceNote>>
pub fn sbom_reference(&self) -> Option<&Box<SBOMReferenceNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a SbomReference, None if the field is not set or
holds a different branch.
Sourcepub fn set_sbom_reference<T: Into<Box<SBOMReferenceNote>>>(self, v: T) -> Self
pub fn set_sbom_reference<T: Into<Box<SBOMReferenceNote>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a SbomReference.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::SBOMReferenceNote;
let x = Note::new().set_sbom_reference(SBOMReferenceNote::default()/* use setters */);
assert!(x.sbom_reference().is_some());
assert!(x.vulnerability().is_none());
assert!(x.build().is_none());
assert!(x.image().is_none());
assert!(x.package().is_none());
assert!(x.deployment().is_none());
assert!(x.discovery().is_none());
assert!(x.attestation().is_none());
assert!(x.upgrade().is_none());
assert!(x.compliance().is_none());
assert!(x.dsse_attestation().is_none());
assert!(x.vulnerability_assessment().is_none());
assert!(x.secret().is_none());Sourcepub fn secret(&self) -> Option<&Box<SecretNote>>
pub fn secret(&self) -> Option<&Box<SecretNote>>
The value of [r#type][crate::model::Note::r#type]
if it holds a Secret, None if the field is not set or
holds a different branch.
Sourcepub fn set_secret<T: Into<Box<SecretNote>>>(self, v: T) -> Self
pub fn set_secret<T: Into<Box<SecretNote>>>(self, v: T) -> Self
Sets the value of [r#type][crate::model::Note::r#type]
to hold a Secret.
Note that all the setters affecting r#type are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::SecretNote;
let x = Note::new().set_secret(SecretNote::default()/* use setters */);
assert!(x.secret().is_some());
assert!(x.vulnerability().is_none());
assert!(x.build().is_none());
assert!(x.image().is_none());
assert!(x.package().is_none());
assert!(x.deployment().is_none());
assert!(x.discovery().is_none());
assert!(x.attestation().is_none());
assert!(x.upgrade().is_none());
assert!(x.compliance().is_none());
assert!(x.dsse_attestation().is_none());
assert!(x.vulnerability_assessment().is_none());
assert!(x.sbom_reference().is_none());