#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Insight {
pub usage_pattern: ::std::string::String,
pub signals_detected: ::std::option::Option<::std::string::String>,
}
impl Insight {
pub fn usage_pattern(&self) -> &str {
use std::ops::Deref;
self.usage_pattern.deref()
}
pub fn signals_detected(&self) -> ::std::option::Option<&str> {
self.signals_detected.as_deref()
}
}
impl Insight {
pub fn builder() -> crate::types::builders::InsightBuilder {
crate::types::builders::InsightBuilder::default()
}
}
#[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 {
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
}
pub fn set_usage_pattern(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.usage_pattern = input;
self
}
pub fn get_usage_pattern(&self) -> &::std::option::Option<::std::string::String> {
&self.usage_pattern
}
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
}
pub fn set_signals_detected(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.signals_detected = input;
self
}
pub fn get_signals_detected(&self) -> &::std::option::Option<::std::string::String> {
&self.signals_detected
}
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,
})
}
}