aws_sdk_ec2/operation/copy_volumes/
_copy_volumes_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 CopyVolumesInput {
6    /// <p>The ID of the source EBS volume to copy.</p>
7    pub source_volume_id: ::std::option::Option<::std::string::String>,
8    /// <p>The number of I/O operations per second (IOPS) to provision for the volume copy. Required for <code>io1</code> and <code>io2</code> volumes. Optional for <code>gp3</code> volumes. Omit for all other volume types. Full provisioned IOPS performance can be achieved only once the volume copy is fully initialized.</p>
9    /// <p>Valid ranges:</p>
10    /// <ul>
11    /// <li>
12    /// <p>gp3: <code>3,000 </code>(<i>default</i>)<code> - 80,000</code> IOPS</p></li>
13    /// <li>
14    /// <p>io1: <code>100 - 64,000</code> IOPS</p></li>
15    /// <li>
16    /// <p>io2: <code>100 - 256,000</code> IOPS</p></li>
17    /// </ul><note>
18    /// <p><a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Instances built on the Nitro System</a> can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.</p>
19    /// </note>
20    pub iops: ::std::option::Option<i32>,
21    /// <p>The size of the volume copy, in GiBs. The size must be equal to or greater than the size of the source volume. If not specified, the size defaults to the size of the source volume.</p>
22    /// <p>Maximum supported sizes:</p>
23    /// <ul>
24    /// <li>
25    /// <p>gp2: <code>16,384</code> GiB</p></li>
26    /// <li>
27    /// <p>gp3: <code>65,536</code> GiB</p></li>
28    /// <li>
29    /// <p>io1: <code>16,384</code> GiB</p></li>
30    /// <li>
31    /// <p>io2: <code>65,536</code> GiB</p></li>
32    /// <li>
33    /// <p>st1 and sc1: <code>16,384</code> GiB</p></li>
34    /// <li>
35    /// <p>standard: <code>1024</code> GiB</p></li>
36    /// </ul>
37    pub size: ::std::option::Option<i32>,
38    /// <p>The volume type for the volume copy. If not specified, the volume type defaults to <code>gp2</code>.</p>
39    pub volume_type: ::std::option::Option<crate::types::VolumeType>,
40    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
41    pub dry_run: ::std::option::Option<bool>,
42    /// <p>The tags to apply to the volume copy during creation.</p>
43    pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
44    /// <p>Indicates whether to enable Amazon EBS Multi-Attach for the volume copy. If you enable Multi-Attach, you can attach the volume to up to 16 Nitro instances in the same Availability Zone simultaneously. Supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a>.</p>
45    pub multi_attach_enabled: ::std::option::Option<bool>,
46    /// <p>The throughput to provision for the volume copy, in MiB/s. Supported for <code>gp3</code> volumes only. Omit for all other volume types. Full provisioned throughput performance can be achieved only once the volume copy is fully initialized.</p>
47    /// <p>Valid Range: <code>125 - 2000</code> MiB/s</p>
48    /// <p></p>
49    pub throughput: ::std::option::Option<i32>,
50    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html"> Ensure Idempotency</a>.</p>
51    pub client_token: ::std::option::Option<::std::string::String>,
52}
53impl CopyVolumesInput {
54    /// <p>The ID of the source EBS volume to copy.</p>
55    pub fn source_volume_id(&self) -> ::std::option::Option<&str> {
56        self.source_volume_id.as_deref()
57    }
58    /// <p>The number of I/O operations per second (IOPS) to provision for the volume copy. Required for <code>io1</code> and <code>io2</code> volumes. Optional for <code>gp3</code> volumes. Omit for all other volume types. Full provisioned IOPS performance can be achieved only once the volume copy is fully initialized.</p>
59    /// <p>Valid ranges:</p>
60    /// <ul>
61    /// <li>
62    /// <p>gp3: <code>3,000 </code>(<i>default</i>)<code> - 80,000</code> IOPS</p></li>
63    /// <li>
64    /// <p>io1: <code>100 - 64,000</code> IOPS</p></li>
65    /// <li>
66    /// <p>io2: <code>100 - 256,000</code> IOPS</p></li>
67    /// </ul><note>
68    /// <p><a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Instances built on the Nitro System</a> can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.</p>
69    /// </note>
70    pub fn iops(&self) -> ::std::option::Option<i32> {
71        self.iops
72    }
73    /// <p>The size of the volume copy, in GiBs. The size must be equal to or greater than the size of the source volume. If not specified, the size defaults to the size of the source volume.</p>
74    /// <p>Maximum supported sizes:</p>
75    /// <ul>
76    /// <li>
77    /// <p>gp2: <code>16,384</code> GiB</p></li>
78    /// <li>
79    /// <p>gp3: <code>65,536</code> GiB</p></li>
80    /// <li>
81    /// <p>io1: <code>16,384</code> GiB</p></li>
82    /// <li>
83    /// <p>io2: <code>65,536</code> GiB</p></li>
84    /// <li>
85    /// <p>st1 and sc1: <code>16,384</code> GiB</p></li>
86    /// <li>
87    /// <p>standard: <code>1024</code> GiB</p></li>
88    /// </ul>
89    pub fn size(&self) -> ::std::option::Option<i32> {
90        self.size
91    }
92    /// <p>The volume type for the volume copy. If not specified, the volume type defaults to <code>gp2</code>.</p>
93    pub fn volume_type(&self) -> ::std::option::Option<&crate::types::VolumeType> {
94        self.volume_type.as_ref()
95    }
96    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
97    pub fn dry_run(&self) -> ::std::option::Option<bool> {
98        self.dry_run
99    }
100    /// <p>The tags to apply to the volume copy during creation.</p>
101    ///
102    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
103    pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
104        self.tag_specifications.as_deref().unwrap_or_default()
105    }
106    /// <p>Indicates whether to enable Amazon EBS Multi-Attach for the volume copy. If you enable Multi-Attach, you can attach the volume to up to 16 Nitro instances in the same Availability Zone simultaneously. Supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a>.</p>
107    pub fn multi_attach_enabled(&self) -> ::std::option::Option<bool> {
108        self.multi_attach_enabled
109    }
110    /// <p>The throughput to provision for the volume copy, in MiB/s. Supported for <code>gp3</code> volumes only. Omit for all other volume types. Full provisioned throughput performance can be achieved only once the volume copy is fully initialized.</p>
111    /// <p>Valid Range: <code>125 - 2000</code> MiB/s</p>
112    /// <p></p>
113    pub fn throughput(&self) -> ::std::option::Option<i32> {
114        self.throughput
115    }
116    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html"> Ensure Idempotency</a>.</p>
117    pub fn client_token(&self) -> ::std::option::Option<&str> {
118        self.client_token.as_deref()
119    }
120}
121impl CopyVolumesInput {
122    /// Creates a new builder-style object to manufacture [`CopyVolumesInput`](crate::operation::copy_volumes::CopyVolumesInput).
123    pub fn builder() -> crate::operation::copy_volumes::builders::CopyVolumesInputBuilder {
124        crate::operation::copy_volumes::builders::CopyVolumesInputBuilder::default()
125    }
126}
127
128/// A builder for [`CopyVolumesInput`](crate::operation::copy_volumes::CopyVolumesInput).
129#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
130#[non_exhaustive]
131pub struct CopyVolumesInputBuilder {
132    pub(crate) source_volume_id: ::std::option::Option<::std::string::String>,
133    pub(crate) iops: ::std::option::Option<i32>,
134    pub(crate) size: ::std::option::Option<i32>,
135    pub(crate) volume_type: ::std::option::Option<crate::types::VolumeType>,
136    pub(crate) dry_run: ::std::option::Option<bool>,
137    pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
138    pub(crate) multi_attach_enabled: ::std::option::Option<bool>,
139    pub(crate) throughput: ::std::option::Option<i32>,
140    pub(crate) client_token: ::std::option::Option<::std::string::String>,
141}
142impl CopyVolumesInputBuilder {
143    /// <p>The ID of the source EBS volume to copy.</p>
144    /// This field is required.
145    pub fn source_volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.source_volume_id = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>The ID of the source EBS volume to copy.</p>
150    pub fn set_source_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.source_volume_id = input;
152        self
153    }
154    /// <p>The ID of the source EBS volume to copy.</p>
155    pub fn get_source_volume_id(&self) -> &::std::option::Option<::std::string::String> {
156        &self.source_volume_id
157    }
158    /// <p>The number of I/O operations per second (IOPS) to provision for the volume copy. Required for <code>io1</code> and <code>io2</code> volumes. Optional for <code>gp3</code> volumes. Omit for all other volume types. Full provisioned IOPS performance can be achieved only once the volume copy is fully initialized.</p>
159    /// <p>Valid ranges:</p>
160    /// <ul>
161    /// <li>
162    /// <p>gp3: <code>3,000 </code>(<i>default</i>)<code> - 80,000</code> IOPS</p></li>
163    /// <li>
164    /// <p>io1: <code>100 - 64,000</code> IOPS</p></li>
165    /// <li>
166    /// <p>io2: <code>100 - 256,000</code> IOPS</p></li>
167    /// </ul><note>
168    /// <p><a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Instances built on the Nitro System</a> can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.</p>
169    /// </note>
170    pub fn iops(mut self, input: i32) -> Self {
171        self.iops = ::std::option::Option::Some(input);
172        self
173    }
174    /// <p>The number of I/O operations per second (IOPS) to provision for the volume copy. Required for <code>io1</code> and <code>io2</code> volumes. Optional for <code>gp3</code> volumes. Omit for all other volume types. Full provisioned IOPS performance can be achieved only once the volume copy is fully initialized.</p>
175    /// <p>Valid ranges:</p>
176    /// <ul>
177    /// <li>
178    /// <p>gp3: <code>3,000 </code>(<i>default</i>)<code> - 80,000</code> IOPS</p></li>
179    /// <li>
180    /// <p>io1: <code>100 - 64,000</code> IOPS</p></li>
181    /// <li>
182    /// <p>io2: <code>100 - 256,000</code> IOPS</p></li>
183    /// </ul><note>
184    /// <p><a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Instances built on the Nitro System</a> can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.</p>
185    /// </note>
186    pub fn set_iops(mut self, input: ::std::option::Option<i32>) -> Self {
187        self.iops = input;
188        self
189    }
190    /// <p>The number of I/O operations per second (IOPS) to provision for the volume copy. Required for <code>io1</code> and <code>io2</code> volumes. Optional for <code>gp3</code> volumes. Omit for all other volume types. Full provisioned IOPS performance can be achieved only once the volume copy is fully initialized.</p>
191    /// <p>Valid ranges:</p>
192    /// <ul>
193    /// <li>
194    /// <p>gp3: <code>3,000 </code>(<i>default</i>)<code> - 80,000</code> IOPS</p></li>
195    /// <li>
196    /// <p>io1: <code>100 - 64,000</code> IOPS</p></li>
197    /// <li>
198    /// <p>io2: <code>100 - 256,000</code> IOPS</p></li>
199    /// </ul><note>
200    /// <p><a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Instances built on the Nitro System</a> can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.</p>
201    /// </note>
202    pub fn get_iops(&self) -> &::std::option::Option<i32> {
203        &self.iops
204    }
205    /// <p>The size of the volume copy, in GiBs. The size must be equal to or greater than the size of the source volume. If not specified, the size defaults to the size of the source volume.</p>
206    /// <p>Maximum supported sizes:</p>
207    /// <ul>
208    /// <li>
209    /// <p>gp2: <code>16,384</code> GiB</p></li>
210    /// <li>
211    /// <p>gp3: <code>65,536</code> GiB</p></li>
212    /// <li>
213    /// <p>io1: <code>16,384</code> GiB</p></li>
214    /// <li>
215    /// <p>io2: <code>65,536</code> GiB</p></li>
216    /// <li>
217    /// <p>st1 and sc1: <code>16,384</code> GiB</p></li>
218    /// <li>
219    /// <p>standard: <code>1024</code> GiB</p></li>
220    /// </ul>
221    pub fn size(mut self, input: i32) -> Self {
222        self.size = ::std::option::Option::Some(input);
223        self
224    }
225    /// <p>The size of the volume copy, in GiBs. The size must be equal to or greater than the size of the source volume. If not specified, the size defaults to the size of the source volume.</p>
226    /// <p>Maximum supported sizes:</p>
227    /// <ul>
228    /// <li>
229    /// <p>gp2: <code>16,384</code> GiB</p></li>
230    /// <li>
231    /// <p>gp3: <code>65,536</code> GiB</p></li>
232    /// <li>
233    /// <p>io1: <code>16,384</code> GiB</p></li>
234    /// <li>
235    /// <p>io2: <code>65,536</code> GiB</p></li>
236    /// <li>
237    /// <p>st1 and sc1: <code>16,384</code> GiB</p></li>
238    /// <li>
239    /// <p>standard: <code>1024</code> GiB</p></li>
240    /// </ul>
241    pub fn set_size(mut self, input: ::std::option::Option<i32>) -> Self {
242        self.size = input;
243        self
244    }
245    /// <p>The size of the volume copy, in GiBs. The size must be equal to or greater than the size of the source volume. If not specified, the size defaults to the size of the source volume.</p>
246    /// <p>Maximum supported sizes:</p>
247    /// <ul>
248    /// <li>
249    /// <p>gp2: <code>16,384</code> GiB</p></li>
250    /// <li>
251    /// <p>gp3: <code>65,536</code> GiB</p></li>
252    /// <li>
253    /// <p>io1: <code>16,384</code> GiB</p></li>
254    /// <li>
255    /// <p>io2: <code>65,536</code> GiB</p></li>
256    /// <li>
257    /// <p>st1 and sc1: <code>16,384</code> GiB</p></li>
258    /// <li>
259    /// <p>standard: <code>1024</code> GiB</p></li>
260    /// </ul>
261    pub fn get_size(&self) -> &::std::option::Option<i32> {
262        &self.size
263    }
264    /// <p>The volume type for the volume copy. If not specified, the volume type defaults to <code>gp2</code>.</p>
265    pub fn volume_type(mut self, input: crate::types::VolumeType) -> Self {
266        self.volume_type = ::std::option::Option::Some(input);
267        self
268    }
269    /// <p>The volume type for the volume copy. If not specified, the volume type defaults to <code>gp2</code>.</p>
270    pub fn set_volume_type(mut self, input: ::std::option::Option<crate::types::VolumeType>) -> Self {
271        self.volume_type = input;
272        self
273    }
274    /// <p>The volume type for the volume copy. If not specified, the volume type defaults to <code>gp2</code>.</p>
275    pub fn get_volume_type(&self) -> &::std::option::Option<crate::types::VolumeType> {
276        &self.volume_type
277    }
278    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
279    pub fn dry_run(mut self, input: bool) -> Self {
280        self.dry_run = ::std::option::Option::Some(input);
281        self
282    }
283    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
284    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
285        self.dry_run = input;
286        self
287    }
288    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
289    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
290        &self.dry_run
291    }
292    /// Appends an item to `tag_specifications`.
293    ///
294    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
295    ///
296    /// <p>The tags to apply to the volume copy during creation.</p>
297    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
298        let mut v = self.tag_specifications.unwrap_or_default();
299        v.push(input);
300        self.tag_specifications = ::std::option::Option::Some(v);
301        self
302    }
303    /// <p>The tags to apply to the volume copy during creation.</p>
304    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
305        self.tag_specifications = input;
306        self
307    }
308    /// <p>The tags to apply to the volume copy during creation.</p>
309    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
310        &self.tag_specifications
311    }
312    /// <p>Indicates whether to enable Amazon EBS Multi-Attach for the volume copy. If you enable Multi-Attach, you can attach the volume to up to 16 Nitro instances in the same Availability Zone simultaneously. Supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a>.</p>
313    pub fn multi_attach_enabled(mut self, input: bool) -> Self {
314        self.multi_attach_enabled = ::std::option::Option::Some(input);
315        self
316    }
317    /// <p>Indicates whether to enable Amazon EBS Multi-Attach for the volume copy. If you enable Multi-Attach, you can attach the volume to up to 16 Nitro instances in the same Availability Zone simultaneously. Supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a>.</p>
318    pub fn set_multi_attach_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
319        self.multi_attach_enabled = input;
320        self
321    }
322    /// <p>Indicates whether to enable Amazon EBS Multi-Attach for the volume copy. If you enable Multi-Attach, you can attach the volume to up to 16 Nitro instances in the same Availability Zone simultaneously. Supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a>.</p>
323    pub fn get_multi_attach_enabled(&self) -> &::std::option::Option<bool> {
324        &self.multi_attach_enabled
325    }
326    /// <p>The throughput to provision for the volume copy, in MiB/s. Supported for <code>gp3</code> volumes only. Omit for all other volume types. Full provisioned throughput performance can be achieved only once the volume copy is fully initialized.</p>
327    /// <p>Valid Range: <code>125 - 2000</code> MiB/s</p>
328    /// <p></p>
329    pub fn throughput(mut self, input: i32) -> Self {
330        self.throughput = ::std::option::Option::Some(input);
331        self
332    }
333    /// <p>The throughput to provision for the volume copy, in MiB/s. Supported for <code>gp3</code> volumes only. Omit for all other volume types. Full provisioned throughput performance can be achieved only once the volume copy is fully initialized.</p>
334    /// <p>Valid Range: <code>125 - 2000</code> MiB/s</p>
335    /// <p></p>
336    pub fn set_throughput(mut self, input: ::std::option::Option<i32>) -> Self {
337        self.throughput = input;
338        self
339    }
340    /// <p>The throughput to provision for the volume copy, in MiB/s. Supported for <code>gp3</code> volumes only. Omit for all other volume types. Full provisioned throughput performance can be achieved only once the volume copy is fully initialized.</p>
341    /// <p>Valid Range: <code>125 - 2000</code> MiB/s</p>
342    /// <p></p>
343    pub fn get_throughput(&self) -> &::std::option::Option<i32> {
344        &self.throughput
345    }
346    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html"> Ensure Idempotency</a>.</p>
347    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
348        self.client_token = ::std::option::Option::Some(input.into());
349        self
350    }
351    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html"> Ensure Idempotency</a>.</p>
352    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
353        self.client_token = input;
354        self
355    }
356    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html"> Ensure Idempotency</a>.</p>
357    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
358        &self.client_token
359    }
360    /// Consumes the builder and constructs a [`CopyVolumesInput`](crate::operation::copy_volumes::CopyVolumesInput).
361    pub fn build(self) -> ::std::result::Result<crate::operation::copy_volumes::CopyVolumesInput, ::aws_smithy_types::error::operation::BuildError> {
362        ::std::result::Result::Ok(crate::operation::copy_volumes::CopyVolumesInput {
363            source_volume_id: self.source_volume_id,
364            iops: self.iops,
365            size: self.size,
366            volume_type: self.volume_type,
367            dry_run: self.dry_run,
368            tag_specifications: self.tag_specifications,
369            multi_attach_enabled: self.multi_attach_enabled,
370            throughput: self.throughput,
371            client_token: self.client_token,
372        })
373    }
374}