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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateContactInput {
    /// <p>The name of the contact list.</p>
    pub contact_list_name: ::std::option::Option<::std::string::String>,
    /// <p>The contact's email address.</p>
    pub email_address: ::std::option::Option<::std::string::String>,
    /// <p>The contact's preference for being opted-in to or opted-out of a topic.</p>
    pub topic_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
    pub unsubscribe_all: ::std::option::Option<bool>,
    /// <p>The attribute data attached to a contact.</p>
    pub attributes_data: ::std::option::Option<::std::string::String>,
}
impl UpdateContactInput {
    /// <p>The name of the contact list.</p>
    pub fn contact_list_name(&self) -> ::std::option::Option<&str> {
        self.contact_list_name.as_deref()
    }
    /// <p>The contact's email address.</p>
    pub fn email_address(&self) -> ::std::option::Option<&str> {
        self.email_address.as_deref()
    }
    /// <p>The contact's preference for being opted-in to or opted-out of a topic.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.topic_preferences.is_none()`.
    pub fn topic_preferences(&self) -> &[crate::types::TopicPreference] {
        self.topic_preferences.as_deref().unwrap_or_default()
    }
    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
    pub fn unsubscribe_all(&self) -> ::std::option::Option<bool> {
        self.unsubscribe_all
    }
    /// <p>The attribute data attached to a contact.</p>
    pub fn attributes_data(&self) -> ::std::option::Option<&str> {
        self.attributes_data.as_deref()
    }
}
impl UpdateContactInput {
    /// Creates a new builder-style object to manufacture [`UpdateContactInput`](crate::operation::update_contact::UpdateContactInput).
    pub fn builder() -> crate::operation::update_contact::builders::UpdateContactInputBuilder {
        crate::operation::update_contact::builders::UpdateContactInputBuilder::default()
    }
}

/// A builder for [`UpdateContactInput`](crate::operation::update_contact::UpdateContactInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct UpdateContactInputBuilder {
    pub(crate) contact_list_name: ::std::option::Option<::std::string::String>,
    pub(crate) email_address: ::std::option::Option<::std::string::String>,
    pub(crate) topic_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
    pub(crate) unsubscribe_all: ::std::option::Option<bool>,
    pub(crate) attributes_data: ::std::option::Option<::std::string::String>,
}
impl UpdateContactInputBuilder {
    /// <p>The name of the contact list.</p>
    /// This field is required.
    pub fn contact_list_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.contact_list_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the contact list.</p>
    pub fn set_contact_list_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.contact_list_name = input;
        self
    }
    /// <p>The name of the contact list.</p>
    pub fn get_contact_list_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.contact_list_name
    }
    /// <p>The contact's email address.</p>
    /// This field is required.
    pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.email_address = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The contact's email address.</p>
    pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.email_address = input;
        self
    }
    /// <p>The contact's email address.</p>
    pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> {
        &self.email_address
    }
    /// Appends an item to `topic_preferences`.
    ///
    /// To override the contents of this collection use [`set_topic_preferences`](Self::set_topic_preferences).
    ///
    /// <p>The contact's preference for being opted-in to or opted-out of a topic.</p>
    pub fn topic_preferences(mut self, input: crate::types::TopicPreference) -> Self {
        let mut v = self.topic_preferences.unwrap_or_default();
        v.push(input);
        self.topic_preferences = ::std::option::Option::Some(v);
        self
    }
    /// <p>The contact's preference for being opted-in to or opted-out of a topic.</p>
    pub fn set_topic_preferences(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>) -> Self {
        self.topic_preferences = input;
        self
    }
    /// <p>The contact's preference for being opted-in to or opted-out of a topic.</p>
    pub fn get_topic_preferences(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>> {
        &self.topic_preferences
    }
    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
    pub fn unsubscribe_all(mut self, input: bool) -> Self {
        self.unsubscribe_all = ::std::option::Option::Some(input);
        self
    }
    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
    pub fn set_unsubscribe_all(mut self, input: ::std::option::Option<bool>) -> Self {
        self.unsubscribe_all = input;
        self
    }
    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
    pub fn get_unsubscribe_all(&self) -> &::std::option::Option<bool> {
        &self.unsubscribe_all
    }
    /// <p>The attribute data attached to a contact.</p>
    pub fn attributes_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.attributes_data = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The attribute data attached to a contact.</p>
    pub fn set_attributes_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.attributes_data = input;
        self
    }
    /// <p>The attribute data attached to a contact.</p>
    pub fn get_attributes_data(&self) -> &::std::option::Option<::std::string::String> {
        &self.attributes_data
    }
    /// Consumes the builder and constructs a [`UpdateContactInput`](crate::operation::update_contact::UpdateContactInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_contact::UpdateContactInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_contact::UpdateContactInput {
            contact_list_name: self.contact_list_name,
            email_address: self.email_address,
            topic_preferences: self.topic_preferences,
            unsubscribe_all: self.unsubscribe_all,
            attributes_data: self.attributes_data,
        })
    }
}