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

/// <note>
/// <p>This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS WAF Classic</a> in the developer guide.</p>
/// <p> <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints for regional and global use. </p>
/// </note>
/// <p>In an <code>UpdateRegexPatternSet</code> request, <code>RegexPatternSetUpdate</code> specifies whether to insert or delete a <code>RegexPatternString</code> and includes the settings for the <code>RegexPatternString</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RegexPatternSetUpdate {
    /// <p>Specifies whether to insert or delete a <code>RegexPatternString</code>.</p>
    pub action: crate::types::ChangeAction,
    /// <p>Specifies the regular expression (regex) pattern that you want AWS WAF to search for, such as <code>B[a@]dB[o0]t</code>.</p>
    pub regex_pattern_string: ::std::string::String,
}
impl RegexPatternSetUpdate {
    /// <p>Specifies whether to insert or delete a <code>RegexPatternString</code>.</p>
    pub fn action(&self) -> &crate::types::ChangeAction {
        &self.action
    }
    /// <p>Specifies the regular expression (regex) pattern that you want AWS WAF to search for, such as <code>B[a@]dB[o0]t</code>.</p>
    pub fn regex_pattern_string(&self) -> &str {
        use std::ops::Deref;
        self.regex_pattern_string.deref()
    }
}
impl RegexPatternSetUpdate {
    /// Creates a new builder-style object to manufacture [`RegexPatternSetUpdate`](crate::types::RegexPatternSetUpdate).
    pub fn builder() -> crate::types::builders::RegexPatternSetUpdateBuilder {
        crate::types::builders::RegexPatternSetUpdateBuilder::default()
    }
}

/// A builder for [`RegexPatternSetUpdate`](crate::types::RegexPatternSetUpdate).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct RegexPatternSetUpdateBuilder {
    pub(crate) action: ::std::option::Option<crate::types::ChangeAction>,
    pub(crate) regex_pattern_string: ::std::option::Option<::std::string::String>,
}
impl RegexPatternSetUpdateBuilder {
    /// <p>Specifies whether to insert or delete a <code>RegexPatternString</code>.</p>
    /// This field is required.
    pub fn action(mut self, input: crate::types::ChangeAction) -> Self {
        self.action = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether to insert or delete a <code>RegexPatternString</code>.</p>
    pub fn set_action(mut self, input: ::std::option::Option<crate::types::ChangeAction>) -> Self {
        self.action = input;
        self
    }
    /// <p>Specifies whether to insert or delete a <code>RegexPatternString</code>.</p>
    pub fn get_action(&self) -> &::std::option::Option<crate::types::ChangeAction> {
        &self.action
    }
    /// <p>Specifies the regular expression (regex) pattern that you want AWS WAF to search for, such as <code>B[a@]dB[o0]t</code>.</p>
    /// This field is required.
    pub fn regex_pattern_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.regex_pattern_string = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies the regular expression (regex) pattern that you want AWS WAF to search for, such as <code>B[a@]dB[o0]t</code>.</p>
    pub fn set_regex_pattern_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.regex_pattern_string = input;
        self
    }
    /// <p>Specifies the regular expression (regex) pattern that you want AWS WAF to search for, such as <code>B[a@]dB[o0]t</code>.</p>
    pub fn get_regex_pattern_string(&self) -> &::std::option::Option<::std::string::String> {
        &self.regex_pattern_string
    }
    /// Consumes the builder and constructs a [`RegexPatternSetUpdate`](crate::types::RegexPatternSetUpdate).
    /// This method will fail if any of the following fields are not set:
    /// - [`action`](crate::types::builders::RegexPatternSetUpdateBuilder::action)
    /// - [`regex_pattern_string`](crate::types::builders::RegexPatternSetUpdateBuilder::regex_pattern_string)
    pub fn build(self) -> ::std::result::Result<crate::types::RegexPatternSetUpdate, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::RegexPatternSetUpdate {
            action: self.action.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "action",
                    "action was not specified but it is required when building RegexPatternSetUpdate",
                )
            })?,
            regex_pattern_string: self.regex_pattern_string.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "regex_pattern_string",
                    "regex_pattern_string was not specified but it is required when building RegexPatternSetUpdate",
                )
            })?,
        })
    }
}