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

/// <p>Specifies how does the rule-based matching process should match profiles. You can choose from the following attributes to build the matching Rule:</p>
/// <ul>
/// <li>
/// <p>AccountNumber</p></li>
/// <li>
/// <p>Address.Address</p></li>
/// <li>
/// <p>Address.City</p></li>
/// <li>
/// <p>Address.Country</p></li>
/// <li>
/// <p>Address.County</p></li>
/// <li>
/// <p>Address.PostalCode</p></li>
/// <li>
/// <p>Address.State</p></li>
/// <li>
/// <p>Address.Province</p></li>
/// <li>
/// <p>BirthDate</p></li>
/// <li>
/// <p>BusinessName</p></li>
/// <li>
/// <p>EmailAddress</p></li>
/// <li>
/// <p>FirstName</p></li>
/// <li>
/// <p>Gender</p></li>
/// <li>
/// <p>LastName</p></li>
/// <li>
/// <p>MiddleName</p></li>
/// <li>
/// <p>PhoneNumber</p></li>
/// <li>
/// <p>Any customized profile attributes that start with the <code>Attributes</code></p></li>
/// </ul>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct MatchingRule {
    /// <p>A single rule level of the <code>MatchRules</code>. Configures how the rule-based matching process should match profiles.</p>
    pub rule: ::std::vec::Vec<::std::string::String>,
}
impl MatchingRule {
    /// <p>A single rule level of the <code>MatchRules</code>. Configures how the rule-based matching process should match profiles.</p>
    pub fn rule(&self) -> &[::std::string::String] {
        use std::ops::Deref;
        self.rule.deref()
    }
}
impl MatchingRule {
    /// Creates a new builder-style object to manufacture [`MatchingRule`](crate::types::MatchingRule).
    pub fn builder() -> crate::types::builders::MatchingRuleBuilder {
        crate::types::builders::MatchingRuleBuilder::default()
    }
}

/// A builder for [`MatchingRule`](crate::types::MatchingRule).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct MatchingRuleBuilder {
    pub(crate) rule: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl MatchingRuleBuilder {
    /// Appends an item to `rule`.
    ///
    /// To override the contents of this collection use [`set_rule`](Self::set_rule).
    ///
    /// <p>A single rule level of the <code>MatchRules</code>. Configures how the rule-based matching process should match profiles.</p>
    pub fn rule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.rule.unwrap_or_default();
        v.push(input.into());
        self.rule = ::std::option::Option::Some(v);
        self
    }
    /// <p>A single rule level of the <code>MatchRules</code>. Configures how the rule-based matching process should match profiles.</p>
    pub fn set_rule(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.rule = input;
        self
    }
    /// <p>A single rule level of the <code>MatchRules</code>. Configures how the rule-based matching process should match profiles.</p>
    pub fn get_rule(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.rule
    }
    /// Consumes the builder and constructs a [`MatchingRule`](crate::types::MatchingRule).
    /// This method will fail if any of the following fields are not set:
    /// - [`rule`](crate::types::builders::MatchingRuleBuilder::rule)
    pub fn build(self) -> ::std::result::Result<crate::types::MatchingRule, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::MatchingRule {
            rule: self.rule.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "rule",
                    "rule was not specified but it is required when building MatchingRule",
                )
            })?,
        })
    }
}