aws_sdk_workdocs/types/
_filters.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Filters {
7 pub text_locales: ::std::option::Option<::std::vec::Vec<crate::types::LanguageCodeType>>,
9 pub content_categories: ::std::option::Option<::std::vec::Vec<crate::types::ContentCategoryType>>,
11 pub resource_types: ::std::option::Option<::std::vec::Vec<crate::types::SearchResourceType>>,
13 pub labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
15 pub principals: ::std::option::Option<::std::vec::Vec<crate::types::SearchPrincipalType>>,
17 pub ancestor_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
19 pub search_collection_types: ::std::option::Option<::std::vec::Vec<crate::types::SearchCollectionType>>,
21 pub size_range: ::std::option::Option<crate::types::LongRangeType>,
23 pub created_range: ::std::option::Option<crate::types::DateRangeType>,
25 pub modified_range: ::std::option::Option<crate::types::DateRangeType>,
27}
28impl Filters {
29 pub fn text_locales(&self) -> &[crate::types::LanguageCodeType] {
33 self.text_locales.as_deref().unwrap_or_default()
34 }
35 pub fn content_categories(&self) -> &[crate::types::ContentCategoryType] {
39 self.content_categories.as_deref().unwrap_or_default()
40 }
41 pub fn resource_types(&self) -> &[crate::types::SearchResourceType] {
45 self.resource_types.as_deref().unwrap_or_default()
46 }
47 pub fn labels(&self) -> &[::std::string::String] {
51 self.labels.as_deref().unwrap_or_default()
52 }
53 pub fn principals(&self) -> &[crate::types::SearchPrincipalType] {
57 self.principals.as_deref().unwrap_or_default()
58 }
59 pub fn ancestor_ids(&self) -> &[::std::string::String] {
63 self.ancestor_ids.as_deref().unwrap_or_default()
64 }
65 pub fn search_collection_types(&self) -> &[crate::types::SearchCollectionType] {
69 self.search_collection_types.as_deref().unwrap_or_default()
70 }
71 pub fn size_range(&self) -> ::std::option::Option<&crate::types::LongRangeType> {
73 self.size_range.as_ref()
74 }
75 pub fn created_range(&self) -> ::std::option::Option<&crate::types::DateRangeType> {
77 self.created_range.as_ref()
78 }
79 pub fn modified_range(&self) -> ::std::option::Option<&crate::types::DateRangeType> {
81 self.modified_range.as_ref()
82 }
83}
84impl Filters {
85 pub fn builder() -> crate::types::builders::FiltersBuilder {
87 crate::types::builders::FiltersBuilder::default()
88 }
89}
90
91#[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 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 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 pub fn get_text_locales(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LanguageCodeType>> {
125 &self.text_locales
126 }
127 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 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 pub fn get_content_categories(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ContentCategoryType>> {
145 &self.content_categories
146 }
147 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 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 pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchResourceType>> {
165 &self.resource_types
166 }
167 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 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 pub fn get_labels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
185 &self.labels
186 }
187 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 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 pub fn get_principals(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchPrincipalType>> {
205 &self.principals
206 }
207 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 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 pub fn get_ancestor_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
225 &self.ancestor_ids
226 }
227 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 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 pub fn get_search_collection_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchCollectionType>> {
245 &self.search_collection_types
246 }
247 pub fn size_range(mut self, input: crate::types::LongRangeType) -> Self {
249 self.size_range = ::std::option::Option::Some(input);
250 self
251 }
252 pub fn set_size_range(mut self, input: ::std::option::Option<crate::types::LongRangeType>) -> Self {
254 self.size_range = input;
255 self
256 }
257 pub fn get_size_range(&self) -> &::std::option::Option<crate::types::LongRangeType> {
259 &self.size_range
260 }
261 pub fn created_range(mut self, input: crate::types::DateRangeType) -> Self {
263 self.created_range = ::std::option::Option::Some(input);
264 self
265 }
266 pub fn set_created_range(mut self, input: ::std::option::Option<crate::types::DateRangeType>) -> Self {
268 self.created_range = input;
269 self
270 }
271 pub fn get_created_range(&self) -> &::std::option::Option<crate::types::DateRangeType> {
273 &self.created_range
274 }
275 pub fn modified_range(mut self, input: crate::types::DateRangeType) -> Self {
277 self.modified_range = ::std::option::Option::Some(input);
278 self
279 }
280 pub fn set_modified_range(mut self, input: ::std::option::Option<crate::types::DateRangeType>) -> Self {
282 self.modified_range = input;
283 self
284 }
285 pub fn get_modified_range(&self) -> &::std::option::Option<crate::types::DateRangeType> {
287 &self.modified_range
288 }
289 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}