// 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 PutConfigRuleInput {
    /// <p>The rule that you want to add to your account.</p>
    pub config_rule: ::std::option::Option<crate::types::ConfigRule>,
    /// <p>An array of tag object.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl PutConfigRuleInput {
    /// <p>The rule that you want to add to your account.</p>
    pub fn config_rule(&self) -> ::std::option::Option<&crate::types::ConfigRule> {
        self.config_rule.as_ref()
    }
    /// <p>An array of tag object.</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 `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
}
impl PutConfigRuleInput {
    /// Creates a new builder-style object to manufacture [`PutConfigRuleInput`](crate::operation::put_config_rule::PutConfigRuleInput).
    pub fn builder() -> crate::operation::put_config_rule::builders::PutConfigRuleInputBuilder {
        crate::operation::put_config_rule::builders::PutConfigRuleInputBuilder::default()
    }
}

/// A builder for [`PutConfigRuleInput`](crate::operation::put_config_rule::PutConfigRuleInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutConfigRuleInputBuilder {
    pub(crate) config_rule: ::std::option::Option<crate::types::ConfigRule>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl PutConfigRuleInputBuilder {
    /// <p>The rule that you want to add to your account.</p>
    /// This field is required.
    pub fn config_rule(mut self, input: crate::types::ConfigRule) -> Self {
        self.config_rule = ::std::option::Option::Some(input);
        self
    }
    /// <p>The rule that you want to add to your account.</p>
    pub fn set_config_rule(mut self, input: ::std::option::Option<crate::types::ConfigRule>) -> Self {
        self.config_rule = input;
        self
    }
    /// <p>The rule that you want to add to your account.</p>
    pub fn get_config_rule(&self) -> &::std::option::Option<crate::types::ConfigRule> {
        &self.config_rule
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>An array of tag object.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of tag object.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>An array of tag object.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`PutConfigRuleInput`](crate::operation::put_config_rule::PutConfigRuleInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::put_config_rule::PutConfigRuleInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_config_rule::PutConfigRuleInput {
            config_rule: self.config_rule,
            tags: self.tags,
        })
    }
}
