#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AnalysisRule {
pub collaboration_id: ::std::string::String,
pub r#type: crate::types::AnalysisRuleType,
pub name: ::std::string::String,
pub create_time: ::aws_smithy_types::DateTime,
pub update_time: ::aws_smithy_types::DateTime,
pub policy: ::std::option::Option<crate::types::AnalysisRulePolicy>,
}
impl AnalysisRule {
pub fn collaboration_id(&self) -> &str {
use std::ops::Deref;
self.collaboration_id.deref()
}
pub fn r#type(&self) -> &crate::types::AnalysisRuleType {
&self.r#type
}
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
pub fn create_time(&self) -> &::aws_smithy_types::DateTime {
&self.create_time
}
pub fn update_time(&self) -> &::aws_smithy_types::DateTime {
&self.update_time
}
pub fn policy(&self) -> ::std::option::Option<&crate::types::AnalysisRulePolicy> {
self.policy.as_ref()
}
}
impl AnalysisRule {
pub fn builder() -> crate::types::builders::AnalysisRuleBuilder {
crate::types::builders::AnalysisRuleBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AnalysisRuleBuilder {
pub(crate) collaboration_id: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<crate::types::AnalysisRuleType>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) update_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) policy: ::std::option::Option<crate::types::AnalysisRulePolicy>,
}
impl AnalysisRuleBuilder {
pub fn collaboration_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.collaboration_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_collaboration_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.collaboration_id = input;
self
}
pub fn get_collaboration_id(&self) -> &::std::option::Option<::std::string::String> {
&self.collaboration_id
}
pub fn r#type(mut self, input: crate::types::AnalysisRuleType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
pub fn set_type(mut self, input: ::std::option::Option<crate::types::AnalysisRuleType>) -> Self {
self.r#type = input;
self
}
pub fn get_type(&self) -> &::std::option::Option<crate::types::AnalysisRuleType> {
&self.r#type
}
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
pub fn create_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.create_time = ::std::option::Option::Some(input);
self
}
pub fn set_create_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.create_time = input;
self
}
pub fn get_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.create_time
}
pub fn update_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.update_time = ::std::option::Option::Some(input);
self
}
pub fn set_update_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.update_time = input;
self
}
pub fn get_update_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.update_time
}
pub fn policy(mut self, input: crate::types::AnalysisRulePolicy) -> Self {
self.policy = ::std::option::Option::Some(input);
self
}
pub fn set_policy(mut self, input: ::std::option::Option<crate::types::AnalysisRulePolicy>) -> Self {
self.policy = input;
self
}
pub fn get_policy(&self) -> &::std::option::Option<crate::types::AnalysisRulePolicy> {
&self.policy
}
pub fn build(self) -> ::std::result::Result<crate::types::AnalysisRule, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::AnalysisRule {
collaboration_id: self.collaboration_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"collaboration_id",
"collaboration_id was not specified but it is required when building AnalysisRule",
)
})?,
r#type: self.r#type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"r#type",
"r#type was not specified but it is required when building AnalysisRule",
)
})?,
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building AnalysisRule",
)
})?,
create_time: self.create_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"create_time",
"create_time was not specified but it is required when building AnalysisRule",
)
})?,
update_time: self.update_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"update_time",
"update_time was not specified but it is required when building AnalysisRule",
)
})?,
policy: self.policy,
})
}
}