1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A container for object key name prefix and suffix filtering rules.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct S3KeyFilter {
    /// <p>A list of containers for the key-value pair that defines the criteria for the filter rule.</p>
    pub filter_rules: ::std::option::Option<::std::vec::Vec<crate::types::FilterRule>>,
}
impl S3KeyFilter {
    /// <p>A list of containers for the key-value pair that defines the criteria for the filter rule.</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 `.filter_rules.is_none()`.
    pub fn filter_rules(&self) -> &[crate::types::FilterRule] {
        self.filter_rules.as_deref().unwrap_or_default()
    }
}
impl S3KeyFilter {
    /// Creates a new builder-style object to manufacture [`S3KeyFilter`](crate::types::S3KeyFilter).
    pub fn builder() -> crate::types::builders::S3KeyFilterBuilder {
        crate::types::builders::S3KeyFilterBuilder::default()
    }
}

/// A builder for [`S3KeyFilter`](crate::types::S3KeyFilter).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct S3KeyFilterBuilder {
    pub(crate) filter_rules: ::std::option::Option<::std::vec::Vec<crate::types::FilterRule>>,
}
impl S3KeyFilterBuilder {
    /// Appends an item to `filter_rules`.
    ///
    /// To override the contents of this collection use [`set_filter_rules`](Self::set_filter_rules).
    ///
    /// <p>A list of containers for the key-value pair that defines the criteria for the filter rule.</p>
    pub fn filter_rules(mut self, input: crate::types::FilterRule) -> Self {
        let mut v = self.filter_rules.unwrap_or_default();
        v.push(input);
        self.filter_rules = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of containers for the key-value pair that defines the criteria for the filter rule.</p>
    pub fn set_filter_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FilterRule>>) -> Self {
        self.filter_rules = input;
        self
    }
    /// <p>A list of containers for the key-value pair that defines the criteria for the filter rule.</p>
    pub fn get_filter_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FilterRule>> {
        &self.filter_rules
    }
    /// Consumes the builder and constructs a [`S3KeyFilter`](crate::types::S3KeyFilter).
    pub fn build(self) -> crate::types::S3KeyFilter {
        crate::types::S3KeyFilter {
            filter_rules: self.filter_rules,
        }
    }
}