aws-sdk-securityhub 1.109.0

AWS SDK for AWS SecurityHub
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A user-defined note added to a finding.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Note {
    /// <p>The text of a note.</p>
    /// <p>Length Constraints: Minimum of 1. Maximum of 512.</p>
    pub text: ::std::option::Option<::std::string::String>,
    /// <p>The principal that created a note.</p>
    pub updated_by: ::std::option::Option<::std::string::String>,
    /// <p>A timestamp that indicates when the note was updated.</p>
    /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
    pub updated_at: ::std::option::Option<::std::string::String>,
}
impl Note {
    /// <p>The text of a note.</p>
    /// <p>Length Constraints: Minimum of 1. Maximum of 512.</p>
    pub fn text(&self) -> ::std::option::Option<&str> {
        self.text.as_deref()
    }
    /// <p>The principal that created a note.</p>
    pub fn updated_by(&self) -> ::std::option::Option<&str> {
        self.updated_by.as_deref()
    }
    /// <p>A timestamp that indicates when the note was updated.</p>
    /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
    pub fn updated_at(&self) -> ::std::option::Option<&str> {
        self.updated_at.as_deref()
    }
}
impl Note {
    /// Creates a new builder-style object to manufacture [`Note`](crate::types::Note).
    pub fn builder() -> crate::types::builders::NoteBuilder {
        crate::types::builders::NoteBuilder::default()
    }
}

/// A builder for [`Note`](crate::types::Note).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct NoteBuilder {
    pub(crate) text: ::std::option::Option<::std::string::String>,
    pub(crate) updated_by: ::std::option::Option<::std::string::String>,
    pub(crate) updated_at: ::std::option::Option<::std::string::String>,
}
impl NoteBuilder {
    /// <p>The text of a note.</p>
    /// <p>Length Constraints: Minimum of 1. Maximum of 512.</p>
    /// This field is required.
    pub fn text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.text = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The text of a note.</p>
    /// <p>Length Constraints: Minimum of 1. Maximum of 512.</p>
    pub fn set_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.text = input;
        self
    }
    /// <p>The text of a note.</p>
    /// <p>Length Constraints: Minimum of 1. Maximum of 512.</p>
    pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
        &self.text
    }
    /// <p>The principal that created a note.</p>
    /// This field is required.
    pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.updated_by = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The principal that created a note.</p>
    pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.updated_by = input;
        self
    }
    /// <p>The principal that created a note.</p>
    pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.updated_by
    }
    /// <p>A timestamp that indicates when the note was updated.</p>
    /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
    /// This field is required.
    pub fn updated_at(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.updated_at = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A timestamp that indicates when the note was updated.</p>
    /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>A timestamp that indicates when the note was updated.</p>
    /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::std::string::String> {
        &self.updated_at
    }
    /// Consumes the builder and constructs a [`Note`](crate::types::Note).
    pub fn build(self) -> crate::types::Note {
        crate::types::Note {
            text: self.text,
            updated_by: self.updated_by,
            updated_at: self.updated_at,
        }
    }
}