Skip to main content

aws_sdk_workdocs/types/
_folder_metadata.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes a folder.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct FolderMetadata {
7    /// <p>The ID of the folder.</p>
8    pub id: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the folder.</p>
10    pub name: ::std::option::Option<::std::string::String>,
11    /// <p>The ID of the creator.</p>
12    pub creator_id: ::std::option::Option<::std::string::String>,
13    /// <p>The ID of the parent folder.</p>
14    pub parent_folder_id: ::std::option::Option<::std::string::String>,
15    /// <p>The time when the folder was created.</p>
16    pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
17    /// <p>The time when the folder was updated.</p>
18    pub modified_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
19    /// <p>The resource state of the folder.</p>
20    pub resource_state: ::std::option::Option<crate::types::ResourceStateType>,
21    /// <p>The unique identifier created from the subfolders and documents of the folder.</p>
22    pub signature: ::std::option::Option<::std::string::String>,
23    /// <p>List of labels on the folder.</p>
24    pub labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
25    /// <p>The size of the folder metadata.</p>
26    pub size: ::std::option::Option<i64>,
27    /// <p>The size of the latest version of the folder metadata.</p>
28    pub latest_version_size: ::std::option::Option<i64>,
29}
30impl FolderMetadata {
31    /// <p>The ID of the folder.</p>
32    pub fn id(&self) -> ::std::option::Option<&str> {
33        self.id.as_deref()
34    }
35    /// <p>The name of the folder.</p>
36    pub fn name(&self) -> ::std::option::Option<&str> {
37        self.name.as_deref()
38    }
39    /// <p>The ID of the creator.</p>
40    pub fn creator_id(&self) -> ::std::option::Option<&str> {
41        self.creator_id.as_deref()
42    }
43    /// <p>The ID of the parent folder.</p>
44    pub fn parent_folder_id(&self) -> ::std::option::Option<&str> {
45        self.parent_folder_id.as_deref()
46    }
47    /// <p>The time when the folder was created.</p>
48    pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
49        self.created_timestamp.as_ref()
50    }
51    /// <p>The time when the folder was updated.</p>
52    pub fn modified_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
53        self.modified_timestamp.as_ref()
54    }
55    /// <p>The resource state of the folder.</p>
56    pub fn resource_state(&self) -> ::std::option::Option<&crate::types::ResourceStateType> {
57        self.resource_state.as_ref()
58    }
59    /// <p>The unique identifier created from the subfolders and documents of the folder.</p>
60    pub fn signature(&self) -> ::std::option::Option<&str> {
61        self.signature.as_deref()
62    }
63    /// <p>List of labels on the folder.</p>
64    ///
65    /// 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()`.
66    pub fn labels(&self) -> &[::std::string::String] {
67        self.labels.as_deref().unwrap_or_default()
68    }
69    /// <p>The size of the folder metadata.</p>
70    pub fn size(&self) -> ::std::option::Option<i64> {
71        self.size
72    }
73    /// <p>The size of the latest version of the folder metadata.</p>
74    pub fn latest_version_size(&self) -> ::std::option::Option<i64> {
75        self.latest_version_size
76    }
77}
78impl ::std::fmt::Debug for FolderMetadata {
79    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
80        let mut formatter = f.debug_struct("FolderMetadata");
81        formatter.field("id", &self.id);
82        formatter.field("name", &"*** Sensitive Data Redacted ***");
83        formatter.field("creator_id", &self.creator_id);
84        formatter.field("parent_folder_id", &self.parent_folder_id);
85        formatter.field("created_timestamp", &self.created_timestamp);
86        formatter.field("modified_timestamp", &self.modified_timestamp);
87        formatter.field("resource_state", &self.resource_state);
88        formatter.field("signature", &self.signature);
89        formatter.field("labels", &self.labels);
90        formatter.field("size", &self.size);
91        formatter.field("latest_version_size", &self.latest_version_size);
92        formatter.finish()
93    }
94}
95impl FolderMetadata {
96    /// Creates a new builder-style object to manufacture [`FolderMetadata`](crate::types::FolderMetadata).
97    pub fn builder() -> crate::types::builders::FolderMetadataBuilder {
98        crate::types::builders::FolderMetadataBuilder::default()
99    }
100}
101
102/// A builder for [`FolderMetadata`](crate::types::FolderMetadata).
103#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
104#[non_exhaustive]
105pub struct FolderMetadataBuilder {
106    pub(crate) id: ::std::option::Option<::std::string::String>,
107    pub(crate) name: ::std::option::Option<::std::string::String>,
108    pub(crate) creator_id: ::std::option::Option<::std::string::String>,
109    pub(crate) parent_folder_id: ::std::option::Option<::std::string::String>,
110    pub(crate) created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
111    pub(crate) modified_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
112    pub(crate) resource_state: ::std::option::Option<crate::types::ResourceStateType>,
113    pub(crate) signature: ::std::option::Option<::std::string::String>,
114    pub(crate) labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
115    pub(crate) size: ::std::option::Option<i64>,
116    pub(crate) latest_version_size: ::std::option::Option<i64>,
117}
118impl FolderMetadataBuilder {
119    /// <p>The ID of the folder.</p>
120    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.id = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>The ID of the folder.</p>
125    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.id = input;
127        self
128    }
129    /// <p>The ID of the folder.</p>
130    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
131        &self.id
132    }
133    /// <p>The name of the folder.</p>
134    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.name = ::std::option::Option::Some(input.into());
136        self
137    }
138    /// <p>The name of the folder.</p>
139    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.name = input;
141        self
142    }
143    /// <p>The name of the folder.</p>
144    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
145        &self.name
146    }
147    /// <p>The ID of the creator.</p>
148    pub fn creator_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.creator_id = ::std::option::Option::Some(input.into());
150        self
151    }
152    /// <p>The ID of the creator.</p>
153    pub fn set_creator_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.creator_id = input;
155        self
156    }
157    /// <p>The ID of the creator.</p>
158    pub fn get_creator_id(&self) -> &::std::option::Option<::std::string::String> {
159        &self.creator_id
160    }
161    /// <p>The ID of the parent folder.</p>
162    pub fn parent_folder_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.parent_folder_id = ::std::option::Option::Some(input.into());
164        self
165    }
166    /// <p>The ID of the parent folder.</p>
167    pub fn set_parent_folder_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.parent_folder_id = input;
169        self
170    }
171    /// <p>The ID of the parent folder.</p>
172    pub fn get_parent_folder_id(&self) -> &::std::option::Option<::std::string::String> {
173        &self.parent_folder_id
174    }
175    /// <p>The time when the folder was created.</p>
176    pub fn created_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
177        self.created_timestamp = ::std::option::Option::Some(input);
178        self
179    }
180    /// <p>The time when the folder was created.</p>
181    pub fn set_created_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
182        self.created_timestamp = input;
183        self
184    }
185    /// <p>The time when the folder was created.</p>
186    pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
187        &self.created_timestamp
188    }
189    /// <p>The time when the folder was updated.</p>
190    pub fn modified_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
191        self.modified_timestamp = ::std::option::Option::Some(input);
192        self
193    }
194    /// <p>The time when the folder was updated.</p>
195    pub fn set_modified_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
196        self.modified_timestamp = input;
197        self
198    }
199    /// <p>The time when the folder was updated.</p>
200    pub fn get_modified_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
201        &self.modified_timestamp
202    }
203    /// <p>The resource state of the folder.</p>
204    pub fn resource_state(mut self, input: crate::types::ResourceStateType) -> Self {
205        self.resource_state = ::std::option::Option::Some(input);
206        self
207    }
208    /// <p>The resource state of the folder.</p>
209    pub fn set_resource_state(mut self, input: ::std::option::Option<crate::types::ResourceStateType>) -> Self {
210        self.resource_state = input;
211        self
212    }
213    /// <p>The resource state of the folder.</p>
214    pub fn get_resource_state(&self) -> &::std::option::Option<crate::types::ResourceStateType> {
215        &self.resource_state
216    }
217    /// <p>The unique identifier created from the subfolders and documents of the folder.</p>
218    pub fn signature(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219        self.signature = ::std::option::Option::Some(input.into());
220        self
221    }
222    /// <p>The unique identifier created from the subfolders and documents of the folder.</p>
223    pub fn set_signature(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224        self.signature = input;
225        self
226    }
227    /// <p>The unique identifier created from the subfolders and documents of the folder.</p>
228    pub fn get_signature(&self) -> &::std::option::Option<::std::string::String> {
229        &self.signature
230    }
231    /// Appends an item to `labels`.
232    ///
233    /// To override the contents of this collection use [`set_labels`](Self::set_labels).
234    ///
235    /// <p>List of labels on the folder.</p>
236    pub fn labels(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
237        let mut v = self.labels.unwrap_or_default();
238        v.push(input.into());
239        self.labels = ::std::option::Option::Some(v);
240        self
241    }
242    /// <p>List of labels on the folder.</p>
243    pub fn set_labels(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
244        self.labels = input;
245        self
246    }
247    /// <p>List of labels on the folder.</p>
248    pub fn get_labels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
249        &self.labels
250    }
251    /// <p>The size of the folder metadata.</p>
252    pub fn size(mut self, input: i64) -> Self {
253        self.size = ::std::option::Option::Some(input);
254        self
255    }
256    /// <p>The size of the folder metadata.</p>
257    pub fn set_size(mut self, input: ::std::option::Option<i64>) -> Self {
258        self.size = input;
259        self
260    }
261    /// <p>The size of the folder metadata.</p>
262    pub fn get_size(&self) -> &::std::option::Option<i64> {
263        &self.size
264    }
265    /// <p>The size of the latest version of the folder metadata.</p>
266    pub fn latest_version_size(mut self, input: i64) -> Self {
267        self.latest_version_size = ::std::option::Option::Some(input);
268        self
269    }
270    /// <p>The size of the latest version of the folder metadata.</p>
271    pub fn set_latest_version_size(mut self, input: ::std::option::Option<i64>) -> Self {
272        self.latest_version_size = input;
273        self
274    }
275    /// <p>The size of the latest version of the folder metadata.</p>
276    pub fn get_latest_version_size(&self) -> &::std::option::Option<i64> {
277        &self.latest_version_size
278    }
279    /// Consumes the builder and constructs a [`FolderMetadata`](crate::types::FolderMetadata).
280    pub fn build(self) -> crate::types::FolderMetadata {
281        crate::types::FolderMetadata {
282            id: self.id,
283            name: self.name,
284            creator_id: self.creator_id,
285            parent_folder_id: self.parent_folder_id,
286            created_timestamp: self.created_timestamp,
287            modified_timestamp: self.modified_timestamp,
288            resource_state: self.resource_state,
289            signature: self.signature,
290            labels: self.labels,
291            size: self.size,
292            latest_version_size: self.latest_version_size,
293        }
294    }
295}
296impl ::std::fmt::Debug for FolderMetadataBuilder {
297    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
298        let mut formatter = f.debug_struct("FolderMetadataBuilder");
299        formatter.field("id", &self.id);
300        formatter.field("name", &"*** Sensitive Data Redacted ***");
301        formatter.field("creator_id", &self.creator_id);
302        formatter.field("parent_folder_id", &self.parent_folder_id);
303        formatter.field("created_timestamp", &self.created_timestamp);
304        formatter.field("modified_timestamp", &self.modified_timestamp);
305        formatter.field("resource_state", &self.resource_state);
306        formatter.field("signature", &self.signature);
307        formatter.field("labels", &self.labels);
308        formatter.field("size", &self.size);
309        formatter.field("latest_version_size", &self.latest_version_size);
310        formatter.finish()
311    }
312}