Skip to main content

Note

Struct Note 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Output only. The name of the note in the form of projects/[PROVIDER_ID]/notes/[NOTE_ID].

§short_description: String

A one sentence description of this note.

§long_description: String

A detailed description of this note.

§kind: NoteKind

Output only. The type of analysis. This field can be used as a filter in list requests.

§related_url: Vec<RelatedUrl>

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.

§related_note_names: Vec<String>

Other notes related to this note.

§type: Option<Type>

Required. Immutable. The type of analysis this note represents.

Implementations§

Source§

impl Note

Source

pub fn new() -> Self

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

§Example
let x = Note::new().set_name("example");
Source

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");
Source

pub fn set_long_description<T: Into<String>>(self, v: T) -> Self

Sets the value of long_description.

§Example
let x = Note::new().set_long_description("example");
Source

pub fn set_kind<T: Into<NoteKind>>(self, v: T) -> Self

Sets the value of kind.

§Example
use google_cloud_grafeas_v1::model::NoteKind;
let x0 = Note::new().set_kind(NoteKind::Vulnerability);
let x1 = Note::new().set_kind(NoteKind::Build);
let x2 = Note::new().set_kind(NoteKind::Image);

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 */,
    ]);
Source

pub fn set_expiration_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of expiration_time.

§Example
use wkt::Timestamp;
let x = Note::new().set_expiration_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_expiration_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

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>);
Source

pub fn set_create_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of create_time.

§Example
use wkt::Timestamp;
let x = Note::new().set_create_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

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>);
Source

pub fn set_update_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of update_time.

§Example
use wkt::Timestamp;
let x = Note::new().set_update_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

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"]);
Source

pub fn set_type<T: Into<Option<Type>>>(self, v: T) -> Self

Sets the value of r#type.

Note that all the setters affecting r#type are mutually exclusive.

§Example
use google_cloud_grafeas_v1::model::VulnerabilityNote;
let x = Note::new().set_type(Some(
    google_cloud_grafeas_v1::model::note::Type::Vulnerability(VulnerabilityNote::default().into())));
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());

Trait Implementations§

Source§

impl Clone for Note

Source§

fn clone(&self) -> Note

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Note

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Note

Source§

fn default() -> Note

Returns the “default value” for a type. Read more
Source§

impl Message for Note

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Note

Source§

fn eq(&self, other: &Note) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Note

Auto Trait Implementations§

§

impl Freeze for Note

§

impl RefUnwindSafe for Note

§

impl Send for Note

§

impl Sync for Note

§

impl Unpin for Note

§

impl UnsafeUnpin for Note

§

impl UnwindSafe for Note

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,