aws_sdk_ec2/operation/create_volume/
_create_volume_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes a volume.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateVolumeOutput {
7    /// <p>The Amazon Resource Name (ARN) of the Outpost.</p>
8    pub outpost_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p>
10    pub iops: ::std::option::Option<i32>,
11    /// <p>Any tags assigned to the volume.</p>
12    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
13    /// <p>The volume type.</p>
14    pub volume_type: ::std::option::Option<crate::types::VolumeType>,
15    /// <note>
16    /// <p>This parameter is not returned by CreateVolume.</p>
17    /// </note>
18    /// <p>Indicates whether the volume was created using fast snapshot restore.</p>
19    pub fast_restored: ::std::option::Option<bool>,
20    /// <p>Indicates whether Amazon EBS Multi-Attach is enabled.</p>
21    pub multi_attach_enabled: ::std::option::Option<bool>,
22    /// <p>The throughput that the volume supports, in MiB/s.</p>
23    pub throughput: ::std::option::Option<i32>,
24    /// <note>
25    /// <p>This parameter is not returned by CreateVolume.</p>
26    /// </note>
27    /// <p>Reserved for future use.</p>
28    pub sse_type: ::std::option::Option<crate::types::SseType>,
29    /// <p>The service provider that manages the volume.</p>
30    pub operator: ::std::option::Option<crate::types::OperatorResponse>,
31    /// <p>The ID of the volume.</p>
32    pub volume_id: ::std::option::Option<::std::string::String>,
33    /// <p>The size of the volume, in GiBs.</p>
34    pub size: ::std::option::Option<i32>,
35    /// <p>The snapshot from which the volume was created, if applicable.</p>
36    pub snapshot_id: ::std::option::Option<::std::string::String>,
37    /// <p>The Availability Zone for the volume.</p>
38    pub availability_zone: ::std::option::Option<::std::string::String>,
39    /// <p>The volume state.</p>
40    pub state: ::std::option::Option<crate::types::VolumeState>,
41    /// <p>The time stamp when volume creation was initiated.</p>
42    pub create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
43    /// <note>
44    /// <p>This parameter is not returned by CreateVolume.</p>
45    /// </note>
46    /// <p>Information about the volume attachments.</p>
47    pub attachments: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>,
48    /// <p>Indicates whether the volume is encrypted.</p>
49    pub encrypted: ::std::option::Option<bool>,
50    /// <p>The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.</p>
51    pub kms_key_id: ::std::option::Option<::std::string::String>,
52    _request_id: Option<String>,
53}
54impl CreateVolumeOutput {
55    /// <p>The Amazon Resource Name (ARN) of the Outpost.</p>
56    pub fn outpost_arn(&self) -> ::std::option::Option<&str> {
57        self.outpost_arn.as_deref()
58    }
59    /// <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p>
60    pub fn iops(&self) -> ::std::option::Option<i32> {
61        self.iops
62    }
63    /// <p>Any tags assigned to the volume.</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 `.tags.is_none()`.
66    pub fn tags(&self) -> &[crate::types::Tag] {
67        self.tags.as_deref().unwrap_or_default()
68    }
69    /// <p>The volume type.</p>
70    pub fn volume_type(&self) -> ::std::option::Option<&crate::types::VolumeType> {
71        self.volume_type.as_ref()
72    }
73    /// <note>
74    /// <p>This parameter is not returned by CreateVolume.</p>
75    /// </note>
76    /// <p>Indicates whether the volume was created using fast snapshot restore.</p>
77    pub fn fast_restored(&self) -> ::std::option::Option<bool> {
78        self.fast_restored
79    }
80    /// <p>Indicates whether Amazon EBS Multi-Attach is enabled.</p>
81    pub fn multi_attach_enabled(&self) -> ::std::option::Option<bool> {
82        self.multi_attach_enabled
83    }
84    /// <p>The throughput that the volume supports, in MiB/s.</p>
85    pub fn throughput(&self) -> ::std::option::Option<i32> {
86        self.throughput
87    }
88    /// <note>
89    /// <p>This parameter is not returned by CreateVolume.</p>
90    /// </note>
91    /// <p>Reserved for future use.</p>
92    pub fn sse_type(&self) -> ::std::option::Option<&crate::types::SseType> {
93        self.sse_type.as_ref()
94    }
95    /// <p>The service provider that manages the volume.</p>
96    pub fn operator(&self) -> ::std::option::Option<&crate::types::OperatorResponse> {
97        self.operator.as_ref()
98    }
99    /// <p>The ID of the volume.</p>
100    pub fn volume_id(&self) -> ::std::option::Option<&str> {
101        self.volume_id.as_deref()
102    }
103    /// <p>The size of the volume, in GiBs.</p>
104    pub fn size(&self) -> ::std::option::Option<i32> {
105        self.size
106    }
107    /// <p>The snapshot from which the volume was created, if applicable.</p>
108    pub fn snapshot_id(&self) -> ::std::option::Option<&str> {
109        self.snapshot_id.as_deref()
110    }
111    /// <p>The Availability Zone for the volume.</p>
112    pub fn availability_zone(&self) -> ::std::option::Option<&str> {
113        self.availability_zone.as_deref()
114    }
115    /// <p>The volume state.</p>
116    pub fn state(&self) -> ::std::option::Option<&crate::types::VolumeState> {
117        self.state.as_ref()
118    }
119    /// <p>The time stamp when volume creation was initiated.</p>
120    pub fn create_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
121        self.create_time.as_ref()
122    }
123    /// <note>
124    /// <p>This parameter is not returned by CreateVolume.</p>
125    /// </note>
126    /// <p>Information about the volume attachments.</p>
127    ///
128    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attachments.is_none()`.
129    pub fn attachments(&self) -> &[crate::types::VolumeAttachment] {
130        self.attachments.as_deref().unwrap_or_default()
131    }
132    /// <p>Indicates whether the volume is encrypted.</p>
133    pub fn encrypted(&self) -> ::std::option::Option<bool> {
134        self.encrypted
135    }
136    /// <p>The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.</p>
137    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
138        self.kms_key_id.as_deref()
139    }
140}
141impl ::aws_types::request_id::RequestId for CreateVolumeOutput {
142    fn request_id(&self) -> Option<&str> {
143        self._request_id.as_deref()
144    }
145}
146impl CreateVolumeOutput {
147    /// Creates a new builder-style object to manufacture [`CreateVolumeOutput`](crate::operation::create_volume::CreateVolumeOutput).
148    pub fn builder() -> crate::operation::create_volume::builders::CreateVolumeOutputBuilder {
149        crate::operation::create_volume::builders::CreateVolumeOutputBuilder::default()
150    }
151}
152
153/// A builder for [`CreateVolumeOutput`](crate::operation::create_volume::CreateVolumeOutput).
154#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
155#[non_exhaustive]
156pub struct CreateVolumeOutputBuilder {
157    pub(crate) outpost_arn: ::std::option::Option<::std::string::String>,
158    pub(crate) iops: ::std::option::Option<i32>,
159    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
160    pub(crate) volume_type: ::std::option::Option<crate::types::VolumeType>,
161    pub(crate) fast_restored: ::std::option::Option<bool>,
162    pub(crate) multi_attach_enabled: ::std::option::Option<bool>,
163    pub(crate) throughput: ::std::option::Option<i32>,
164    pub(crate) sse_type: ::std::option::Option<crate::types::SseType>,
165    pub(crate) operator: ::std::option::Option<crate::types::OperatorResponse>,
166    pub(crate) volume_id: ::std::option::Option<::std::string::String>,
167    pub(crate) size: ::std::option::Option<i32>,
168    pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
169    pub(crate) availability_zone: ::std::option::Option<::std::string::String>,
170    pub(crate) state: ::std::option::Option<crate::types::VolumeState>,
171    pub(crate) create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
172    pub(crate) attachments: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>,
173    pub(crate) encrypted: ::std::option::Option<bool>,
174    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
175    _request_id: Option<String>,
176}
177impl CreateVolumeOutputBuilder {
178    /// <p>The Amazon Resource Name (ARN) of the Outpost.</p>
179    pub fn outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        self.outpost_arn = ::std::option::Option::Some(input.into());
181        self
182    }
183    /// <p>The Amazon Resource Name (ARN) of the Outpost.</p>
184    pub fn set_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185        self.outpost_arn = input;
186        self
187    }
188    /// <p>The Amazon Resource Name (ARN) of the Outpost.</p>
189    pub fn get_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
190        &self.outpost_arn
191    }
192    /// <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p>
193    pub fn iops(mut self, input: i32) -> Self {
194        self.iops = ::std::option::Option::Some(input);
195        self
196    }
197    /// <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p>
198    pub fn set_iops(mut self, input: ::std::option::Option<i32>) -> Self {
199        self.iops = input;
200        self
201    }
202    /// <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p>
203    pub fn get_iops(&self) -> &::std::option::Option<i32> {
204        &self.iops
205    }
206    /// Appends an item to `tags`.
207    ///
208    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
209    ///
210    /// <p>Any tags assigned to the volume.</p>
211    pub fn tags(mut self, input: crate::types::Tag) -> Self {
212        let mut v = self.tags.unwrap_or_default();
213        v.push(input);
214        self.tags = ::std::option::Option::Some(v);
215        self
216    }
217    /// <p>Any tags assigned to the volume.</p>
218    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
219        self.tags = input;
220        self
221    }
222    /// <p>Any tags assigned to the volume.</p>
223    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
224        &self.tags
225    }
226    /// <p>The volume type.</p>
227    pub fn volume_type(mut self, input: crate::types::VolumeType) -> Self {
228        self.volume_type = ::std::option::Option::Some(input);
229        self
230    }
231    /// <p>The volume type.</p>
232    pub fn set_volume_type(mut self, input: ::std::option::Option<crate::types::VolumeType>) -> Self {
233        self.volume_type = input;
234        self
235    }
236    /// <p>The volume type.</p>
237    pub fn get_volume_type(&self) -> &::std::option::Option<crate::types::VolumeType> {
238        &self.volume_type
239    }
240    /// <note>
241    /// <p>This parameter is not returned by CreateVolume.</p>
242    /// </note>
243    /// <p>Indicates whether the volume was created using fast snapshot restore.</p>
244    pub fn fast_restored(mut self, input: bool) -> Self {
245        self.fast_restored = ::std::option::Option::Some(input);
246        self
247    }
248    /// <note>
249    /// <p>This parameter is not returned by CreateVolume.</p>
250    /// </note>
251    /// <p>Indicates whether the volume was created using fast snapshot restore.</p>
252    pub fn set_fast_restored(mut self, input: ::std::option::Option<bool>) -> Self {
253        self.fast_restored = input;
254        self
255    }
256    /// <note>
257    /// <p>This parameter is not returned by CreateVolume.</p>
258    /// </note>
259    /// <p>Indicates whether the volume was created using fast snapshot restore.</p>
260    pub fn get_fast_restored(&self) -> &::std::option::Option<bool> {
261        &self.fast_restored
262    }
263    /// <p>Indicates whether Amazon EBS Multi-Attach is enabled.</p>
264    pub fn multi_attach_enabled(mut self, input: bool) -> Self {
265        self.multi_attach_enabled = ::std::option::Option::Some(input);
266        self
267    }
268    /// <p>Indicates whether Amazon EBS Multi-Attach is enabled.</p>
269    pub fn set_multi_attach_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
270        self.multi_attach_enabled = input;
271        self
272    }
273    /// <p>Indicates whether Amazon EBS Multi-Attach is enabled.</p>
274    pub fn get_multi_attach_enabled(&self) -> &::std::option::Option<bool> {
275        &self.multi_attach_enabled
276    }
277    /// <p>The throughput that the volume supports, in MiB/s.</p>
278    pub fn throughput(mut self, input: i32) -> Self {
279        self.throughput = ::std::option::Option::Some(input);
280        self
281    }
282    /// <p>The throughput that the volume supports, in MiB/s.</p>
283    pub fn set_throughput(mut self, input: ::std::option::Option<i32>) -> Self {
284        self.throughput = input;
285        self
286    }
287    /// <p>The throughput that the volume supports, in MiB/s.</p>
288    pub fn get_throughput(&self) -> &::std::option::Option<i32> {
289        &self.throughput
290    }
291    /// <note>
292    /// <p>This parameter is not returned by CreateVolume.</p>
293    /// </note>
294    /// <p>Reserved for future use.</p>
295    pub fn sse_type(mut self, input: crate::types::SseType) -> Self {
296        self.sse_type = ::std::option::Option::Some(input);
297        self
298    }
299    /// <note>
300    /// <p>This parameter is not returned by CreateVolume.</p>
301    /// </note>
302    /// <p>Reserved for future use.</p>
303    pub fn set_sse_type(mut self, input: ::std::option::Option<crate::types::SseType>) -> Self {
304        self.sse_type = input;
305        self
306    }
307    /// <note>
308    /// <p>This parameter is not returned by CreateVolume.</p>
309    /// </note>
310    /// <p>Reserved for future use.</p>
311    pub fn get_sse_type(&self) -> &::std::option::Option<crate::types::SseType> {
312        &self.sse_type
313    }
314    /// <p>The service provider that manages the volume.</p>
315    pub fn operator(mut self, input: crate::types::OperatorResponse) -> Self {
316        self.operator = ::std::option::Option::Some(input);
317        self
318    }
319    /// <p>The service provider that manages the volume.</p>
320    pub fn set_operator(mut self, input: ::std::option::Option<crate::types::OperatorResponse>) -> Self {
321        self.operator = input;
322        self
323    }
324    /// <p>The service provider that manages the volume.</p>
325    pub fn get_operator(&self) -> &::std::option::Option<crate::types::OperatorResponse> {
326        &self.operator
327    }
328    /// <p>The ID of the volume.</p>
329    pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
330        self.volume_id = ::std::option::Option::Some(input.into());
331        self
332    }
333    /// <p>The ID of the volume.</p>
334    pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
335        self.volume_id = input;
336        self
337    }
338    /// <p>The ID of the volume.</p>
339    pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
340        &self.volume_id
341    }
342    /// <p>The size of the volume, in GiBs.</p>
343    pub fn size(mut self, input: i32) -> Self {
344        self.size = ::std::option::Option::Some(input);
345        self
346    }
347    /// <p>The size of the volume, in GiBs.</p>
348    pub fn set_size(mut self, input: ::std::option::Option<i32>) -> Self {
349        self.size = input;
350        self
351    }
352    /// <p>The size of the volume, in GiBs.</p>
353    pub fn get_size(&self) -> &::std::option::Option<i32> {
354        &self.size
355    }
356    /// <p>The snapshot from which the volume was created, if applicable.</p>
357    pub fn snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
358        self.snapshot_id = ::std::option::Option::Some(input.into());
359        self
360    }
361    /// <p>The snapshot from which the volume was created, if applicable.</p>
362    pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
363        self.snapshot_id = input;
364        self
365    }
366    /// <p>The snapshot from which the volume was created, if applicable.</p>
367    pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
368        &self.snapshot_id
369    }
370    /// <p>The Availability Zone for the volume.</p>
371    pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
372        self.availability_zone = ::std::option::Option::Some(input.into());
373        self
374    }
375    /// <p>The Availability Zone for the volume.</p>
376    pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
377        self.availability_zone = input;
378        self
379    }
380    /// <p>The Availability Zone for the volume.</p>
381    pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
382        &self.availability_zone
383    }
384    /// <p>The volume state.</p>
385    pub fn state(mut self, input: crate::types::VolumeState) -> Self {
386        self.state = ::std::option::Option::Some(input);
387        self
388    }
389    /// <p>The volume state.</p>
390    pub fn set_state(mut self, input: ::std::option::Option<crate::types::VolumeState>) -> Self {
391        self.state = input;
392        self
393    }
394    /// <p>The volume state.</p>
395    pub fn get_state(&self) -> &::std::option::Option<crate::types::VolumeState> {
396        &self.state
397    }
398    /// <p>The time stamp when volume creation was initiated.</p>
399    pub fn create_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
400        self.create_time = ::std::option::Option::Some(input);
401        self
402    }
403    /// <p>The time stamp when volume creation was initiated.</p>
404    pub fn set_create_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
405        self.create_time = input;
406        self
407    }
408    /// <p>The time stamp when volume creation was initiated.</p>
409    pub fn get_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
410        &self.create_time
411    }
412    /// Appends an item to `attachments`.
413    ///
414    /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
415    ///
416    /// <note>
417    /// <p>This parameter is not returned by CreateVolume.</p>
418    /// </note>
419    /// <p>Information about the volume attachments.</p>
420    pub fn attachments(mut self, input: crate::types::VolumeAttachment) -> Self {
421        let mut v = self.attachments.unwrap_or_default();
422        v.push(input);
423        self.attachments = ::std::option::Option::Some(v);
424        self
425    }
426    /// <note>
427    /// <p>This parameter is not returned by CreateVolume.</p>
428    /// </note>
429    /// <p>Information about the volume attachments.</p>
430    pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>) -> Self {
431        self.attachments = input;
432        self
433    }
434    /// <note>
435    /// <p>This parameter is not returned by CreateVolume.</p>
436    /// </note>
437    /// <p>Information about the volume attachments.</p>
438    pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>> {
439        &self.attachments
440    }
441    /// <p>Indicates whether the volume is encrypted.</p>
442    pub fn encrypted(mut self, input: bool) -> Self {
443        self.encrypted = ::std::option::Option::Some(input);
444        self
445    }
446    /// <p>Indicates whether the volume is encrypted.</p>
447    pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
448        self.encrypted = input;
449        self
450    }
451    /// <p>Indicates whether the volume is encrypted.</p>
452    pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
453        &self.encrypted
454    }
455    /// <p>The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.</p>
456    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
457        self.kms_key_id = ::std::option::Option::Some(input.into());
458        self
459    }
460    /// <p>The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.</p>
461    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
462        self.kms_key_id = input;
463        self
464    }
465    /// <p>The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.</p>
466    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
467        &self.kms_key_id
468    }
469    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
470        self._request_id = Some(request_id.into());
471        self
472    }
473
474    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
475        self._request_id = request_id;
476        self
477    }
478    /// Consumes the builder and constructs a [`CreateVolumeOutput`](crate::operation::create_volume::CreateVolumeOutput).
479    pub fn build(self) -> crate::operation::create_volume::CreateVolumeOutput {
480        crate::operation::create_volume::CreateVolumeOutput {
481            outpost_arn: self.outpost_arn,
482            iops: self.iops,
483            tags: self.tags,
484            volume_type: self.volume_type,
485            fast_restored: self.fast_restored,
486            multi_attach_enabled: self.multi_attach_enabled,
487            throughput: self.throughput,
488            sse_type: self.sse_type,
489            operator: self.operator,
490            volume_id: self.volume_id,
491            size: self.size,
492            snapshot_id: self.snapshot_id,
493            availability_zone: self.availability_zone,
494            state: self.state,
495            create_time: self.create_time,
496            attachments: self.attachments,
497            encrypted: self.encrypted,
498            kms_key_id: self.kms_key_id,
499            _request_id: self._request_id,
500        }
501    }
502}