aws-sdk-auditmanager 1.102.0

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

/// <p>An entity that defines the scope of audit evidence collected by Audit Manager. An Audit Manager assessment is an implementation of an Audit Manager framework.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Assessment {
    /// <p>The Amazon Resource Name (ARN) of the assessment.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Web Services account that's associated with the assessment.</p>
    pub aws_account: ::std::option::Option<crate::types::AwsAccount>,
    /// <p>The metadata for the assessment.</p>
    pub metadata: ::std::option::Option<crate::types::AssessmentMetadata>,
    /// <p>The framework that the assessment was created from.</p>
    pub framework: ::std::option::Option<crate::types::AssessmentFramework>,
    /// <p>The tags that are associated with the assessment.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl Assessment {
    /// <p>The Amazon Resource Name (ARN) of the assessment.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The Amazon Web Services account that's associated with the assessment.</p>
    pub fn aws_account(&self) -> ::std::option::Option<&crate::types::AwsAccount> {
        self.aws_account.as_ref()
    }
    /// <p>The metadata for the assessment.</p>
    pub fn metadata(&self) -> ::std::option::Option<&crate::types::AssessmentMetadata> {
        self.metadata.as_ref()
    }
    /// <p>The framework that the assessment was created from.</p>
    pub fn framework(&self) -> ::std::option::Option<&crate::types::AssessmentFramework> {
        self.framework.as_ref()
    }
    /// <p>The tags that are associated with the assessment.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::std::fmt::Debug for Assessment {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Assessment");
        formatter.field("arn", &self.arn);
        formatter.field("aws_account", &self.aws_account);
        formatter.field("metadata", &self.metadata);
        formatter.field("framework", &"*** Sensitive Data Redacted ***");
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}
impl Assessment {
    /// Creates a new builder-style object to manufacture [`Assessment`](crate::types::Assessment).
    pub fn builder() -> crate::types::builders::AssessmentBuilder {
        crate::types::builders::AssessmentBuilder::default()
    }
}

/// A builder for [`Assessment`](crate::types::Assessment).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct AssessmentBuilder {
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) aws_account: ::std::option::Option<crate::types::AwsAccount>,
    pub(crate) metadata: ::std::option::Option<crate::types::AssessmentMetadata>,
    pub(crate) framework: ::std::option::Option<crate::types::AssessmentFramework>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl AssessmentBuilder {
    /// <p>The Amazon Resource Name (ARN) of the assessment.</p>
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the assessment.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the assessment.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The Amazon Web Services account that's associated with the assessment.</p>
    pub fn aws_account(mut self, input: crate::types::AwsAccount) -> Self {
        self.aws_account = ::std::option::Option::Some(input);
        self
    }
    /// <p>The Amazon Web Services account that's associated with the assessment.</p>
    pub fn set_aws_account(mut self, input: ::std::option::Option<crate::types::AwsAccount>) -> Self {
        self.aws_account = input;
        self
    }
    /// <p>The Amazon Web Services account that's associated with the assessment.</p>
    pub fn get_aws_account(&self) -> &::std::option::Option<crate::types::AwsAccount> {
        &self.aws_account
    }
    /// <p>The metadata for the assessment.</p>
    pub fn metadata(mut self, input: crate::types::AssessmentMetadata) -> Self {
        self.metadata = ::std::option::Option::Some(input);
        self
    }
    /// <p>The metadata for the assessment.</p>
    pub fn set_metadata(mut self, input: ::std::option::Option<crate::types::AssessmentMetadata>) -> Self {
        self.metadata = input;
        self
    }
    /// <p>The metadata for the assessment.</p>
    pub fn get_metadata(&self) -> &::std::option::Option<crate::types::AssessmentMetadata> {
        &self.metadata
    }
    /// <p>The framework that the assessment was created from.</p>
    pub fn framework(mut self, input: crate::types::AssessmentFramework) -> Self {
        self.framework = ::std::option::Option::Some(input);
        self
    }
    /// <p>The framework that the assessment was created from.</p>
    pub fn set_framework(mut self, input: ::std::option::Option<crate::types::AssessmentFramework>) -> Self {
        self.framework = input;
        self
    }
    /// <p>The framework that the assessment was created from.</p>
    pub fn get_framework(&self) -> &::std::option::Option<crate::types::AssessmentFramework> {
        &self.framework
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags that are associated with the assessment.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The tags that are associated with the assessment.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags that are associated with the assessment.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`Assessment`](crate::types::Assessment).
    pub fn build(self) -> crate::types::Assessment {
        crate::types::Assessment {
            arn: self.arn,
            aws_account: self.aws_account,
            metadata: self.metadata,
            framework: self.framework,
            tags: self.tags,
        }
    }
}
impl ::std::fmt::Debug for AssessmentBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("AssessmentBuilder");
        formatter.field("arn", &self.arn);
        formatter.field("aws_account", &self.aws_account);
        formatter.field("metadata", &self.metadata);
        formatter.field("framework", &"*** Sensitive Data Redacted ***");
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}