Struct aws_sdk_shield::model::attack_statistics_data_item::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for AttackStatisticsDataItem
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn attack_volume(self, input: AttackVolume) -> Self
pub fn attack_volume(self, input: AttackVolume) -> Self
Information about the volume of attacks during the time period. If the accompanying AttackCount
is zero, this setting might be empty.
sourcepub fn set_attack_volume(self, input: Option<AttackVolume>) -> Self
pub fn set_attack_volume(self, input: Option<AttackVolume>) -> Self
Information about the volume of attacks during the time period. If the accompanying AttackCount
is zero, this setting might be empty.
Examples found in repository?
src/json_deser.rs (lines 2561-2565)
2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597
pub(crate) fn deser_structure_crate_model_attack_statistics_data_item<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AttackStatisticsDataItem>,
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::attack_statistics_data_item::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() {
"AttackVolume" => {
builder = builder.set_attack_volume(
crate::json_deser::deser_structure_crate_model_attack_volume(
tokens,
)?,
);
}
"AttackCount" => {
builder = builder.set_attack_count(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
_ => 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 attack_count(self, input: i64) -> Self
pub fn attack_count(self, input: i64) -> Self
The number of attacks detected during the time period. This is always present, but might be zero.
sourcepub fn set_attack_count(self, input: Option<i64>) -> Self
pub fn set_attack_count(self, input: Option<i64>) -> Self
The number of attacks detected during the time period. This is always present, but might be zero.
Examples found in repository?
src/json_deser.rs (lines 2568-2574)
2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597
pub(crate) fn deser_structure_crate_model_attack_statistics_data_item<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AttackStatisticsDataItem>,
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::attack_statistics_data_item::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() {
"AttackVolume" => {
builder = builder.set_attack_volume(
crate::json_deser::deser_structure_crate_model_attack_volume(
tokens,
)?,
);
}
"AttackCount" => {
builder = builder.set_attack_count(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
_ => 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) -> AttackStatisticsDataItem
pub fn build(self) -> AttackStatisticsDataItem
Consumes the builder and constructs a AttackStatisticsDataItem
.
Examples found in repository?
src/json_deser.rs (line 2589)
2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597
pub(crate) fn deser_structure_crate_model_attack_statistics_data_item<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AttackStatisticsDataItem>,
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::attack_statistics_data_item::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() {
"AttackVolume" => {
builder = builder.set_attack_volume(
crate::json_deser::deser_structure_crate_model_attack_volume(
tokens,
)?,
);
}
"AttackCount" => {
builder = builder.set_attack_count(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
_ => 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",
),
),
}
}