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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The criteria for inspecting responses to login requests and account creation requests, used by the ATP and ACFP rule groups to track login and account creation success and failure rates.</p><note>
/// <p>Response inspection is available only in web ACLs that protect Amazon CloudFront distributions.</p>
/// </note>
/// <p>The rule groups evaluates the responses that your protected resources send back to client login and account creation attempts, keeping count of successful and failed attempts from each IP address and client session. Using this information, the rule group labels and mitigates requests from client sessions and IP addresses with too much suspicious activity in a short amount of time.</p>
/// <p>This is part of the <code>AWSManagedRulesATPRuleSet</code> and <code>AWSManagedRulesACFPRuleSet</code> configurations in <code>ManagedRuleGroupConfig</code>.</p>
/// <p>Enable response inspection by configuring exactly one component of the response to inspect, for example, <code>Header</code> or <code>StatusCode</code>. You can't configure more than one component for inspection. If you don't configure any of the response inspection options, response inspection is disabled.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ResponseInspection {
    /// <p>Configures inspection of the response status code for success and failure indicators.</p>
    pub status_code: ::std::option::Option<crate::types::ResponseInspectionStatusCode>,
    /// <p>Configures inspection of the response header for success and failure indicators.</p>
    pub header: ::std::option::Option<crate::types::ResponseInspectionHeader>,
    /// <p>Configures inspection of the response body for success and failure indicators. WAF can inspect the first 65,536 bytes (64 KB) of the response body.</p>
    pub body_contains: ::std::option::Option<crate::types::ResponseInspectionBodyContains>,
    /// <p>Configures inspection of the response JSON for success and failure indicators. WAF can inspect the first 65,536 bytes (64 KB) of the response JSON.</p>
    pub json: ::std::option::Option<crate::types::ResponseInspectionJson>,
}
impl ResponseInspection {
    /// <p>Configures inspection of the response status code for success and failure indicators.</p>
    pub fn status_code(&self) -> ::std::option::Option<&crate::types::ResponseInspectionStatusCode> {
        self.status_code.as_ref()
    }
    /// <p>Configures inspection of the response header for success and failure indicators.</p>
    pub fn header(&self) -> ::std::option::Option<&crate::types::ResponseInspectionHeader> {
        self.header.as_ref()
    }
    /// <p>Configures inspection of the response body for success and failure indicators. WAF can inspect the first 65,536 bytes (64 KB) of the response body.</p>
    pub fn body_contains(&self) -> ::std::option::Option<&crate::types::ResponseInspectionBodyContains> {
        self.body_contains.as_ref()
    }
    /// <p>Configures inspection of the response JSON for success and failure indicators. WAF can inspect the first 65,536 bytes (64 KB) of the response JSON.</p>
    pub fn json(&self) -> ::std::option::Option<&crate::types::ResponseInspectionJson> {
        self.json.as_ref()
    }
}
impl ResponseInspection {
    /// Creates a new builder-style object to manufacture [`ResponseInspection`](crate::types::ResponseInspection).
    pub fn builder() -> crate::types::builders::ResponseInspectionBuilder {
        crate::types::builders::ResponseInspectionBuilder::default()
    }
}

/// A builder for [`ResponseInspection`](crate::types::ResponseInspection).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ResponseInspectionBuilder {
    pub(crate) status_code: ::std::option::Option<crate::types::ResponseInspectionStatusCode>,
    pub(crate) header: ::std::option::Option<crate::types::ResponseInspectionHeader>,
    pub(crate) body_contains: ::std::option::Option<crate::types::ResponseInspectionBodyContains>,
    pub(crate) json: ::std::option::Option<crate::types::ResponseInspectionJson>,
}
impl ResponseInspectionBuilder {
    /// <p>Configures inspection of the response status code for success and failure indicators.</p>
    pub fn status_code(mut self, input: crate::types::ResponseInspectionStatusCode) -> Self {
        self.status_code = ::std::option::Option::Some(input);
        self
    }
    /// <p>Configures inspection of the response status code for success and failure indicators.</p>
    pub fn set_status_code(mut self, input: ::std::option::Option<crate::types::ResponseInspectionStatusCode>) -> Self {
        self.status_code = input;
        self
    }
    /// <p>Configures inspection of the response status code for success and failure indicators.</p>
    pub fn get_status_code(&self) -> &::std::option::Option<crate::types::ResponseInspectionStatusCode> {
        &self.status_code
    }
    /// <p>Configures inspection of the response header for success and failure indicators.</p>
    pub fn header(mut self, input: crate::types::ResponseInspectionHeader) -> Self {
        self.header = ::std::option::Option::Some(input);
        self
    }
    /// <p>Configures inspection of the response header for success and failure indicators.</p>
    pub fn set_header(mut self, input: ::std::option::Option<crate::types::ResponseInspectionHeader>) -> Self {
        self.header = input;
        self
    }
    /// <p>Configures inspection of the response header for success and failure indicators.</p>
    pub fn get_header(&self) -> &::std::option::Option<crate::types::ResponseInspectionHeader> {
        &self.header
    }
    /// <p>Configures inspection of the response body for success and failure indicators. WAF can inspect the first 65,536 bytes (64 KB) of the response body.</p>
    pub fn body_contains(mut self, input: crate::types::ResponseInspectionBodyContains) -> Self {
        self.body_contains = ::std::option::Option::Some(input);
        self
    }
    /// <p>Configures inspection of the response body for success and failure indicators. WAF can inspect the first 65,536 bytes (64 KB) of the response body.</p>
    pub fn set_body_contains(mut self, input: ::std::option::Option<crate::types::ResponseInspectionBodyContains>) -> Self {
        self.body_contains = input;
        self
    }
    /// <p>Configures inspection of the response body for success and failure indicators. WAF can inspect the first 65,536 bytes (64 KB) of the response body.</p>
    pub fn get_body_contains(&self) -> &::std::option::Option<crate::types::ResponseInspectionBodyContains> {
        &self.body_contains
    }
    /// <p>Configures inspection of the response JSON for success and failure indicators. WAF can inspect the first 65,536 bytes (64 KB) of the response JSON.</p>
    pub fn json(mut self, input: crate::types::ResponseInspectionJson) -> Self {
        self.json = ::std::option::Option::Some(input);
        self
    }
    /// <p>Configures inspection of the response JSON for success and failure indicators. WAF can inspect the first 65,536 bytes (64 KB) of the response JSON.</p>
    pub fn set_json(mut self, input: ::std::option::Option<crate::types::ResponseInspectionJson>) -> Self {
        self.json = input;
        self
    }
    /// <p>Configures inspection of the response JSON for success and failure indicators. WAF can inspect the first 65,536 bytes (64 KB) of the response JSON.</p>
    pub fn get_json(&self) -> &::std::option::Option<crate::types::ResponseInspectionJson> {
        &self.json
    }
    /// Consumes the builder and constructs a [`ResponseInspection`](crate::types::ResponseInspection).
    pub fn build(self) -> crate::types::ResponseInspection {
        crate::types::ResponseInspection {
            status_code: self.status_code,
            header: self.header,
            body_contains: self.body_contains,
            json: self.json,
        }
    }
}