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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Specifies that WAF should allow the request and optionally defines additional custom handling for the request.</p>
/// <p>This is used in the context of other settings, for example to specify values for <code>RuleAction</code> and web ACL <code>DefaultAction</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AllowAction {
    /// <p>Defines custom handling for the web request.</p>
    /// <p>For information about customizing web requests and responses, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html">Customizing web requests and responses in WAF</a> in the <i>WAF Developer Guide</i>.</p>
    pub custom_request_handling: ::std::option::Option<crate::types::CustomRequestHandling>,
}
impl AllowAction {
    /// <p>Defines custom handling for the web request.</p>
    /// <p>For information about customizing web requests and responses, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html">Customizing web requests and responses in WAF</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn custom_request_handling(&self) -> ::std::option::Option<&crate::types::CustomRequestHandling> {
        self.custom_request_handling.as_ref()
    }
}
impl AllowAction {
    /// Creates a new builder-style object to manufacture [`AllowAction`](crate::types::AllowAction).
    pub fn builder() -> crate::types::builders::AllowActionBuilder {
        crate::types::builders::AllowActionBuilder::default()
    }
}

/// A builder for [`AllowAction`](crate::types::AllowAction).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AllowActionBuilder {
    pub(crate) custom_request_handling: ::std::option::Option<crate::types::CustomRequestHandling>,
}
impl AllowActionBuilder {
    /// <p>Defines custom handling for the web request.</p>
    /// <p>For information about customizing web requests and responses, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html">Customizing web requests and responses in WAF</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn custom_request_handling(mut self, input: crate::types::CustomRequestHandling) -> Self {
        self.custom_request_handling = ::std::option::Option::Some(input);
        self
    }
    /// <p>Defines custom handling for the web request.</p>
    /// <p>For information about customizing web requests and responses, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html">Customizing web requests and responses in WAF</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn set_custom_request_handling(mut self, input: ::std::option::Option<crate::types::CustomRequestHandling>) -> Self {
        self.custom_request_handling = input;
        self
    }
    /// <p>Defines custom handling for the web request.</p>
    /// <p>For information about customizing web requests and responses, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html">Customizing web requests and responses in WAF</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn get_custom_request_handling(&self) -> &::std::option::Option<crate::types::CustomRequestHandling> {
        &self.custom_request_handling
    }
    /// Consumes the builder and constructs a [`AllowAction`](crate::types::AllowAction).
    pub fn build(self) -> crate::types::AllowAction {
        crate::types::AllowAction {
            custom_request_handling: self.custom_request_handling,
        }
    }
}