aws-sdk-backup 1.109.0

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

/// <p>Contains information about which resources to include or exclude from a backup plan using their tags. Conditions are case sensitive.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Conditions {
    /// <p>Filters the values of your tagged resources for only those resources that you tagged with the same value. Also called "exact matching."</p>
    pub string_equals: ::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>>,
    /// <p>Filters the values of your tagged resources for only those resources that you tagged that do not have the same value. Also called "negated matching."</p>
    pub string_not_equals: ::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>>,
    /// <p>Filters the values of your tagged resources for matching tag values with the use of a wildcard character (*) anywhere in the string. For example, "prod*" or "*rod*" matches the tag value "production".</p>
    pub string_like: ::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>>,
    /// <p>Filters the values of your tagged resources for non-matching tag values with the use of a wildcard character (*) anywhere in the string.</p>
    pub string_not_like: ::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>>,
}
impl Conditions {
    /// <p>Filters the values of your tagged resources for only those resources that you tagged with the same value. Also called "exact matching."</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 `.string_equals.is_none()`.
    pub fn string_equals(&self) -> &[crate::types::ConditionParameter] {
        self.string_equals.as_deref().unwrap_or_default()
    }
    /// <p>Filters the values of your tagged resources for only those resources that you tagged that do not have the same value. Also called "negated matching."</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 `.string_not_equals.is_none()`.
    pub fn string_not_equals(&self) -> &[crate::types::ConditionParameter] {
        self.string_not_equals.as_deref().unwrap_or_default()
    }
    /// <p>Filters the values of your tagged resources for matching tag values with the use of a wildcard character (*) anywhere in the string. For example, "prod*" or "*rod*" matches the tag value "production".</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 `.string_like.is_none()`.
    pub fn string_like(&self) -> &[crate::types::ConditionParameter] {
        self.string_like.as_deref().unwrap_or_default()
    }
    /// <p>Filters the values of your tagged resources for non-matching tag values with the use of a wildcard character (*) anywhere in the string.</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 `.string_not_like.is_none()`.
    pub fn string_not_like(&self) -> &[crate::types::ConditionParameter] {
        self.string_not_like.as_deref().unwrap_or_default()
    }
}
impl Conditions {
    /// Creates a new builder-style object to manufacture [`Conditions`](crate::types::Conditions).
    pub fn builder() -> crate::types::builders::ConditionsBuilder {
        crate::types::builders::ConditionsBuilder::default()
    }
}

/// A builder for [`Conditions`](crate::types::Conditions).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ConditionsBuilder {
    pub(crate) string_equals: ::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>>,
    pub(crate) string_not_equals: ::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>>,
    pub(crate) string_like: ::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>>,
    pub(crate) string_not_like: ::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>>,
}
impl ConditionsBuilder {
    /// Appends an item to `string_equals`.
    ///
    /// To override the contents of this collection use [`set_string_equals`](Self::set_string_equals).
    ///
    /// <p>Filters the values of your tagged resources for only those resources that you tagged with the same value. Also called "exact matching."</p>
    pub fn string_equals(mut self, input: crate::types::ConditionParameter) -> Self {
        let mut v = self.string_equals.unwrap_or_default();
        v.push(input);
        self.string_equals = ::std::option::Option::Some(v);
        self
    }
    /// <p>Filters the values of your tagged resources for only those resources that you tagged with the same value. Also called "exact matching."</p>
    pub fn set_string_equals(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>>) -> Self {
        self.string_equals = input;
        self
    }
    /// <p>Filters the values of your tagged resources for only those resources that you tagged with the same value. Also called "exact matching."</p>
    pub fn get_string_equals(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>> {
        &self.string_equals
    }
    /// Appends an item to `string_not_equals`.
    ///
    /// To override the contents of this collection use [`set_string_not_equals`](Self::set_string_not_equals).
    ///
    /// <p>Filters the values of your tagged resources for only those resources that you tagged that do not have the same value. Also called "negated matching."</p>
    pub fn string_not_equals(mut self, input: crate::types::ConditionParameter) -> Self {
        let mut v = self.string_not_equals.unwrap_or_default();
        v.push(input);
        self.string_not_equals = ::std::option::Option::Some(v);
        self
    }
    /// <p>Filters the values of your tagged resources for only those resources that you tagged that do not have the same value. Also called "negated matching."</p>
    pub fn set_string_not_equals(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>>) -> Self {
        self.string_not_equals = input;
        self
    }
    /// <p>Filters the values of your tagged resources for only those resources that you tagged that do not have the same value. Also called "negated matching."</p>
    pub fn get_string_not_equals(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>> {
        &self.string_not_equals
    }
    /// Appends an item to `string_like`.
    ///
    /// To override the contents of this collection use [`set_string_like`](Self::set_string_like).
    ///
    /// <p>Filters the values of your tagged resources for matching tag values with the use of a wildcard character (*) anywhere in the string. For example, "prod*" or "*rod*" matches the tag value "production".</p>
    pub fn string_like(mut self, input: crate::types::ConditionParameter) -> Self {
        let mut v = self.string_like.unwrap_or_default();
        v.push(input);
        self.string_like = ::std::option::Option::Some(v);
        self
    }
    /// <p>Filters the values of your tagged resources for matching tag values with the use of a wildcard character (*) anywhere in the string. For example, "prod*" or "*rod*" matches the tag value "production".</p>
    pub fn set_string_like(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>>) -> Self {
        self.string_like = input;
        self
    }
    /// <p>Filters the values of your tagged resources for matching tag values with the use of a wildcard character (*) anywhere in the string. For example, "prod*" or "*rod*" matches the tag value "production".</p>
    pub fn get_string_like(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>> {
        &self.string_like
    }
    /// Appends an item to `string_not_like`.
    ///
    /// To override the contents of this collection use [`set_string_not_like`](Self::set_string_not_like).
    ///
    /// <p>Filters the values of your tagged resources for non-matching tag values with the use of a wildcard character (*) anywhere in the string.</p>
    pub fn string_not_like(mut self, input: crate::types::ConditionParameter) -> Self {
        let mut v = self.string_not_like.unwrap_or_default();
        v.push(input);
        self.string_not_like = ::std::option::Option::Some(v);
        self
    }
    /// <p>Filters the values of your tagged resources for non-matching tag values with the use of a wildcard character (*) anywhere in the string.</p>
    pub fn set_string_not_like(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>>) -> Self {
        self.string_not_like = input;
        self
    }
    /// <p>Filters the values of your tagged resources for non-matching tag values with the use of a wildcard character (*) anywhere in the string.</p>
    pub fn get_string_not_like(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConditionParameter>> {
        &self.string_not_like
    }
    /// Consumes the builder and constructs a [`Conditions`](crate::types::Conditions).
    pub fn build(self) -> crate::types::Conditions {
        crate::types::Conditions {
            string_equals: self.string_equals,
            string_not_equals: self.string_not_equals,
            string_like: self.string_like,
            string_not_like: self.string_not_like,
        }
    }
}