aws-sdk-wellarchitected 1.110.0

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

/// <p>An insight describing a usage pattern and the signals detected.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Insight {
    /// <p>A description of the usage pattern.</p>
    pub usage_pattern: ::std::string::String,
    /// <p>A description of the signals detected.</p>
    pub signals_detected: ::std::option::Option<::std::string::String>,
}
impl Insight {
    /// <p>A description of the usage pattern.</p>
    pub fn usage_pattern(&self) -> &str {
        use std::ops::Deref;
        self.usage_pattern.deref()
    }
    /// <p>A description of the signals detected.</p>
    pub fn signals_detected(&self) -> ::std::option::Option<&str> {
        self.signals_detected.as_deref()
    }
}
impl Insight {
    /// Creates a new builder-style object to manufacture [`Insight`](crate::types::Insight).
    pub fn builder() -> crate::types::builders::InsightBuilder {
        crate::types::builders::InsightBuilder::default()
    }
}

/// A builder for [`Insight`](crate::types::Insight).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct InsightBuilder {
    pub(crate) usage_pattern: ::std::option::Option<::std::string::String>,
    pub(crate) signals_detected: ::std::option::Option<::std::string::String>,
}
impl InsightBuilder {
    /// <p>A description of the usage pattern.</p>
    /// This field is required.
    pub fn usage_pattern(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.usage_pattern = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the usage pattern.</p>
    pub fn set_usage_pattern(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.usage_pattern = input;
        self
    }
    /// <p>A description of the usage pattern.</p>
    pub fn get_usage_pattern(&self) -> &::std::option::Option<::std::string::String> {
        &self.usage_pattern
    }
    /// <p>A description of the signals detected.</p>
    pub fn signals_detected(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.signals_detected = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the signals detected.</p>
    pub fn set_signals_detected(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.signals_detected = input;
        self
    }
    /// <p>A description of the signals detected.</p>
    pub fn get_signals_detected(&self) -> &::std::option::Option<::std::string::String> {
        &self.signals_detected
    }
    /// Consumes the builder and constructs a [`Insight`](crate::types::Insight).
    /// This method will fail if any of the following fields are not set:
    /// - [`usage_pattern`](crate::types::builders::InsightBuilder::usage_pattern)
    pub fn build(self) -> ::std::result::Result<crate::types::Insight, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Insight {
            usage_pattern: self.usage_pattern.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "usage_pattern",
                    "usage_pattern was not specified but it is required when building Insight",
                )
            })?,
            signals_detected: self.signals_detected,
        })
    }
}