aws_sdk_workdocs/types/
_filters.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Filters results based on entity metadata.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Filters {
7    /// <p>Filters by the locale of the content or comment.</p>
8    pub text_locales: ::std::option::Option<::std::vec::Vec<crate::types::LanguageCodeType>>,
9    /// <p>Filters by content category.</p>
10    pub content_categories: ::std::option::Option<::std::vec::Vec<crate::types::ContentCategoryType>>,
11    /// <p>Filters based on entity type.</p>
12    pub resource_types: ::std::option::Option<::std::vec::Vec<crate::types::SearchResourceType>>,
13    /// <p>Filter by labels using exact match.</p>
14    pub labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
15    /// <p>Filter based on UserIds or GroupIds.</p>
16    pub principals: ::std::option::Option<::std::vec::Vec<crate::types::SearchPrincipalType>>,
17    /// <p>Filter based on resource’s path.</p>
18    pub ancestor_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
19    /// <p>Filter based on file groupings.</p>
20    pub search_collection_types: ::std::option::Option<::std::vec::Vec<crate::types::SearchCollectionType>>,
21    /// <p>Filter based on size (in bytes).</p>
22    pub size_range: ::std::option::Option<crate::types::LongRangeType>,
23    /// <p>Filter based on resource’s creation timestamp.</p>
24    pub created_range: ::std::option::Option<crate::types::DateRangeType>,
25    /// <p>Filter based on resource’s modified timestamp.</p>
26    pub modified_range: ::std::option::Option<crate::types::DateRangeType>,
27}
28impl Filters {
29    /// <p>Filters by the locale of the content or comment.</p>
30    ///
31    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.text_locales.is_none()`.
32    pub fn text_locales(&self) -> &[crate::types::LanguageCodeType] {
33        self.text_locales.as_deref().unwrap_or_default()
34    }
35    /// <p>Filters by content category.</p>
36    ///
37    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.content_categories.is_none()`.
38    pub fn content_categories(&self) -> &[crate::types::ContentCategoryType] {
39        self.content_categories.as_deref().unwrap_or_default()
40    }
41    /// <p>Filters based on entity type.</p>
42    ///
43    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_types.is_none()`.
44    pub fn resource_types(&self) -> &[crate::types::SearchResourceType] {
45        self.resource_types.as_deref().unwrap_or_default()
46    }
47    /// <p>Filter by labels using exact match.</p>
48    ///
49    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.labels.is_none()`.
50    pub fn labels(&self) -> &[::std::string::String] {
51        self.labels.as_deref().unwrap_or_default()
52    }
53    /// <p>Filter based on UserIds or GroupIds.</p>
54    ///
55    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.principals.is_none()`.
56    pub fn principals(&self) -> &[crate::types::SearchPrincipalType] {
57        self.principals.as_deref().unwrap_or_default()
58    }
59    /// <p>Filter based on resource’s path.</p>
60    ///
61    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.ancestor_ids.is_none()`.
62    pub fn ancestor_ids(&self) -> &[::std::string::String] {
63        self.ancestor_ids.as_deref().unwrap_or_default()
64    }
65    /// <p>Filter based on file groupings.</p>
66    ///
67    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.search_collection_types.is_none()`.
68    pub fn search_collection_types(&self) -> &[crate::types::SearchCollectionType] {
69        self.search_collection_types.as_deref().unwrap_or_default()
70    }
71    /// <p>Filter based on size (in bytes).</p>
72    pub fn size_range(&self) -> ::std::option::Option<&crate::types::LongRangeType> {
73        self.size_range.as_ref()
74    }
75    /// <p>Filter based on resource’s creation timestamp.</p>
76    pub fn created_range(&self) -> ::std::option::Option<&crate::types::DateRangeType> {
77        self.created_range.as_ref()
78    }
79    /// <p>Filter based on resource’s modified timestamp.</p>
80    pub fn modified_range(&self) -> ::std::option::Option<&crate::types::DateRangeType> {
81        self.modified_range.as_ref()
82    }
83}
84impl Filters {
85    /// Creates a new builder-style object to manufacture [`Filters`](crate::types::Filters).
86    pub fn builder() -> crate::types::builders::FiltersBuilder {
87        crate::types::builders::FiltersBuilder::default()
88    }
89}
90
91/// A builder for [`Filters`](crate::types::Filters).
92#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
93#[non_exhaustive]
94pub struct FiltersBuilder {
95    pub(crate) text_locales: ::std::option::Option<::std::vec::Vec<crate::types::LanguageCodeType>>,
96    pub(crate) content_categories: ::std::option::Option<::std::vec::Vec<crate::types::ContentCategoryType>>,
97    pub(crate) resource_types: ::std::option::Option<::std::vec::Vec<crate::types::SearchResourceType>>,
98    pub(crate) labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
99    pub(crate) principals: ::std::option::Option<::std::vec::Vec<crate::types::SearchPrincipalType>>,
100    pub(crate) ancestor_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
101    pub(crate) search_collection_types: ::std::option::Option<::std::vec::Vec<crate::types::SearchCollectionType>>,
102    pub(crate) size_range: ::std::option::Option<crate::types::LongRangeType>,
103    pub(crate) created_range: ::std::option::Option<crate::types::DateRangeType>,
104    pub(crate) modified_range: ::std::option::Option<crate::types::DateRangeType>,
105}
106impl FiltersBuilder {
107    /// Appends an item to `text_locales`.
108    ///
109    /// To override the contents of this collection use [`set_text_locales`](Self::set_text_locales).
110    ///
111    /// <p>Filters by the locale of the content or comment.</p>
112    pub fn text_locales(mut self, input: crate::types::LanguageCodeType) -> Self {
113        let mut v = self.text_locales.unwrap_or_default();
114        v.push(input);
115        self.text_locales = ::std::option::Option::Some(v);
116        self
117    }
118    /// <p>Filters by the locale of the content or comment.</p>
119    pub fn set_text_locales(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LanguageCodeType>>) -> Self {
120        self.text_locales = input;
121        self
122    }
123    /// <p>Filters by the locale of the content or comment.</p>
124    pub fn get_text_locales(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LanguageCodeType>> {
125        &self.text_locales
126    }
127    /// Appends an item to `content_categories`.
128    ///
129    /// To override the contents of this collection use [`set_content_categories`](Self::set_content_categories).
130    ///
131    /// <p>Filters by content category.</p>
132    pub fn content_categories(mut self, input: crate::types::ContentCategoryType) -> Self {
133        let mut v = self.content_categories.unwrap_or_default();
134        v.push(input);
135        self.content_categories = ::std::option::Option::Some(v);
136        self
137    }
138    /// <p>Filters by content category.</p>
139    pub fn set_content_categories(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ContentCategoryType>>) -> Self {
140        self.content_categories = input;
141        self
142    }
143    /// <p>Filters by content category.</p>
144    pub fn get_content_categories(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ContentCategoryType>> {
145        &self.content_categories
146    }
147    /// Appends an item to `resource_types`.
148    ///
149    /// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types).
150    ///
151    /// <p>Filters based on entity type.</p>
152    pub fn resource_types(mut self, input: crate::types::SearchResourceType) -> Self {
153        let mut v = self.resource_types.unwrap_or_default();
154        v.push(input);
155        self.resource_types = ::std::option::Option::Some(v);
156        self
157    }
158    /// <p>Filters based on entity type.</p>
159    pub fn set_resource_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchResourceType>>) -> Self {
160        self.resource_types = input;
161        self
162    }
163    /// <p>Filters based on entity type.</p>
164    pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchResourceType>> {
165        &self.resource_types
166    }
167    /// Appends an item to `labels`.
168    ///
169    /// To override the contents of this collection use [`set_labels`](Self::set_labels).
170    ///
171    /// <p>Filter by labels using exact match.</p>
172    pub fn labels(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        let mut v = self.labels.unwrap_or_default();
174        v.push(input.into());
175        self.labels = ::std::option::Option::Some(v);
176        self
177    }
178    /// <p>Filter by labels using exact match.</p>
179    pub fn set_labels(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
180        self.labels = input;
181        self
182    }
183    /// <p>Filter by labels using exact match.</p>
184    pub fn get_labels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
185        &self.labels
186    }
187    /// Appends an item to `principals`.
188    ///
189    /// To override the contents of this collection use [`set_principals`](Self::set_principals).
190    ///
191    /// <p>Filter based on UserIds or GroupIds.</p>
192    pub fn principals(mut self, input: crate::types::SearchPrincipalType) -> Self {
193        let mut v = self.principals.unwrap_or_default();
194        v.push(input);
195        self.principals = ::std::option::Option::Some(v);
196        self
197    }
198    /// <p>Filter based on UserIds or GroupIds.</p>
199    pub fn set_principals(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchPrincipalType>>) -> Self {
200        self.principals = input;
201        self
202    }
203    /// <p>Filter based on UserIds or GroupIds.</p>
204    pub fn get_principals(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchPrincipalType>> {
205        &self.principals
206    }
207    /// Appends an item to `ancestor_ids`.
208    ///
209    /// To override the contents of this collection use [`set_ancestor_ids`](Self::set_ancestor_ids).
210    ///
211    /// <p>Filter based on resource’s path.</p>
212    pub fn ancestor_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        let mut v = self.ancestor_ids.unwrap_or_default();
214        v.push(input.into());
215        self.ancestor_ids = ::std::option::Option::Some(v);
216        self
217    }
218    /// <p>Filter based on resource’s path.</p>
219    pub fn set_ancestor_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
220        self.ancestor_ids = input;
221        self
222    }
223    /// <p>Filter based on resource’s path.</p>
224    pub fn get_ancestor_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
225        &self.ancestor_ids
226    }
227    /// Appends an item to `search_collection_types`.
228    ///
229    /// To override the contents of this collection use [`set_search_collection_types`](Self::set_search_collection_types).
230    ///
231    /// <p>Filter based on file groupings.</p>
232    pub fn search_collection_types(mut self, input: crate::types::SearchCollectionType) -> Self {
233        let mut v = self.search_collection_types.unwrap_or_default();
234        v.push(input);
235        self.search_collection_types = ::std::option::Option::Some(v);
236        self
237    }
238    /// <p>Filter based on file groupings.</p>
239    pub fn set_search_collection_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchCollectionType>>) -> Self {
240        self.search_collection_types = input;
241        self
242    }
243    /// <p>Filter based on file groupings.</p>
244    pub fn get_search_collection_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchCollectionType>> {
245        &self.search_collection_types
246    }
247    /// <p>Filter based on size (in bytes).</p>
248    pub fn size_range(mut self, input: crate::types::LongRangeType) -> Self {
249        self.size_range = ::std::option::Option::Some(input);
250        self
251    }
252    /// <p>Filter based on size (in bytes).</p>
253    pub fn set_size_range(mut self, input: ::std::option::Option<crate::types::LongRangeType>) -> Self {
254        self.size_range = input;
255        self
256    }
257    /// <p>Filter based on size (in bytes).</p>
258    pub fn get_size_range(&self) -> &::std::option::Option<crate::types::LongRangeType> {
259        &self.size_range
260    }
261    /// <p>Filter based on resource’s creation timestamp.</p>
262    pub fn created_range(mut self, input: crate::types::DateRangeType) -> Self {
263        self.created_range = ::std::option::Option::Some(input);
264        self
265    }
266    /// <p>Filter based on resource’s creation timestamp.</p>
267    pub fn set_created_range(mut self, input: ::std::option::Option<crate::types::DateRangeType>) -> Self {
268        self.created_range = input;
269        self
270    }
271    /// <p>Filter based on resource’s creation timestamp.</p>
272    pub fn get_created_range(&self) -> &::std::option::Option<crate::types::DateRangeType> {
273        &self.created_range
274    }
275    /// <p>Filter based on resource’s modified timestamp.</p>
276    pub fn modified_range(mut self, input: crate::types::DateRangeType) -> Self {
277        self.modified_range = ::std::option::Option::Some(input);
278        self
279    }
280    /// <p>Filter based on resource’s modified timestamp.</p>
281    pub fn set_modified_range(mut self, input: ::std::option::Option<crate::types::DateRangeType>) -> Self {
282        self.modified_range = input;
283        self
284    }
285    /// <p>Filter based on resource’s modified timestamp.</p>
286    pub fn get_modified_range(&self) -> &::std::option::Option<crate::types::DateRangeType> {
287        &self.modified_range
288    }
289    /// Consumes the builder and constructs a [`Filters`](crate::types::Filters).
290    pub fn build(self) -> crate::types::Filters {
291        crate::types::Filters {
292            text_locales: self.text_locales,
293            content_categories: self.content_categories,
294            resource_types: self.resource_types,
295            labels: self.labels,
296            principals: self.principals,
297            ancestor_ids: self.ancestor_ids,
298            search_collection_types: self.search_collection_types,
299            size_range: self.size_range,
300            created_range: self.created_range,
301            modified_range: self.modified_range,
302        }
303    }
304}