aws-sdk-amplifybackend 1.99.0

AWS SDK for AmplifyBackend
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The settings of your MFA configuration for the backend of your Amplify project.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Settings {
    /// <p>The supported MFA types.</p>
    pub mfa_types: ::std::option::Option<::std::vec::Vec<crate::types::MfaTypesElement>>,
    /// <p>The body of the SMS message.</p>
    pub sms_message: ::std::option::Option<::std::string::String>,
}
impl Settings {
    /// <p>The supported MFA types.</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 `.mfa_types.is_none()`.
    pub fn mfa_types(&self) -> &[crate::types::MfaTypesElement] {
        self.mfa_types.as_deref().unwrap_or_default()
    }
    /// <p>The body of the SMS message.</p>
    pub fn sms_message(&self) -> ::std::option::Option<&str> {
        self.sms_message.as_deref()
    }
}
impl Settings {
    /// Creates a new builder-style object to manufacture [`Settings`](crate::types::Settings).
    pub fn builder() -> crate::types::builders::SettingsBuilder {
        crate::types::builders::SettingsBuilder::default()
    }
}

/// A builder for [`Settings`](crate::types::Settings).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SettingsBuilder {
    pub(crate) mfa_types: ::std::option::Option<::std::vec::Vec<crate::types::MfaTypesElement>>,
    pub(crate) sms_message: ::std::option::Option<::std::string::String>,
}
impl SettingsBuilder {
    /// Appends an item to `mfa_types`.
    ///
    /// To override the contents of this collection use [`set_mfa_types`](Self::set_mfa_types).
    ///
    /// <p>The supported MFA types.</p>
    pub fn mfa_types(mut self, input: crate::types::MfaTypesElement) -> Self {
        let mut v = self.mfa_types.unwrap_or_default();
        v.push(input);
        self.mfa_types = ::std::option::Option::Some(v);
        self
    }
    /// <p>The supported MFA types.</p>
    pub fn set_mfa_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MfaTypesElement>>) -> Self {
        self.mfa_types = input;
        self
    }
    /// <p>The supported MFA types.</p>
    pub fn get_mfa_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MfaTypesElement>> {
        &self.mfa_types
    }
    /// <p>The body of the SMS message.</p>
    pub fn sms_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.sms_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The body of the SMS message.</p>
    pub fn set_sms_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.sms_message = input;
        self
    }
    /// <p>The body of the SMS message.</p>
    pub fn get_sms_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.sms_message
    }
    /// Consumes the builder and constructs a [`Settings`](crate::types::Settings).
    pub fn build(self) -> crate::types::Settings {
        crate::types::Settings {
            mfa_types: self.mfa_types,
            sms_message: self.sms_message,
        }
    }
}