Struct aws_sdk_shield::model::protection_group_limits::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for ProtectionGroupLimits
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn max_protection_groups(self, input: i64) -> Self
pub fn max_protection_groups(self, input: i64) -> Self
The maximum number of protection groups that you can have at one time.
sourcepub fn set_max_protection_groups(self, input: Option<i64>) -> Self
pub fn set_max_protection_groups(self, input: Option<i64>) -> Self
The maximum number of protection groups that you can have at one time.
Examples found in repository?
src/json_deser.rs (lines 3672-3678)
3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706
pub(crate) fn deser_structure_crate_model_protection_group_limits<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::ProtectionGroupLimits>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::protection_group_limits::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"MaxProtectionGroups" => {
builder = builder.set_max_protection_groups(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"PatternTypeLimits" => {
builder = builder.set_pattern_type_limits(
crate::json_deser::deser_structure_crate_model_protection_group_pattern_type_limits(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn pattern_type_limits(self, input: ProtectionGroupPatternTypeLimits) -> Self
pub fn pattern_type_limits(self, input: ProtectionGroupPatternTypeLimits) -> Self
Limits settings by pattern type in the protection groups for your subscription.
sourcepub fn set_pattern_type_limits(
self,
input: Option<ProtectionGroupPatternTypeLimits>
) -> Self
pub fn set_pattern_type_limits(
self,
input: Option<ProtectionGroupPatternTypeLimits>
) -> Self
Limits settings by pattern type in the protection groups for your subscription.
Examples found in repository?
src/json_deser.rs (lines 3681-3683)
3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706
pub(crate) fn deser_structure_crate_model_protection_group_limits<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::ProtectionGroupLimits>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::protection_group_limits::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"MaxProtectionGroups" => {
builder = builder.set_max_protection_groups(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"PatternTypeLimits" => {
builder = builder.set_pattern_type_limits(
crate::json_deser::deser_structure_crate_model_protection_group_pattern_type_limits(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn build(self) -> ProtectionGroupLimits
pub fn build(self) -> ProtectionGroupLimits
Consumes the builder and constructs a ProtectionGroupLimits
.
Examples found in repository?
src/json_deser.rs (line 3698)
3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706
pub(crate) fn deser_structure_crate_model_protection_group_limits<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::ProtectionGroupLimits>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::protection_group_limits::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"MaxProtectionGroups" => {
builder = builder.set_max_protection_groups(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"PatternTypeLimits" => {
builder = builder.set_pattern_type_limits(
crate::json_deser::deser_structure_crate_model_protection_group_pattern_type_limits(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}