aws-sdk-notificationscontacts 1.56.0

AWS SDK for AWS User Notifications Contacts
Documentation
// 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)]
pub struct CreateEmailContactInput {
    /// <p>The name of the email contact.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The email address this email contact points to. The activation email and any subscribed emails are sent here.</p><note>
    /// <p>This email address can't receive emails until it's activated.</p>
    /// </note>
    pub email_address: ::std::option::Option<::std::string::String>,
    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateEmailContactInput {
    /// <p>The name of the email contact.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The email address this email contact points to. The activation email and any subscribed emails are sent here.</p><note>
    /// <p>This email address can't receive emails until it's activated.</p>
    /// </note>
    pub fn email_address(&self) -> ::std::option::Option<&str> {
        self.email_address.as_deref()
    }
    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::std::fmt::Debug for CreateEmailContactInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateEmailContactInput");
        formatter.field("name", &"*** Sensitive Data Redacted ***");
        formatter.field("email_address", &self.email_address);
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}
impl CreateEmailContactInput {
    /// Creates a new builder-style object to manufacture [`CreateEmailContactInput`](crate::operation::create_email_contact::CreateEmailContactInput).
    pub fn builder() -> crate::operation::create_email_contact::builders::CreateEmailContactInputBuilder {
        crate::operation::create_email_contact::builders::CreateEmailContactInputBuilder::default()
    }
}

/// A builder for [`CreateEmailContactInput`](crate::operation::create_email_contact::CreateEmailContactInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateEmailContactInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) email_address: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateEmailContactInputBuilder {
    /// <p>The name of the email contact.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the email contact.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the email contact.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The email address this email contact points to. The activation email and any subscribed emails are sent here.</p><note>
    /// <p>This email address can't receive emails until it's activated.</p>
    /// </note>
    /// 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 email address this email contact points to. The activation email and any subscribed emails are sent here.</p><note>
    /// <p>This email address can't receive emails until it's activated.</p>
    /// </note>
    pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.email_address = input;
        self
    }
    /// <p>The email address this email contact points to. The activation email and any subscribed emails are sent here.</p><note>
    /// <p>This email address can't receive emails until it's activated.</p>
    /// </note>
    pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> {
        &self.email_address
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateEmailContactInput`](crate::operation::create_email_contact::CreateEmailContactInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_email_contact::CreateEmailContactInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_email_contact::CreateEmailContactInput {
            name: self.name,
            email_address: self.email_address,
            tags: self.tags,
        })
    }
}
impl ::std::fmt::Debug for CreateEmailContactInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateEmailContactInputBuilder");
        formatter.field("name", &"*** Sensitive Data Redacted ***");
        formatter.field("email_address", &self.email_address);
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}