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
// 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>Specifies the type of update to perform to an <code>IPSet</code> with <code>UpdateIPSet</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct IpSetUpdate {
    /// <p>Specifies whether to insert or delete an IP address with <code>UpdateIPSet</code>.</p>
    pub action: crate::types::ChangeAction,
    /// <p>The IP address type (<code>IPV4</code> or <code>IPV6</code>) and the IP address range (in CIDR notation) that web requests originate from.</p>
    pub ip_set_descriptor: ::std::option::Option<crate::types::IpSetDescriptor>,
}
impl IpSetUpdate {
    /// <p>Specifies whether to insert or delete an IP address with <code>UpdateIPSet</code>.</p>
    pub fn action(&self) -> &crate::types::ChangeAction {
        &self.action
    }
    /// <p>The IP address type (<code>IPV4</code> or <code>IPV6</code>) and the IP address range (in CIDR notation) that web requests originate from.</p>
    pub fn ip_set_descriptor(&self) -> ::std::option::Option<&crate::types::IpSetDescriptor> {
        self.ip_set_descriptor.as_ref()
    }
}
impl IpSetUpdate {
    /// Creates a new builder-style object to manufacture [`IpSetUpdate`](crate::types::IpSetUpdate).
    pub fn builder() -> crate::types::builders::IpSetUpdateBuilder {
        crate::types::builders::IpSetUpdateBuilder::default()
    }
}

/// A builder for [`IpSetUpdate`](crate::types::IpSetUpdate).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct IpSetUpdateBuilder {
    pub(crate) action: ::std::option::Option<crate::types::ChangeAction>,
    pub(crate) ip_set_descriptor: ::std::option::Option<crate::types::IpSetDescriptor>,
}
impl IpSetUpdateBuilder {
    /// <p>Specifies whether to insert or delete an IP address with <code>UpdateIPSet</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 an IP address with <code>UpdateIPSet</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 an IP address with <code>UpdateIPSet</code>.</p>
    pub fn get_action(&self) -> &::std::option::Option<crate::types::ChangeAction> {
        &self.action
    }
    /// <p>The IP address type (<code>IPV4</code> or <code>IPV6</code>) and the IP address range (in CIDR notation) that web requests originate from.</p>
    /// This field is required.
    pub fn ip_set_descriptor(mut self, input: crate::types::IpSetDescriptor) -> Self {
        self.ip_set_descriptor = ::std::option::Option::Some(input);
        self
    }
    /// <p>The IP address type (<code>IPV4</code> or <code>IPV6</code>) and the IP address range (in CIDR notation) that web requests originate from.</p>
    pub fn set_ip_set_descriptor(mut self, input: ::std::option::Option<crate::types::IpSetDescriptor>) -> Self {
        self.ip_set_descriptor = input;
        self
    }
    /// <p>The IP address type (<code>IPV4</code> or <code>IPV6</code>) and the IP address range (in CIDR notation) that web requests originate from.</p>
    pub fn get_ip_set_descriptor(&self) -> &::std::option::Option<crate::types::IpSetDescriptor> {
        &self.ip_set_descriptor
    }
    /// Consumes the builder and constructs a [`IpSetUpdate`](crate::types::IpSetUpdate).
    /// This method will fail if any of the following fields are not set:
    /// - [`action`](crate::types::builders::IpSetUpdateBuilder::action)
    pub fn build(self) -> ::std::result::Result<crate::types::IpSetUpdate, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::IpSetUpdate {
            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 IpSetUpdate",
                )
            })?,
            ip_set_descriptor: self.ip_set_descriptor,
        })
    }
}