#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetRuleSetOutput {
pub rule_set_id: ::std::string::String,
pub rule_set_arn: ::std::string::String,
pub rule_set_name: ::std::string::String,
pub created_date: ::aws_smithy_types::DateTime,
pub last_modification_date: ::aws_smithy_types::DateTime,
pub rules: ::std::vec::Vec<crate::types::Rule>,
_request_id: Option<String>,
}
impl GetRuleSetOutput {
pub fn rule_set_id(&self) -> &str {
use std::ops::Deref;
self.rule_set_id.deref()
}
pub fn rule_set_arn(&self) -> &str {
use std::ops::Deref;
self.rule_set_arn.deref()
}
pub fn rule_set_name(&self) -> &str {
use std::ops::Deref;
self.rule_set_name.deref()
}
pub fn created_date(&self) -> &::aws_smithy_types::DateTime {
&self.created_date
}
pub fn last_modification_date(&self) -> &::aws_smithy_types::DateTime {
&self.last_modification_date
}
pub fn rules(&self) -> &[crate::types::Rule] {
use std::ops::Deref;
self.rules.deref()
}
}
impl ::aws_types::request_id::RequestId for GetRuleSetOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetRuleSetOutput {
pub fn builder() -> crate::operation::get_rule_set::builders::GetRuleSetOutputBuilder {
crate::operation::get_rule_set::builders::GetRuleSetOutputBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct GetRuleSetOutputBuilder {
pub(crate) rule_set_id: ::std::option::Option<::std::string::String>,
pub(crate) rule_set_arn: ::std::option::Option<::std::string::String>,
pub(crate) rule_set_name: ::std::option::Option<::std::string::String>,
pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) last_modification_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) rules: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>,
_request_id: Option<String>,
}
impl GetRuleSetOutputBuilder {
pub fn rule_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.rule_set_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_rule_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.rule_set_id = input;
self
}
pub fn get_rule_set_id(&self) -> &::std::option::Option<::std::string::String> {
&self.rule_set_id
}
pub fn rule_set_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.rule_set_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_rule_set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.rule_set_arn = input;
self
}
pub fn get_rule_set_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.rule_set_arn
}
pub fn rule_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.rule_set_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_rule_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.rule_set_name = input;
self
}
pub fn get_rule_set_name(&self) -> &::std::option::Option<::std::string::String> {
&self.rule_set_name
}
pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_date = ::std::option::Option::Some(input);
self
}
pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_date = input;
self
}
pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_date
}
pub fn last_modification_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_modification_date = ::std::option::Option::Some(input);
self
}
pub fn set_last_modification_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_modification_date = input;
self
}
pub fn get_last_modification_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_modification_date
}
pub fn rules(mut self, input: crate::types::Rule) -> Self {
let mut v = self.rules.unwrap_or_default();
v.push(input);
self.rules = ::std::option::Option::Some(v);
self
}
pub fn set_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>) -> Self {
self.rules = input;
self
}
pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Rule>> {
&self.rules
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(self) -> ::std::result::Result<crate::operation::get_rule_set::GetRuleSetOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_rule_set::GetRuleSetOutput {
rule_set_id: self.rule_set_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"rule_set_id",
"rule_set_id was not specified but it is required when building GetRuleSetOutput",
)
})?,
rule_set_arn: self.rule_set_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"rule_set_arn",
"rule_set_arn was not specified but it is required when building GetRuleSetOutput",
)
})?,
rule_set_name: self.rule_set_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"rule_set_name",
"rule_set_name was not specified but it is required when building GetRuleSetOutput",
)
})?,
created_date: self.created_date.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_date",
"created_date was not specified but it is required when building GetRuleSetOutput",
)
})?,
last_modification_date: self.last_modification_date.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"last_modification_date",
"last_modification_date was not specified but it is required when building GetRuleSetOutput",
)
})?,
rules: self.rules.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"rules",
"rules was not specified but it is required when building GetRuleSetOutput",
)
})?,
_request_id: self._request_id,
})
}
}