aws_sdk_fsx/operation/copy_backup/
_copy_backup_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CopyBackupInput {
6    /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
7    pub client_request_token: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of the source backup. Specifies the ID of the backup that's being copied.</p>
9    pub source_backup_id: ::std::option::Option<::std::string::String>,
10    /// <p>The source Amazon Web Services Region of the backup. Specifies the Amazon Web Services Region from which the backup is being copied. The source and destination Regions must be in the same Amazon Web Services partition. If you don't specify a Region, <code>SourceRegion</code> defaults to the Region where the request is sent from (in-Region copy).</p>
11    pub source_region: ::std::option::Option<::std::string::String>,
12    /// <p>Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on Amazon FSx file systems, as follows:</p>
13    /// <ul>
14    /// <li>
15    /// <p>Amazon FSx for Lustre <code>PERSISTENT_1</code> and <code>PERSISTENT_2</code> deployment types only.</p>
16    /// <p><code>SCRATCH_1</code> and <code>SCRATCH_2</code> types are encrypted using the Amazon FSx service KMS key for your account.</p></li>
17    /// <li>
18    /// <p>Amazon FSx for NetApp ONTAP</p></li>
19    /// <li>
20    /// <p>Amazon FSx for OpenZFS</p></li>
21    /// <li>
22    /// <p>Amazon FSx for Windows File Server</p></li>
23    /// </ul>
24    /// <p>If a <code>KmsKeyId</code> isn't specified, the Amazon FSx-managed KMS key for your account is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html">Encrypt</a> in the <i>Key Management Service API Reference</i>.</p>
25    pub kms_key_id: ::std::option::Option<::std::string::String>,
26    /// <p>A Boolean flag indicating whether tags from the source backup should be copied to the backup copy. This value defaults to <code>false</code>.</p>
27    /// <p>If you set <code>CopyTags</code> to <code>true</code> and the source backup has existing tags, you can use the <code>Tags</code> parameter to create new tags, provided that the sum of the source backup tags and the new tags doesn't exceed 50. Both sets of tags are merged. If there are tag conflicts (for example, two tags with the same key but different values), the tags created with the <code>Tags</code> parameter take precedence.</p>
28    pub copy_tags: ::std::option::Option<bool>,
29    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
30    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
31}
32impl CopyBackupInput {
33    /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
34    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
35        self.client_request_token.as_deref()
36    }
37    /// <p>The ID of the source backup. Specifies the ID of the backup that's being copied.</p>
38    pub fn source_backup_id(&self) -> ::std::option::Option<&str> {
39        self.source_backup_id.as_deref()
40    }
41    /// <p>The source Amazon Web Services Region of the backup. Specifies the Amazon Web Services Region from which the backup is being copied. The source and destination Regions must be in the same Amazon Web Services partition. If you don't specify a Region, <code>SourceRegion</code> defaults to the Region where the request is sent from (in-Region copy).</p>
42    pub fn source_region(&self) -> ::std::option::Option<&str> {
43        self.source_region.as_deref()
44    }
45    /// <p>Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on Amazon FSx file systems, as follows:</p>
46    /// <ul>
47    /// <li>
48    /// <p>Amazon FSx for Lustre <code>PERSISTENT_1</code> and <code>PERSISTENT_2</code> deployment types only.</p>
49    /// <p><code>SCRATCH_1</code> and <code>SCRATCH_2</code> types are encrypted using the Amazon FSx service KMS key for your account.</p></li>
50    /// <li>
51    /// <p>Amazon FSx for NetApp ONTAP</p></li>
52    /// <li>
53    /// <p>Amazon FSx for OpenZFS</p></li>
54    /// <li>
55    /// <p>Amazon FSx for Windows File Server</p></li>
56    /// </ul>
57    /// <p>If a <code>KmsKeyId</code> isn't specified, the Amazon FSx-managed KMS key for your account is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html">Encrypt</a> in the <i>Key Management Service API Reference</i>.</p>
58    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
59        self.kms_key_id.as_deref()
60    }
61    /// <p>A Boolean flag indicating whether tags from the source backup should be copied to the backup copy. This value defaults to <code>false</code>.</p>
62    /// <p>If you set <code>CopyTags</code> to <code>true</code> and the source backup has existing tags, you can use the <code>Tags</code> parameter to create new tags, provided that the sum of the source backup tags and the new tags doesn't exceed 50. Both sets of tags are merged. If there are tag conflicts (for example, two tags with the same key but different values), the tags created with the <code>Tags</code> parameter take precedence.</p>
63    pub fn copy_tags(&self) -> ::std::option::Option<bool> {
64        self.copy_tags
65    }
66    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
67    ///
68    /// 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()`.
69    pub fn tags(&self) -> &[crate::types::Tag] {
70        self.tags.as_deref().unwrap_or_default()
71    }
72}
73impl CopyBackupInput {
74    /// Creates a new builder-style object to manufacture [`CopyBackupInput`](crate::operation::copy_backup::CopyBackupInput).
75    pub fn builder() -> crate::operation::copy_backup::builders::CopyBackupInputBuilder {
76        crate::operation::copy_backup::builders::CopyBackupInputBuilder::default()
77    }
78}
79
80/// A builder for [`CopyBackupInput`](crate::operation::copy_backup::CopyBackupInput).
81#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
82#[non_exhaustive]
83pub struct CopyBackupInputBuilder {
84    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
85    pub(crate) source_backup_id: ::std::option::Option<::std::string::String>,
86    pub(crate) source_region: ::std::option::Option<::std::string::String>,
87    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
88    pub(crate) copy_tags: ::std::option::Option<bool>,
89    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
90}
91impl CopyBackupInputBuilder {
92    /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
93    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.client_request_token = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
98    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.client_request_token = input;
100        self
101    }
102    /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
103    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
104        &self.client_request_token
105    }
106    /// <p>The ID of the source backup. Specifies the ID of the backup that's being copied.</p>
107    /// This field is required.
108    pub fn source_backup_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.source_backup_id = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The ID of the source backup. Specifies the ID of the backup that's being copied.</p>
113    pub fn set_source_backup_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.source_backup_id = input;
115        self
116    }
117    /// <p>The ID of the source backup. Specifies the ID of the backup that's being copied.</p>
118    pub fn get_source_backup_id(&self) -> &::std::option::Option<::std::string::String> {
119        &self.source_backup_id
120    }
121    /// <p>The source Amazon Web Services Region of the backup. Specifies the Amazon Web Services Region from which the backup is being copied. The source and destination Regions must be in the same Amazon Web Services partition. If you don't specify a Region, <code>SourceRegion</code> defaults to the Region where the request is sent from (in-Region copy).</p>
122    pub fn source_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.source_region = ::std::option::Option::Some(input.into());
124        self
125    }
126    /// <p>The source Amazon Web Services Region of the backup. Specifies the Amazon Web Services Region from which the backup is being copied. The source and destination Regions must be in the same Amazon Web Services partition. If you don't specify a Region, <code>SourceRegion</code> defaults to the Region where the request is sent from (in-Region copy).</p>
127    pub fn set_source_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.source_region = input;
129        self
130    }
131    /// <p>The source Amazon Web Services Region of the backup. Specifies the Amazon Web Services Region from which the backup is being copied. The source and destination Regions must be in the same Amazon Web Services partition. If you don't specify a Region, <code>SourceRegion</code> defaults to the Region where the request is sent from (in-Region copy).</p>
132    pub fn get_source_region(&self) -> &::std::option::Option<::std::string::String> {
133        &self.source_region
134    }
135    /// <p>Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on Amazon FSx file systems, as follows:</p>
136    /// <ul>
137    /// <li>
138    /// <p>Amazon FSx for Lustre <code>PERSISTENT_1</code> and <code>PERSISTENT_2</code> deployment types only.</p>
139    /// <p><code>SCRATCH_1</code> and <code>SCRATCH_2</code> types are encrypted using the Amazon FSx service KMS key for your account.</p></li>
140    /// <li>
141    /// <p>Amazon FSx for NetApp ONTAP</p></li>
142    /// <li>
143    /// <p>Amazon FSx for OpenZFS</p></li>
144    /// <li>
145    /// <p>Amazon FSx for Windows File Server</p></li>
146    /// </ul>
147    /// <p>If a <code>KmsKeyId</code> isn't specified, the Amazon FSx-managed KMS key for your account is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html">Encrypt</a> in the <i>Key Management Service API Reference</i>.</p>
148    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.kms_key_id = ::std::option::Option::Some(input.into());
150        self
151    }
152    /// <p>Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on Amazon FSx file systems, as follows:</p>
153    /// <ul>
154    /// <li>
155    /// <p>Amazon FSx for Lustre <code>PERSISTENT_1</code> and <code>PERSISTENT_2</code> deployment types only.</p>
156    /// <p><code>SCRATCH_1</code> and <code>SCRATCH_2</code> types are encrypted using the Amazon FSx service KMS key for your account.</p></li>
157    /// <li>
158    /// <p>Amazon FSx for NetApp ONTAP</p></li>
159    /// <li>
160    /// <p>Amazon FSx for OpenZFS</p></li>
161    /// <li>
162    /// <p>Amazon FSx for Windows File Server</p></li>
163    /// </ul>
164    /// <p>If a <code>KmsKeyId</code> isn't specified, the Amazon FSx-managed KMS key for your account is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html">Encrypt</a> in the <i>Key Management Service API Reference</i>.</p>
165    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.kms_key_id = input;
167        self
168    }
169    /// <p>Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on Amazon FSx file systems, as follows:</p>
170    /// <ul>
171    /// <li>
172    /// <p>Amazon FSx for Lustre <code>PERSISTENT_1</code> and <code>PERSISTENT_2</code> deployment types only.</p>
173    /// <p><code>SCRATCH_1</code> and <code>SCRATCH_2</code> types are encrypted using the Amazon FSx service KMS key for your account.</p></li>
174    /// <li>
175    /// <p>Amazon FSx for NetApp ONTAP</p></li>
176    /// <li>
177    /// <p>Amazon FSx for OpenZFS</p></li>
178    /// <li>
179    /// <p>Amazon FSx for Windows File Server</p></li>
180    /// </ul>
181    /// <p>If a <code>KmsKeyId</code> isn't specified, the Amazon FSx-managed KMS key for your account is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html">Encrypt</a> in the <i>Key Management Service API Reference</i>.</p>
182    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
183        &self.kms_key_id
184    }
185    /// <p>A Boolean flag indicating whether tags from the source backup should be copied to the backup copy. This value defaults to <code>false</code>.</p>
186    /// <p>If you set <code>CopyTags</code> to <code>true</code> and the source backup has existing tags, you can use the <code>Tags</code> parameter to create new tags, provided that the sum of the source backup tags and the new tags doesn't exceed 50. Both sets of tags are merged. If there are tag conflicts (for example, two tags with the same key but different values), the tags created with the <code>Tags</code> parameter take precedence.</p>
187    pub fn copy_tags(mut self, input: bool) -> Self {
188        self.copy_tags = ::std::option::Option::Some(input);
189        self
190    }
191    /// <p>A Boolean flag indicating whether tags from the source backup should be copied to the backup copy. This value defaults to <code>false</code>.</p>
192    /// <p>If you set <code>CopyTags</code> to <code>true</code> and the source backup has existing tags, you can use the <code>Tags</code> parameter to create new tags, provided that the sum of the source backup tags and the new tags doesn't exceed 50. Both sets of tags are merged. If there are tag conflicts (for example, two tags with the same key but different values), the tags created with the <code>Tags</code> parameter take precedence.</p>
193    pub fn set_copy_tags(mut self, input: ::std::option::Option<bool>) -> Self {
194        self.copy_tags = input;
195        self
196    }
197    /// <p>A Boolean flag indicating whether tags from the source backup should be copied to the backup copy. This value defaults to <code>false</code>.</p>
198    /// <p>If you set <code>CopyTags</code> to <code>true</code> and the source backup has existing tags, you can use the <code>Tags</code> parameter to create new tags, provided that the sum of the source backup tags and the new tags doesn't exceed 50. Both sets of tags are merged. If there are tag conflicts (for example, two tags with the same key but different values), the tags created with the <code>Tags</code> parameter take precedence.</p>
199    pub fn get_copy_tags(&self) -> &::std::option::Option<bool> {
200        &self.copy_tags
201    }
202    /// Appends an item to `tags`.
203    ///
204    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
205    ///
206    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
207    pub fn tags(mut self, input: crate::types::Tag) -> Self {
208        let mut v = self.tags.unwrap_or_default();
209        v.push(input);
210        self.tags = ::std::option::Option::Some(v);
211        self
212    }
213    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
214    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
215        self.tags = input;
216        self
217    }
218    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
219    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
220        &self.tags
221    }
222    /// Consumes the builder and constructs a [`CopyBackupInput`](crate::operation::copy_backup::CopyBackupInput).
223    pub fn build(self) -> ::std::result::Result<crate::operation::copy_backup::CopyBackupInput, ::aws_smithy_types::error::operation::BuildError> {
224        ::std::result::Result::Ok(crate::operation::copy_backup::CopyBackupInput {
225            client_request_token: self.client_request_token,
226            source_backup_id: self.source_backup_id,
227            source_region: self.source_region,
228            kms_key_id: self.kms_key_id,
229            copy_tags: self.copy_tags,
230            tags: self.tags,
231        })
232    }
233}