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

/// <p>Used for CAPTCHA and challenge token settings. Determines how long a <code>CAPTCHA</code> or challenge timestamp remains valid after WAF updates it for a successful <code>CAPTCHA</code> or challenge response.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ImmunityTimeProperty {
    /// <p>The amount of time, in seconds, that a <code>CAPTCHA</code> or challenge timestamp is considered valid by WAF. The default setting is 300.</p>
    /// <p>For the Challenge action, the minimum setting is 300.</p>
    pub immunity_time: i64,
}
impl ImmunityTimeProperty {
    /// <p>The amount of time, in seconds, that a <code>CAPTCHA</code> or challenge timestamp is considered valid by WAF. The default setting is 300.</p>
    /// <p>For the Challenge action, the minimum setting is 300.</p>
    pub fn immunity_time(&self) -> i64 {
        self.immunity_time
    }
}
impl ImmunityTimeProperty {
    /// Creates a new builder-style object to manufacture [`ImmunityTimeProperty`](crate::types::ImmunityTimeProperty).
    pub fn builder() -> crate::types::builders::ImmunityTimePropertyBuilder {
        crate::types::builders::ImmunityTimePropertyBuilder::default()
    }
}

/// A builder for [`ImmunityTimeProperty`](crate::types::ImmunityTimeProperty).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ImmunityTimePropertyBuilder {
    pub(crate) immunity_time: ::std::option::Option<i64>,
}
impl ImmunityTimePropertyBuilder {
    /// <p>The amount of time, in seconds, that a <code>CAPTCHA</code> or challenge timestamp is considered valid by WAF. The default setting is 300.</p>
    /// <p>For the Challenge action, the minimum setting is 300.</p>
    /// This field is required.
    pub fn immunity_time(mut self, input: i64) -> Self {
        self.immunity_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The amount of time, in seconds, that a <code>CAPTCHA</code> or challenge timestamp is considered valid by WAF. The default setting is 300.</p>
    /// <p>For the Challenge action, the minimum setting is 300.</p>
    pub fn set_immunity_time(mut self, input: ::std::option::Option<i64>) -> Self {
        self.immunity_time = input;
        self
    }
    /// <p>The amount of time, in seconds, that a <code>CAPTCHA</code> or challenge timestamp is considered valid by WAF. The default setting is 300.</p>
    /// <p>For the Challenge action, the minimum setting is 300.</p>
    pub fn get_immunity_time(&self) -> &::std::option::Option<i64> {
        &self.immunity_time
    }
    /// Consumes the builder and constructs a [`ImmunityTimeProperty`](crate::types::ImmunityTimeProperty).
    /// This method will fail if any of the following fields are not set:
    /// - [`immunity_time`](crate::types::builders::ImmunityTimePropertyBuilder::immunity_time)
    pub fn build(self) -> ::std::result::Result<crate::types::ImmunityTimeProperty, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::ImmunityTimeProperty {
            immunity_time: self.immunity_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "immunity_time",
                    "immunity_time was not specified but it is required when building ImmunityTimeProperty",
                )
            })?,
        })
    }
}