1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A single attack statistics data record. This is returned by <code>DescribeAttackStatistics</code> along with a time range indicating the time period that the attack statistics apply to. </p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AttackStatisticsDataItem {
    /// <p>Information about the volume of attacks during the time period. If the accompanying <code>AttackCount</code> is zero, this setting might be empty.</p>
    pub attack_volume: ::std::option::Option<crate::types::AttackVolume>,
    /// <p>The number of attacks detected during the time period. This is always present, but might be zero. </p>
    pub attack_count: i64,
}
impl AttackStatisticsDataItem {
    /// <p>Information about the volume of attacks during the time period. If the accompanying <code>AttackCount</code> is zero, this setting might be empty.</p>
    pub fn attack_volume(&self) -> ::std::option::Option<&crate::types::AttackVolume> {
        self.attack_volume.as_ref()
    }
    /// <p>The number of attacks detected during the time period. This is always present, but might be zero. </p>
    pub fn attack_count(&self) -> i64 {
        self.attack_count
    }
}
impl AttackStatisticsDataItem {
    /// Creates a new builder-style object to manufacture [`AttackStatisticsDataItem`](crate::types::AttackStatisticsDataItem).
    pub fn builder() -> crate::types::builders::AttackStatisticsDataItemBuilder {
        crate::types::builders::AttackStatisticsDataItemBuilder::default()
    }
}

/// A builder for [`AttackStatisticsDataItem`](crate::types::AttackStatisticsDataItem).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AttackStatisticsDataItemBuilder {
    pub(crate) attack_volume: ::std::option::Option<crate::types::AttackVolume>,
    pub(crate) attack_count: ::std::option::Option<i64>,
}
impl AttackStatisticsDataItemBuilder {
    /// <p>Information about the volume of attacks during the time period. If the accompanying <code>AttackCount</code> is zero, this setting might be empty.</p>
    pub fn attack_volume(mut self, input: crate::types::AttackVolume) -> Self {
        self.attack_volume = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about the volume of attacks during the time period. If the accompanying <code>AttackCount</code> is zero, this setting might be empty.</p>
    pub fn set_attack_volume(mut self, input: ::std::option::Option<crate::types::AttackVolume>) -> Self {
        self.attack_volume = input;
        self
    }
    /// <p>Information about the volume of attacks during the time period. If the accompanying <code>AttackCount</code> is zero, this setting might be empty.</p>
    pub fn get_attack_volume(&self) -> &::std::option::Option<crate::types::AttackVolume> {
        &self.attack_volume
    }
    /// <p>The number of attacks detected during the time period. This is always present, but might be zero. </p>
    pub fn attack_count(mut self, input: i64) -> Self {
        self.attack_count = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of attacks detected during the time period. This is always present, but might be zero. </p>
    pub fn set_attack_count(mut self, input: ::std::option::Option<i64>) -> Self {
        self.attack_count = input;
        self
    }
    /// <p>The number of attacks detected during the time period. This is always present, but might be zero. </p>
    pub fn get_attack_count(&self) -> &::std::option::Option<i64> {
        &self.attack_count
    }
    /// Consumes the builder and constructs a [`AttackStatisticsDataItem`](crate::types::AttackStatisticsDataItem).
    pub fn build(self) -> crate::types::AttackStatisticsDataItem {
        crate::types::AttackStatisticsDataItem {
            attack_volume: self.attack_volume,
            attack_count: self.attack_count.unwrap_or_default(),
        }
    }
}