Struct aws_sdk_shield::model::attack_volume::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for AttackVolume
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn bits_per_second(self, input: AttackVolumeStatistics) -> Self
pub fn bits_per_second(self, input: AttackVolumeStatistics) -> Self
A statistics object that uses bits per second as the unit. This is included for network level attacks.
sourcepub fn set_bits_per_second(self, input: Option<AttackVolumeStatistics>) -> Self
pub fn set_bits_per_second(self, input: Option<AttackVolumeStatistics>) -> Self
A statistics object that uses bits per second as the unit. This is included for network level attacks.
Examples found in repository?
3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468
pub(crate) fn deser_structure_crate_model_attack_volume<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::AttackVolume>, 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_volume::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() {
"BitsPerSecond" => {
builder = builder.set_bits_per_second(
crate::json_deser::deser_structure_crate_model_attack_volume_statistics(tokens)?
);
}
"PacketsPerSecond" => {
builder = builder.set_packets_per_second(
crate::json_deser::deser_structure_crate_model_attack_volume_statistics(tokens)?
);
}
"RequestsPerSecond" => {
builder = builder.set_requests_per_second(
crate::json_deser::deser_structure_crate_model_attack_volume_statistics(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 packets_per_second(self, input: AttackVolumeStatistics) -> Self
pub fn packets_per_second(self, input: AttackVolumeStatistics) -> Self
A statistics object that uses packets per second as the unit. This is included for network level attacks.
sourcepub fn set_packets_per_second(
self,
input: Option<AttackVolumeStatistics>
) -> Self
pub fn set_packets_per_second(
self,
input: Option<AttackVolumeStatistics>
) -> Self
A statistics object that uses packets per second as the unit. This is included for network level attacks.
Examples found in repository?
3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468
pub(crate) fn deser_structure_crate_model_attack_volume<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::AttackVolume>, 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_volume::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() {
"BitsPerSecond" => {
builder = builder.set_bits_per_second(
crate::json_deser::deser_structure_crate_model_attack_volume_statistics(tokens)?
);
}
"PacketsPerSecond" => {
builder = builder.set_packets_per_second(
crate::json_deser::deser_structure_crate_model_attack_volume_statistics(tokens)?
);
}
"RequestsPerSecond" => {
builder = builder.set_requests_per_second(
crate::json_deser::deser_structure_crate_model_attack_volume_statistics(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 requests_per_second(self, input: AttackVolumeStatistics) -> Self
pub fn requests_per_second(self, input: AttackVolumeStatistics) -> Self
A statistics object that uses requests per second as the unit. This is included for application level attacks, and is only available for accounts that are subscribed to Shield Advanced.
sourcepub fn set_requests_per_second(
self,
input: Option<AttackVolumeStatistics>
) -> Self
pub fn set_requests_per_second(
self,
input: Option<AttackVolumeStatistics>
) -> Self
A statistics object that uses requests per second as the unit. This is included for application level attacks, and is only available for accounts that are subscribed to Shield Advanced.
Examples found in repository?
3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468
pub(crate) fn deser_structure_crate_model_attack_volume<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::AttackVolume>, 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_volume::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() {
"BitsPerSecond" => {
builder = builder.set_bits_per_second(
crate::json_deser::deser_structure_crate_model_attack_volume_statistics(tokens)?
);
}
"PacketsPerSecond" => {
builder = builder.set_packets_per_second(
crate::json_deser::deser_structure_crate_model_attack_volume_statistics(tokens)?
);
}
"RequestsPerSecond" => {
builder = builder.set_requests_per_second(
crate::json_deser::deser_structure_crate_model_attack_volume_statistics(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) -> AttackVolume
pub fn build(self) -> AttackVolume
Consumes the builder and constructs a AttackVolume
.
Examples found in repository?
3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468
pub(crate) fn deser_structure_crate_model_attack_volume<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::AttackVolume>, 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_volume::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() {
"BitsPerSecond" => {
builder = builder.set_bits_per_second(
crate::json_deser::deser_structure_crate_model_attack_volume_statistics(tokens)?
);
}
"PacketsPerSecond" => {
builder = builder.set_packets_per_second(
crate::json_deser::deser_structure_crate_model_attack_volume_statistics(tokens)?
);
}
"RequestsPerSecond" => {
builder = builder.set_requests_per_second(
crate::json_deser::deser_structure_crate_model_attack_volume_statistics(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",
),
),
}
}