aws-sdk-mailmanager 1.85.0

AWS SDK for MailManager
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, ::std::fmt::Debug)]
pub struct UpdateRuleSetInput {
    /// <p>The identifier of a rule set you want to update.</p>
    pub rule_set_id: ::std::option::Option<::std::string::String>,
    /// <p>A user-friendly name for the rule set resource.</p>
    pub rule_set_name: ::std::option::Option<::std::string::String>,
    /// <p>A new set of rules to replace the current rules of the rule set—these rules will override all the rules of the rule set.</p>
    pub rules: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>,
}
impl UpdateRuleSetInput {
    /// <p>The identifier of a rule set you want to update.</p>
    pub fn rule_set_id(&self) -> ::std::option::Option<&str> {
        self.rule_set_id.as_deref()
    }
    /// <p>A user-friendly name for the rule set resource.</p>
    pub fn rule_set_name(&self) -> ::std::option::Option<&str> {
        self.rule_set_name.as_deref()
    }
    /// <p>A new set of rules to replace the current rules of the rule set—these rules will override all the rules of the rule set.</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 `.rules.is_none()`.
    pub fn rules(&self) -> &[crate::types::Rule] {
        self.rules.as_deref().unwrap_or_default()
    }
}
impl UpdateRuleSetInput {
    /// Creates a new builder-style object to manufacture [`UpdateRuleSetInput`](crate::operation::update_rule_set::UpdateRuleSetInput).
    pub fn builder() -> crate::operation::update_rule_set::builders::UpdateRuleSetInputBuilder {
        crate::operation::update_rule_set::builders::UpdateRuleSetInputBuilder::default()
    }
}

/// A builder for [`UpdateRuleSetInput`](crate::operation::update_rule_set::UpdateRuleSetInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateRuleSetInputBuilder {
    pub(crate) rule_set_id: ::std::option::Option<::std::string::String>,
    pub(crate) rule_set_name: ::std::option::Option<::std::string::String>,
    pub(crate) rules: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>,
}
impl UpdateRuleSetInputBuilder {
    /// <p>The identifier of a rule set you want to update.</p>
    /// This field is required.
    pub fn rule_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rule_set_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of a rule set you want to update.</p>
    pub fn set_rule_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.rule_set_id = input;
        self
    }
    /// <p>The identifier of a rule set you want to update.</p>
    pub fn get_rule_set_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.rule_set_id
    }
    /// <p>A user-friendly name for the rule set resource.</p>
    pub fn rule_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rule_set_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A user-friendly name for the rule set resource.</p>
    pub fn set_rule_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.rule_set_name = input;
        self
    }
    /// <p>A user-friendly name for the rule set resource.</p>
    pub fn get_rule_set_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.rule_set_name
    }
    /// Appends an item to `rules`.
    ///
    /// To override the contents of this collection use [`set_rules`](Self::set_rules).
    ///
    /// <p>A new set of rules to replace the current rules of the rule set—these rules will override all the rules of the rule set.</p>
    pub fn rules(mut self, input: crate::types::Rule) -> Self {
        let mut v = self.rules.unwrap_or_default();
        v.push(input);
        self.rules = ::std::option::Option::Some(v);
        self
    }
    /// <p>A new set of rules to replace the current rules of the rule set—these rules will override all the rules of the rule set.</p>
    pub fn set_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>) -> Self {
        self.rules = input;
        self
    }
    /// <p>A new set of rules to replace the current rules of the rule set—these rules will override all the rules of the rule set.</p>
    pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Rule>> {
        &self.rules
    }
    /// Consumes the builder and constructs a [`UpdateRuleSetInput`](crate::operation::update_rule_set::UpdateRuleSetInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_rule_set::UpdateRuleSetInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_rule_set::UpdateRuleSetInput {
            rule_set_id: self.rule_set_id,
            rule_set_name: self.rule_set_name,
            rules: self.rules,
        })
    }
}