aws_sdk_ec2/operation/create_volume/
_create_volume_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateVolumeOutput {
7 pub availability_zone_id: ::std::option::Option<::std::string::String>,
9 pub outpost_arn: ::std::option::Option<::std::string::String>,
11 pub iops: ::std::option::Option<i32>,
13 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
15 pub volume_type: ::std::option::Option<crate::types::VolumeType>,
17 pub fast_restored: ::std::option::Option<bool>,
22 pub multi_attach_enabled: ::std::option::Option<bool>,
24 pub throughput: ::std::option::Option<i32>,
26 pub sse_type: ::std::option::Option<crate::types::SseType>,
31 pub operator: ::std::option::Option<crate::types::OperatorResponse>,
33 pub volume_initialization_rate: ::std::option::Option<i32>,
35 pub volume_id: ::std::option::Option<::std::string::String>,
37 pub size: ::std::option::Option<i32>,
39 pub snapshot_id: ::std::option::Option<::std::string::String>,
41 pub availability_zone: ::std::option::Option<::std::string::String>,
43 pub state: ::std::option::Option<crate::types::VolumeState>,
45 pub create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
47 pub attachments: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>,
52 pub encrypted: ::std::option::Option<bool>,
54 pub kms_key_id: ::std::option::Option<::std::string::String>,
56 _request_id: Option<String>,
57}
58impl CreateVolumeOutput {
59 pub fn availability_zone_id(&self) -> ::std::option::Option<&str> {
61 self.availability_zone_id.as_deref()
62 }
63 pub fn outpost_arn(&self) -> ::std::option::Option<&str> {
65 self.outpost_arn.as_deref()
66 }
67 pub fn iops(&self) -> ::std::option::Option<i32> {
69 self.iops
70 }
71 pub fn tags(&self) -> &[crate::types::Tag] {
75 self.tags.as_deref().unwrap_or_default()
76 }
77 pub fn volume_type(&self) -> ::std::option::Option<&crate::types::VolumeType> {
79 self.volume_type.as_ref()
80 }
81 pub fn fast_restored(&self) -> ::std::option::Option<bool> {
86 self.fast_restored
87 }
88 pub fn multi_attach_enabled(&self) -> ::std::option::Option<bool> {
90 self.multi_attach_enabled
91 }
92 pub fn throughput(&self) -> ::std::option::Option<i32> {
94 self.throughput
95 }
96 pub fn sse_type(&self) -> ::std::option::Option<&crate::types::SseType> {
101 self.sse_type.as_ref()
102 }
103 pub fn operator(&self) -> ::std::option::Option<&crate::types::OperatorResponse> {
105 self.operator.as_ref()
106 }
107 pub fn volume_initialization_rate(&self) -> ::std::option::Option<i32> {
109 self.volume_initialization_rate
110 }
111 pub fn volume_id(&self) -> ::std::option::Option<&str> {
113 self.volume_id.as_deref()
114 }
115 pub fn size(&self) -> ::std::option::Option<i32> {
117 self.size
118 }
119 pub fn snapshot_id(&self) -> ::std::option::Option<&str> {
121 self.snapshot_id.as_deref()
122 }
123 pub fn availability_zone(&self) -> ::std::option::Option<&str> {
125 self.availability_zone.as_deref()
126 }
127 pub fn state(&self) -> ::std::option::Option<&crate::types::VolumeState> {
129 self.state.as_ref()
130 }
131 pub fn create_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
133 self.create_time.as_ref()
134 }
135 pub fn attachments(&self) -> &[crate::types::VolumeAttachment] {
142 self.attachments.as_deref().unwrap_or_default()
143 }
144 pub fn encrypted(&self) -> ::std::option::Option<bool> {
146 self.encrypted
147 }
148 pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
150 self.kms_key_id.as_deref()
151 }
152}
153impl ::aws_types::request_id::RequestId for CreateVolumeOutput {
154 fn request_id(&self) -> Option<&str> {
155 self._request_id.as_deref()
156 }
157}
158impl CreateVolumeOutput {
159 pub fn builder() -> crate::operation::create_volume::builders::CreateVolumeOutputBuilder {
161 crate::operation::create_volume::builders::CreateVolumeOutputBuilder::default()
162 }
163}
164
165#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
167#[non_exhaustive]
168pub struct CreateVolumeOutputBuilder {
169 pub(crate) availability_zone_id: ::std::option::Option<::std::string::String>,
170 pub(crate) outpost_arn: ::std::option::Option<::std::string::String>,
171 pub(crate) iops: ::std::option::Option<i32>,
172 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
173 pub(crate) volume_type: ::std::option::Option<crate::types::VolumeType>,
174 pub(crate) fast_restored: ::std::option::Option<bool>,
175 pub(crate) multi_attach_enabled: ::std::option::Option<bool>,
176 pub(crate) throughput: ::std::option::Option<i32>,
177 pub(crate) sse_type: ::std::option::Option<crate::types::SseType>,
178 pub(crate) operator: ::std::option::Option<crate::types::OperatorResponse>,
179 pub(crate) volume_initialization_rate: ::std::option::Option<i32>,
180 pub(crate) volume_id: ::std::option::Option<::std::string::String>,
181 pub(crate) size: ::std::option::Option<i32>,
182 pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
183 pub(crate) availability_zone: ::std::option::Option<::std::string::String>,
184 pub(crate) state: ::std::option::Option<crate::types::VolumeState>,
185 pub(crate) create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
186 pub(crate) attachments: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>,
187 pub(crate) encrypted: ::std::option::Option<bool>,
188 pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
189 _request_id: Option<String>,
190}
191impl CreateVolumeOutputBuilder {
192 pub fn availability_zone_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194 self.availability_zone_id = ::std::option::Option::Some(input.into());
195 self
196 }
197 pub fn set_availability_zone_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199 self.availability_zone_id = input;
200 self
201 }
202 pub fn get_availability_zone_id(&self) -> &::std::option::Option<::std::string::String> {
204 &self.availability_zone_id
205 }
206 pub fn outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208 self.outpost_arn = ::std::option::Option::Some(input.into());
209 self
210 }
211 pub fn set_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213 self.outpost_arn = input;
214 self
215 }
216 pub fn get_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
218 &self.outpost_arn
219 }
220 pub fn iops(mut self, input: i32) -> Self {
222 self.iops = ::std::option::Option::Some(input);
223 self
224 }
225 pub fn set_iops(mut self, input: ::std::option::Option<i32>) -> Self {
227 self.iops = input;
228 self
229 }
230 pub fn get_iops(&self) -> &::std::option::Option<i32> {
232 &self.iops
233 }
234 pub fn tags(mut self, input: crate::types::Tag) -> Self {
240 let mut v = self.tags.unwrap_or_default();
241 v.push(input);
242 self.tags = ::std::option::Option::Some(v);
243 self
244 }
245 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
247 self.tags = input;
248 self
249 }
250 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
252 &self.tags
253 }
254 pub fn volume_type(mut self, input: crate::types::VolumeType) -> Self {
256 self.volume_type = ::std::option::Option::Some(input);
257 self
258 }
259 pub fn set_volume_type(mut self, input: ::std::option::Option<crate::types::VolumeType>) -> Self {
261 self.volume_type = input;
262 self
263 }
264 pub fn get_volume_type(&self) -> &::std::option::Option<crate::types::VolumeType> {
266 &self.volume_type
267 }
268 pub fn fast_restored(mut self, input: bool) -> Self {
273 self.fast_restored = ::std::option::Option::Some(input);
274 self
275 }
276 pub fn set_fast_restored(mut self, input: ::std::option::Option<bool>) -> Self {
281 self.fast_restored = input;
282 self
283 }
284 pub fn get_fast_restored(&self) -> &::std::option::Option<bool> {
289 &self.fast_restored
290 }
291 pub fn multi_attach_enabled(mut self, input: bool) -> Self {
293 self.multi_attach_enabled = ::std::option::Option::Some(input);
294 self
295 }
296 pub fn set_multi_attach_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
298 self.multi_attach_enabled = input;
299 self
300 }
301 pub fn get_multi_attach_enabled(&self) -> &::std::option::Option<bool> {
303 &self.multi_attach_enabled
304 }
305 pub fn throughput(mut self, input: i32) -> Self {
307 self.throughput = ::std::option::Option::Some(input);
308 self
309 }
310 pub fn set_throughput(mut self, input: ::std::option::Option<i32>) -> Self {
312 self.throughput = input;
313 self
314 }
315 pub fn get_throughput(&self) -> &::std::option::Option<i32> {
317 &self.throughput
318 }
319 pub fn sse_type(mut self, input: crate::types::SseType) -> Self {
324 self.sse_type = ::std::option::Option::Some(input);
325 self
326 }
327 pub fn set_sse_type(mut self, input: ::std::option::Option<crate::types::SseType>) -> Self {
332 self.sse_type = input;
333 self
334 }
335 pub fn get_sse_type(&self) -> &::std::option::Option<crate::types::SseType> {
340 &self.sse_type
341 }
342 pub fn operator(mut self, input: crate::types::OperatorResponse) -> Self {
344 self.operator = ::std::option::Option::Some(input);
345 self
346 }
347 pub fn set_operator(mut self, input: ::std::option::Option<crate::types::OperatorResponse>) -> Self {
349 self.operator = input;
350 self
351 }
352 pub fn get_operator(&self) -> &::std::option::Option<crate::types::OperatorResponse> {
354 &self.operator
355 }
356 pub fn volume_initialization_rate(mut self, input: i32) -> Self {
358 self.volume_initialization_rate = ::std::option::Option::Some(input);
359 self
360 }
361 pub fn set_volume_initialization_rate(mut self, input: ::std::option::Option<i32>) -> Self {
363 self.volume_initialization_rate = input;
364 self
365 }
366 pub fn get_volume_initialization_rate(&self) -> &::std::option::Option<i32> {
368 &self.volume_initialization_rate
369 }
370 pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
372 self.volume_id = ::std::option::Option::Some(input.into());
373 self
374 }
375 pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
377 self.volume_id = input;
378 self
379 }
380 pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
382 &self.volume_id
383 }
384 pub fn size(mut self, input: i32) -> Self {
386 self.size = ::std::option::Option::Some(input);
387 self
388 }
389 pub fn set_size(mut self, input: ::std::option::Option<i32>) -> Self {
391 self.size = input;
392 self
393 }
394 pub fn get_size(&self) -> &::std::option::Option<i32> {
396 &self.size
397 }
398 pub fn snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
400 self.snapshot_id = ::std::option::Option::Some(input.into());
401 self
402 }
403 pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
405 self.snapshot_id = input;
406 self
407 }
408 pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
410 &self.snapshot_id
411 }
412 pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
414 self.availability_zone = ::std::option::Option::Some(input.into());
415 self
416 }
417 pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
419 self.availability_zone = input;
420 self
421 }
422 pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
424 &self.availability_zone
425 }
426 pub fn state(mut self, input: crate::types::VolumeState) -> Self {
428 self.state = ::std::option::Option::Some(input);
429 self
430 }
431 pub fn set_state(mut self, input: ::std::option::Option<crate::types::VolumeState>) -> Self {
433 self.state = input;
434 self
435 }
436 pub fn get_state(&self) -> &::std::option::Option<crate::types::VolumeState> {
438 &self.state
439 }
440 pub fn create_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
442 self.create_time = ::std::option::Option::Some(input);
443 self
444 }
445 pub fn set_create_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
447 self.create_time = input;
448 self
449 }
450 pub fn get_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
452 &self.create_time
453 }
454 pub fn attachments(mut self, input: crate::types::VolumeAttachment) -> Self {
463 let mut v = self.attachments.unwrap_or_default();
464 v.push(input);
465 self.attachments = ::std::option::Option::Some(v);
466 self
467 }
468 pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>) -> Self {
473 self.attachments = input;
474 self
475 }
476 pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>> {
481 &self.attachments
482 }
483 pub fn encrypted(mut self, input: bool) -> Self {
485 self.encrypted = ::std::option::Option::Some(input);
486 self
487 }
488 pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
490 self.encrypted = input;
491 self
492 }
493 pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
495 &self.encrypted
496 }
497 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
499 self.kms_key_id = ::std::option::Option::Some(input.into());
500 self
501 }
502 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
504 self.kms_key_id = input;
505 self
506 }
507 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
509 &self.kms_key_id
510 }
511 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
512 self._request_id = Some(request_id.into());
513 self
514 }
515
516 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
517 self._request_id = request_id;
518 self
519 }
520 pub fn build(self) -> crate::operation::create_volume::CreateVolumeOutput {
522 crate::operation::create_volume::CreateVolumeOutput {
523 availability_zone_id: self.availability_zone_id,
524 outpost_arn: self.outpost_arn,
525 iops: self.iops,
526 tags: self.tags,
527 volume_type: self.volume_type,
528 fast_restored: self.fast_restored,
529 multi_attach_enabled: self.multi_attach_enabled,
530 throughput: self.throughput,
531 sse_type: self.sse_type,
532 operator: self.operator,
533 volume_initialization_rate: self.volume_initialization_rate,
534 volume_id: self.volume_id,
535 size: self.size,
536 snapshot_id: self.snapshot_id,
537 availability_zone: self.availability_zone,
538 state: self.state,
539 create_time: self.create_time,
540 attachments: self.attachments,
541 encrypted: self.encrypted,
542 kms_key_id: self.kms_key_id,
543 _request_id: self._request_id,
544 }
545 }
546}