Skip to main content

aws_sdk_datasync/types/
_filter_rule.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies which files, folders, and objects to include or exclude when transferring files from source to destination.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct FilterRule {
7    /// <p>The type of filter rule to apply. DataSync only supports the SIMPLE_PATTERN rule type.</p>
8    pub filter_type: ::std::option::Option<crate::types::FilterType>,
9    /// <p>A single filter string that consists of the patterns to include or exclude. The patterns are delimited by "|" (that is, a pipe), for example: <code>/folder1|/folder2</code></p>
10    /// <p></p>
11    pub value: ::std::option::Option<::std::string::String>,
12}
13impl FilterRule {
14    /// <p>The type of filter rule to apply. DataSync only supports the SIMPLE_PATTERN rule type.</p>
15    pub fn filter_type(&self) -> ::std::option::Option<&crate::types::FilterType> {
16        self.filter_type.as_ref()
17    }
18    /// <p>A single filter string that consists of the patterns to include or exclude. The patterns are delimited by "|" (that is, a pipe), for example: <code>/folder1|/folder2</code></p>
19    /// <p></p>
20    pub fn value(&self) -> ::std::option::Option<&str> {
21        self.value.as_deref()
22    }
23}
24impl FilterRule {
25    /// Creates a new builder-style object to manufacture [`FilterRule`](crate::types::FilterRule).
26    pub fn builder() -> crate::types::builders::FilterRuleBuilder {
27        crate::types::builders::FilterRuleBuilder::default()
28    }
29}
30
31/// A builder for [`FilterRule`](crate::types::FilterRule).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct FilterRuleBuilder {
35    pub(crate) filter_type: ::std::option::Option<crate::types::FilterType>,
36    pub(crate) value: ::std::option::Option<::std::string::String>,
37}
38impl FilterRuleBuilder {
39    /// <p>The type of filter rule to apply. DataSync only supports the SIMPLE_PATTERN rule type.</p>
40    pub fn filter_type(mut self, input: crate::types::FilterType) -> Self {
41        self.filter_type = ::std::option::Option::Some(input);
42        self
43    }
44    /// <p>The type of filter rule to apply. DataSync only supports the SIMPLE_PATTERN rule type.</p>
45    pub fn set_filter_type(mut self, input: ::std::option::Option<crate::types::FilterType>) -> Self {
46        self.filter_type = input;
47        self
48    }
49    /// <p>The type of filter rule to apply. DataSync only supports the SIMPLE_PATTERN rule type.</p>
50    pub fn get_filter_type(&self) -> &::std::option::Option<crate::types::FilterType> {
51        &self.filter_type
52    }
53    /// <p>A single filter string that consists of the patterns to include or exclude. The patterns are delimited by "|" (that is, a pipe), for example: <code>/folder1|/folder2</code></p>
54    /// <p></p>
55    pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56        self.value = ::std::option::Option::Some(input.into());
57        self
58    }
59    /// <p>A single filter string that consists of the patterns to include or exclude. The patterns are delimited by "|" (that is, a pipe), for example: <code>/folder1|/folder2</code></p>
60    /// <p></p>
61    pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62        self.value = input;
63        self
64    }
65    /// <p>A single filter string that consists of the patterns to include or exclude. The patterns are delimited by "|" (that is, a pipe), for example: <code>/folder1|/folder2</code></p>
66    /// <p></p>
67    pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
68        &self.value
69    }
70    /// Consumes the builder and constructs a [`FilterRule`](crate::types::FilterRule).
71    pub fn build(self) -> crate::types::FilterRule {
72        crate::types::FilterRule {
73            filter_type: self.filter_type,
74            value: self.value,
75        }
76    }
77}