#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateContactInput {
pub contact_list_name: ::std::option::Option<::std::string::String>,
pub email_address: ::std::option::Option<::std::string::String>,
pub topic_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
pub unsubscribe_all: ::std::option::Option<bool>,
pub attributes_data: ::std::option::Option<::std::string::String>,
}
impl UpdateContactInput {
pub fn contact_list_name(&self) -> ::std::option::Option<&str> {
self.contact_list_name.as_deref()
}
pub fn email_address(&self) -> ::std::option::Option<&str> {
self.email_address.as_deref()
}
pub fn topic_preferences(&self) -> &[crate::types::TopicPreference] {
self.topic_preferences.as_deref().unwrap_or_default()
}
pub fn unsubscribe_all(&self) -> ::std::option::Option<bool> {
self.unsubscribe_all
}
pub fn attributes_data(&self) -> ::std::option::Option<&str> {
self.attributes_data.as_deref()
}
}
impl UpdateContactInput {
pub fn builder() -> crate::operation::update_contact::builders::UpdateContactInputBuilder {
crate::operation::update_contact::builders::UpdateContactInputBuilder::default()
}
}
#[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 {
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
}
pub fn set_contact_list_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.contact_list_name = input;
self
}
pub fn get_contact_list_name(&self) -> &::std::option::Option<::std::string::String> {
&self.contact_list_name
}
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
}
pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.email_address = input;
self
}
pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> {
&self.email_address
}
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
}
pub fn set_topic_preferences(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>) -> Self {
self.topic_preferences = input;
self
}
pub fn get_topic_preferences(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>> {
&self.topic_preferences
}
pub fn unsubscribe_all(mut self, input: bool) -> Self {
self.unsubscribe_all = ::std::option::Option::Some(input);
self
}
pub fn set_unsubscribe_all(mut self, input: ::std::option::Option<bool>) -> Self {
self.unsubscribe_all = input;
self
}
pub fn get_unsubscribe_all(&self) -> &::std::option::Option<bool> {
&self.unsubscribe_all
}
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
}
pub fn set_attributes_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.attributes_data = input;
self
}
pub fn get_attributes_data(&self) -> &::std::option::Option<::std::string::String> {
&self.attributes_data
}
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,
})
}
}