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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A backup of an Amazon FSx for Windows File Server, Amazon FSx for Lustre file system, Amazon FSx for NetApp ONTAP volume, or Amazon FSx for OpenZFS file system.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Backup {
    /// <p>The ID of the backup.</p>
    #[doc(hidden)]
    pub backup_id: ::std::option::Option<::std::string::String>,
    /// <p>The lifecycle status of the backup.</p>
    /// <ul>
    /// <li> <p> <code>AVAILABLE</code> - The backup is fully available.</p> </li>
    /// <li> <p> <code>PENDING</code> - For user-initiated backups on Lustre file systems only; Amazon FSx hasn't started creating the backup.</p> </li>
    /// <li> <p> <code>CREATING</code> - Amazon FSx is creating the backup.</p> </li>
    /// <li> <p> <code>TRANSFERRING</code> - For user-initiated backups on Lustre file systems only; Amazon FSx is transferring the backup to Amazon S3.</p> </li>
    /// <li> <p> <code>COPYING</code> - Amazon FSx is copying the backup.</p> </li>
    /// <li> <p> <code>DELETED</code> - Amazon FSx deleted the backup and it's no longer available.</p> </li>
    /// <li> <p> <code>FAILED</code> - Amazon FSx couldn't finish the backup.</p> </li>
    /// </ul>
    #[doc(hidden)]
    pub lifecycle: ::std::option::Option<crate::types::BackupLifecycle>,
    /// <p>Details explaining any failures that occurred when creating a backup.</p>
    #[doc(hidden)]
    pub failure_details: ::std::option::Option<crate::types::BackupFailureDetails>,
    /// <p>The type of the file-system backup.</p>
    #[doc(hidden)]
    pub r#type: ::std::option::Option<crate::types::BackupType>,
    /// <p>The current percent of progress of an asynchronous task.</p>
    #[doc(hidden)]
    pub progress_percent: ::std::option::Option<i32>,
    /// <p>The time when a particular backup was created.</p>
    #[doc(hidden)]
    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The ID of the Key Management Service (KMS) key used to encrypt the backup of the Amazon FSx file system's data at rest. </p>
    #[doc(hidden)]
    pub kms_key_id: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) for the backup resource.</p>
    #[doc(hidden)]
    pub resource_arn: ::std::option::Option<::std::string::String>,
    /// <p>The tags associated with a particular file system.</p>
    #[doc(hidden)]
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>The metadata of the file system associated with the backup. This metadata is persisted even if the file system is deleted.</p>
    #[doc(hidden)]
    pub file_system: ::std::option::Option<crate::types::FileSystem>,
    /// <p>The configuration of the self-managed Microsoft Active Directory directory to which the Windows File Server instance is joined.</p>
    #[doc(hidden)]
    pub directory_information: ::std::option::Option<crate::types::ActiveDirectoryBackupAttributes>,
    /// <p>An Amazon Web Services account ID. This ID is a 12-digit number that you use to construct Amazon Resource Names (ARNs) for resources.</p>
    #[doc(hidden)]
    pub owner_id: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the source backup. Specifies the backup that you are copying.</p>
    #[doc(hidden)]
    pub source_backup_id: ::std::option::Option<::std::string::String>,
    /// <p>The source Region of the backup. Specifies the Region from where this backup is copied.</p>
    #[doc(hidden)]
    pub source_backup_region: ::std::option::Option<::std::string::String>,
    /// <p>Specifies the resource type that's backed up.</p>
    #[doc(hidden)]
    pub resource_type: ::std::option::Option<crate::types::ResourceType>,
    /// <p>Describes an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume.</p>
    #[doc(hidden)]
    pub volume: ::std::option::Option<crate::types::Volume>,
}
impl Backup {
    /// <p>The ID of the backup.</p>
    pub fn backup_id(&self) -> ::std::option::Option<&str> {
        self.backup_id.as_deref()
    }
    /// <p>The lifecycle status of the backup.</p>
    /// <ul>
    /// <li> <p> <code>AVAILABLE</code> - The backup is fully available.</p> </li>
    /// <li> <p> <code>PENDING</code> - For user-initiated backups on Lustre file systems only; Amazon FSx hasn't started creating the backup.</p> </li>
    /// <li> <p> <code>CREATING</code> - Amazon FSx is creating the backup.</p> </li>
    /// <li> <p> <code>TRANSFERRING</code> - For user-initiated backups on Lustre file systems only; Amazon FSx is transferring the backup to Amazon S3.</p> </li>
    /// <li> <p> <code>COPYING</code> - Amazon FSx is copying the backup.</p> </li>
    /// <li> <p> <code>DELETED</code> - Amazon FSx deleted the backup and it's no longer available.</p> </li>
    /// <li> <p> <code>FAILED</code> - Amazon FSx couldn't finish the backup.</p> </li>
    /// </ul>
    pub fn lifecycle(&self) -> ::std::option::Option<&crate::types::BackupLifecycle> {
        self.lifecycle.as_ref()
    }
    /// <p>Details explaining any failures that occurred when creating a backup.</p>
    pub fn failure_details(&self) -> ::std::option::Option<&crate::types::BackupFailureDetails> {
        self.failure_details.as_ref()
    }
    /// <p>The type of the file-system backup.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::BackupType> {
        self.r#type.as_ref()
    }
    /// <p>The current percent of progress of an asynchronous task.</p>
    pub fn progress_percent(&self) -> ::std::option::Option<i32> {
        self.progress_percent
    }
    /// <p>The time when a particular backup was created.</p>
    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
    /// <p>The ID of the Key Management Service (KMS) key used to encrypt the backup of the Amazon FSx file system's data at rest. </p>
    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
        self.kms_key_id.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) for the backup resource.</p>
    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
        self.resource_arn.as_deref()
    }
    /// <p>The tags associated with a particular file system.</p>
    pub fn tags(&self) -> ::std::option::Option<&[crate::types::Tag]> {
        self.tags.as_deref()
    }
    /// <p>The metadata of the file system associated with the backup. This metadata is persisted even if the file system is deleted.</p>
    pub fn file_system(&self) -> ::std::option::Option<&crate::types::FileSystem> {
        self.file_system.as_ref()
    }
    /// <p>The configuration of the self-managed Microsoft Active Directory directory to which the Windows File Server instance is joined.</p>
    pub fn directory_information(
        &self,
    ) -> ::std::option::Option<&crate::types::ActiveDirectoryBackupAttributes> {
        self.directory_information.as_ref()
    }
    /// <p>An Amazon Web Services account ID. This ID is a 12-digit number that you use to construct Amazon Resource Names (ARNs) for resources.</p>
    pub fn owner_id(&self) -> ::std::option::Option<&str> {
        self.owner_id.as_deref()
    }
    /// <p>The ID of the source backup. Specifies the backup that you are copying.</p>
    pub fn source_backup_id(&self) -> ::std::option::Option<&str> {
        self.source_backup_id.as_deref()
    }
    /// <p>The source Region of the backup. Specifies the Region from where this backup is copied.</p>
    pub fn source_backup_region(&self) -> ::std::option::Option<&str> {
        self.source_backup_region.as_deref()
    }
    /// <p>Specifies the resource type that's backed up.</p>
    pub fn resource_type(&self) -> ::std::option::Option<&crate::types::ResourceType> {
        self.resource_type.as_ref()
    }
    /// <p>Describes an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume.</p>
    pub fn volume(&self) -> ::std::option::Option<&crate::types::Volume> {
        self.volume.as_ref()
    }
}
impl Backup {
    /// Creates a new builder-style object to manufacture [`Backup`](crate::types::Backup).
    pub fn builder() -> crate::types::builders::BackupBuilder {
        crate::types::builders::BackupBuilder::default()
    }
}

/// A builder for [`Backup`](crate::types::Backup).
#[non_exhaustive]
#[derive(
    ::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug,
)]
pub struct BackupBuilder {
    pub(crate) backup_id: ::std::option::Option<::std::string::String>,
    pub(crate) lifecycle: ::std::option::Option<crate::types::BackupLifecycle>,
    pub(crate) failure_details: ::std::option::Option<crate::types::BackupFailureDetails>,
    pub(crate) r#type: ::std::option::Option<crate::types::BackupType>,
    pub(crate) progress_percent: ::std::option::Option<i32>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) file_system: ::std::option::Option<crate::types::FileSystem>,
    pub(crate) directory_information:
        ::std::option::Option<crate::types::ActiveDirectoryBackupAttributes>,
    pub(crate) owner_id: ::std::option::Option<::std::string::String>,
    pub(crate) source_backup_id: ::std::option::Option<::std::string::String>,
    pub(crate) source_backup_region: ::std::option::Option<::std::string::String>,
    pub(crate) resource_type: ::std::option::Option<crate::types::ResourceType>,
    pub(crate) volume: ::std::option::Option<crate::types::Volume>,
}
impl BackupBuilder {
    /// <p>The ID of the backup.</p>
    pub fn backup_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.backup_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the backup.</p>
    pub fn set_backup_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.backup_id = input;
        self
    }
    /// <p>The lifecycle status of the backup.</p>
    /// <ul>
    /// <li> <p> <code>AVAILABLE</code> - The backup is fully available.</p> </li>
    /// <li> <p> <code>PENDING</code> - For user-initiated backups on Lustre file systems only; Amazon FSx hasn't started creating the backup.</p> </li>
    /// <li> <p> <code>CREATING</code> - Amazon FSx is creating the backup.</p> </li>
    /// <li> <p> <code>TRANSFERRING</code> - For user-initiated backups on Lustre file systems only; Amazon FSx is transferring the backup to Amazon S3.</p> </li>
    /// <li> <p> <code>COPYING</code> - Amazon FSx is copying the backup.</p> </li>
    /// <li> <p> <code>DELETED</code> - Amazon FSx deleted the backup and it's no longer available.</p> </li>
    /// <li> <p> <code>FAILED</code> - Amazon FSx couldn't finish the backup.</p> </li>
    /// </ul>
    pub fn lifecycle(mut self, input: crate::types::BackupLifecycle) -> Self {
        self.lifecycle = ::std::option::Option::Some(input);
        self
    }
    /// <p>The lifecycle status of the backup.</p>
    /// <ul>
    /// <li> <p> <code>AVAILABLE</code> - The backup is fully available.</p> </li>
    /// <li> <p> <code>PENDING</code> - For user-initiated backups on Lustre file systems only; Amazon FSx hasn't started creating the backup.</p> </li>
    /// <li> <p> <code>CREATING</code> - Amazon FSx is creating the backup.</p> </li>
    /// <li> <p> <code>TRANSFERRING</code> - For user-initiated backups on Lustre file systems only; Amazon FSx is transferring the backup to Amazon S3.</p> </li>
    /// <li> <p> <code>COPYING</code> - Amazon FSx is copying the backup.</p> </li>
    /// <li> <p> <code>DELETED</code> - Amazon FSx deleted the backup and it's no longer available.</p> </li>
    /// <li> <p> <code>FAILED</code> - Amazon FSx couldn't finish the backup.</p> </li>
    /// </ul>
    pub fn set_lifecycle(
        mut self,
        input: ::std::option::Option<crate::types::BackupLifecycle>,
    ) -> Self {
        self.lifecycle = input;
        self
    }
    /// <p>Details explaining any failures that occurred when creating a backup.</p>
    pub fn failure_details(mut self, input: crate::types::BackupFailureDetails) -> Self {
        self.failure_details = ::std::option::Option::Some(input);
        self
    }
    /// <p>Details explaining any failures that occurred when creating a backup.</p>
    pub fn set_failure_details(
        mut self,
        input: ::std::option::Option<crate::types::BackupFailureDetails>,
    ) -> Self {
        self.failure_details = input;
        self
    }
    /// <p>The type of the file-system backup.</p>
    pub fn r#type(mut self, input: crate::types::BackupType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of the file-system backup.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::BackupType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The current percent of progress of an asynchronous task.</p>
    pub fn progress_percent(mut self, input: i32) -> Self {
        self.progress_percent = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current percent of progress of an asynchronous task.</p>
    pub fn set_progress_percent(mut self, input: ::std::option::Option<i32>) -> Self {
        self.progress_percent = input;
        self
    }
    /// <p>The time when a particular backup was created.</p>
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when a particular backup was created.</p>
    pub fn set_creation_time(
        mut self,
        input: ::std::option::Option<::aws_smithy_types::DateTime>,
    ) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The ID of the Key Management Service (KMS) key used to encrypt the backup of the Amazon FSx file system's data at rest. </p>
    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kms_key_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the Key Management Service (KMS) key used to encrypt the backup of the Amazon FSx file system's data at rest. </p>
    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kms_key_id = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the backup resource.</p>
    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the backup resource.</p>
    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_arn = input;
        self
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags associated with a particular file system.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>The tags associated with a particular file system.</p>
    pub fn set_tags(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    ) -> Self {
        self.tags = input;
        self
    }
    /// <p>The metadata of the file system associated with the backup. This metadata is persisted even if the file system is deleted.</p>
    pub fn file_system(mut self, input: crate::types::FileSystem) -> Self {
        self.file_system = ::std::option::Option::Some(input);
        self
    }
    /// <p>The metadata of the file system associated with the backup. This metadata is persisted even if the file system is deleted.</p>
    pub fn set_file_system(
        mut self,
        input: ::std::option::Option<crate::types::FileSystem>,
    ) -> Self {
        self.file_system = input;
        self
    }
    /// <p>The configuration of the self-managed Microsoft Active Directory directory to which the Windows File Server instance is joined.</p>
    pub fn directory_information(
        mut self,
        input: crate::types::ActiveDirectoryBackupAttributes,
    ) -> Self {
        self.directory_information = ::std::option::Option::Some(input);
        self
    }
    /// <p>The configuration of the self-managed Microsoft Active Directory directory to which the Windows File Server instance is joined.</p>
    pub fn set_directory_information(
        mut self,
        input: ::std::option::Option<crate::types::ActiveDirectoryBackupAttributes>,
    ) -> Self {
        self.directory_information = input;
        self
    }
    /// <p>An Amazon Web Services account ID. This ID is a 12-digit number that you use to construct Amazon Resource Names (ARNs) for resources.</p>
    pub fn owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.owner_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An Amazon Web Services account ID. This ID is a 12-digit number that you use to construct Amazon Resource Names (ARNs) for resources.</p>
    pub fn set_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.owner_id = input;
        self
    }
    /// <p>The ID of the source backup. Specifies the backup that you are copying.</p>
    pub fn source_backup_id(
        mut self,
        input: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        self.source_backup_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the source backup. Specifies the backup that you are copying.</p>
    pub fn set_source_backup_id(
        mut self,
        input: ::std::option::Option<::std::string::String>,
    ) -> Self {
        self.source_backup_id = input;
        self
    }
    /// <p>The source Region of the backup. Specifies the Region from where this backup is copied.</p>
    pub fn source_backup_region(
        mut self,
        input: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        self.source_backup_region = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The source Region of the backup. Specifies the Region from where this backup is copied.</p>
    pub fn set_source_backup_region(
        mut self,
        input: ::std::option::Option<::std::string::String>,
    ) -> Self {
        self.source_backup_region = input;
        self
    }
    /// <p>Specifies the resource type that's backed up.</p>
    pub fn resource_type(mut self, input: crate::types::ResourceType) -> Self {
        self.resource_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the resource type that's backed up.</p>
    pub fn set_resource_type(
        mut self,
        input: ::std::option::Option<crate::types::ResourceType>,
    ) -> Self {
        self.resource_type = input;
        self
    }
    /// <p>Describes an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume.</p>
    pub fn volume(mut self, input: crate::types::Volume) -> Self {
        self.volume = ::std::option::Option::Some(input);
        self
    }
    /// <p>Describes an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume.</p>
    pub fn set_volume(mut self, input: ::std::option::Option<crate::types::Volume>) -> Self {
        self.volume = input;
        self
    }
    /// Consumes the builder and constructs a [`Backup`](crate::types::Backup).
    pub fn build(self) -> crate::types::Backup {
        crate::types::Backup {
            backup_id: self.backup_id,
            lifecycle: self.lifecycle,
            failure_details: self.failure_details,
            r#type: self.r#type,
            progress_percent: self.progress_percent,
            creation_time: self.creation_time,
            kms_key_id: self.kms_key_id,
            resource_arn: self.resource_arn,
            tags: self.tags,
            file_system: self.file_system,
            directory_information: self.directory_information,
            owner_id: self.owner_id,
            source_backup_id: self.source_backup_id,
            source_backup_region: self.source_backup_region,
            resource_type: self.resource_type,
            volume: self.volume,
        }
    }
}