aws_sdk_fsx/operation/create_backup/
_create_backup_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request object for the <code>CreateBackup</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateBackupInput {
7    /// <p>The ID of the file system to back up.</p>
8    pub file_system_id: ::std::option::Option<::std::string::String>,
9    /// <p>(Optional) A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent creation. This string is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
10    pub client_request_token: ::std::option::Option<::std::string::String>,
11    /// <p>(Optional) The tags to apply to the backup at backup creation. The key value of the <code>Name</code> tag appears in the console as the backup name. If you have set <code>CopyTagsToBackups</code> to <code>true</code>, and you specify one or more tags using the <code>CreateBackup</code> operation, no existing file system tags are copied from the file system to the backup.</p>
12    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
13    /// <p>(Optional) The ID of the FSx for ONTAP volume to back up.</p>
14    pub volume_id: ::std::option::Option<::std::string::String>,
15}
16impl CreateBackupInput {
17    /// <p>The ID of the file system to back up.</p>
18    pub fn file_system_id(&self) -> ::std::option::Option<&str> {
19        self.file_system_id.as_deref()
20    }
21    /// <p>(Optional) A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent creation. This string is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
22    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
23        self.client_request_token.as_deref()
24    }
25    /// <p>(Optional) The tags to apply to the backup at backup creation. The key value of the <code>Name</code> tag appears in the console as the backup name. If you have set <code>CopyTagsToBackups</code> to <code>true</code>, and you specify one or more tags using the <code>CreateBackup</code> operation, no existing file system tags are copied from the file system to the backup.</p>
26    ///
27    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
28    pub fn tags(&self) -> &[crate::types::Tag] {
29        self.tags.as_deref().unwrap_or_default()
30    }
31    /// <p>(Optional) The ID of the FSx for ONTAP volume to back up.</p>
32    pub fn volume_id(&self) -> ::std::option::Option<&str> {
33        self.volume_id.as_deref()
34    }
35}
36impl CreateBackupInput {
37    /// Creates a new builder-style object to manufacture [`CreateBackupInput`](crate::operation::create_backup::CreateBackupInput).
38    pub fn builder() -> crate::operation::create_backup::builders::CreateBackupInputBuilder {
39        crate::operation::create_backup::builders::CreateBackupInputBuilder::default()
40    }
41}
42
43/// A builder for [`CreateBackupInput`](crate::operation::create_backup::CreateBackupInput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
45#[non_exhaustive]
46pub struct CreateBackupInputBuilder {
47    pub(crate) file_system_id: ::std::option::Option<::std::string::String>,
48    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
49    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
50    pub(crate) volume_id: ::std::option::Option<::std::string::String>,
51}
52impl CreateBackupInputBuilder {
53    /// <p>The ID of the file system to back up.</p>
54    pub fn file_system_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.file_system_id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The ID of the file system to back up.</p>
59    pub fn set_file_system_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.file_system_id = input;
61        self
62    }
63    /// <p>The ID of the file system to back up.</p>
64    pub fn get_file_system_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.file_system_id
66    }
67    /// <p>(Optional) A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent creation. This string is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
68    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.client_request_token = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>(Optional) A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent creation. This string is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
73    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.client_request_token = input;
75        self
76    }
77    /// <p>(Optional) A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent creation. This string is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
78    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
79        &self.client_request_token
80    }
81    /// Appends an item to `tags`.
82    ///
83    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
84    ///
85    /// <p>(Optional) The tags to apply to the backup at backup creation. The key value of the <code>Name</code> tag appears in the console as the backup name. If you have set <code>CopyTagsToBackups</code> to <code>true</code>, and you specify one or more tags using the <code>CreateBackup</code> operation, no existing file system tags are copied from the file system to the backup.</p>
86    pub fn tags(mut self, input: crate::types::Tag) -> Self {
87        let mut v = self.tags.unwrap_or_default();
88        v.push(input);
89        self.tags = ::std::option::Option::Some(v);
90        self
91    }
92    /// <p>(Optional) The tags to apply to the backup at backup creation. The key value of the <code>Name</code> tag appears in the console as the backup name. If you have set <code>CopyTagsToBackups</code> to <code>true</code>, and you specify one or more tags using the <code>CreateBackup</code> operation, no existing file system tags are copied from the file system to the backup.</p>
93    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
94        self.tags = input;
95        self
96    }
97    /// <p>(Optional) The tags to apply to the backup at backup creation. The key value of the <code>Name</code> tag appears in the console as the backup name. If you have set <code>CopyTagsToBackups</code> to <code>true</code>, and you specify one or more tags using the <code>CreateBackup</code> operation, no existing file system tags are copied from the file system to the backup.</p>
98    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
99        &self.tags
100    }
101    /// <p>(Optional) The ID of the FSx for ONTAP volume to back up.</p>
102    pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.volume_id = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>(Optional) The ID of the FSx for ONTAP volume to back up.</p>
107    pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.volume_id = input;
109        self
110    }
111    /// <p>(Optional) The ID of the FSx for ONTAP volume to back up.</p>
112    pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
113        &self.volume_id
114    }
115    /// Consumes the builder and constructs a [`CreateBackupInput`](crate::operation::create_backup::CreateBackupInput).
116    pub fn build(
117        self,
118    ) -> ::std::result::Result<crate::operation::create_backup::CreateBackupInput, ::aws_smithy_types::error::operation::BuildError> {
119        ::std::result::Result::Ok(crate::operation::create_backup::CreateBackupInput {
120            file_system_id: self.file_system_id,
121            client_request_token: self.client_request_token,
122            tags: self.tags,
123            volume_id: self.volume_id,
124        })
125    }
126}