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 outpost_arn: ::std::option::Option<::std::string::String>,
9 pub iops: ::std::option::Option<i32>,
11 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
13 pub volume_type: ::std::option::Option<crate::types::VolumeType>,
15 pub fast_restored: ::std::option::Option<bool>,
20 pub multi_attach_enabled: ::std::option::Option<bool>,
22 pub throughput: ::std::option::Option<i32>,
24 pub sse_type: ::std::option::Option<crate::types::SseType>,
29 pub operator: ::std::option::Option<crate::types::OperatorResponse>,
31 pub volume_id: ::std::option::Option<::std::string::String>,
33 pub size: ::std::option::Option<i32>,
35 pub snapshot_id: ::std::option::Option<::std::string::String>,
37 pub availability_zone: ::std::option::Option<::std::string::String>,
39 pub state: ::std::option::Option<crate::types::VolumeState>,
41 pub create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
43 pub attachments: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>,
48 pub encrypted: ::std::option::Option<bool>,
50 pub kms_key_id: ::std::option::Option<::std::string::String>,
52 _request_id: Option<String>,
53}
54impl CreateVolumeOutput {
55 pub fn outpost_arn(&self) -> ::std::option::Option<&str> {
57 self.outpost_arn.as_deref()
58 }
59 pub fn iops(&self) -> ::std::option::Option<i32> {
61 self.iops
62 }
63 pub fn tags(&self) -> &[crate::types::Tag] {
67 self.tags.as_deref().unwrap_or_default()
68 }
69 pub fn volume_type(&self) -> ::std::option::Option<&crate::types::VolumeType> {
71 self.volume_type.as_ref()
72 }
73 pub fn fast_restored(&self) -> ::std::option::Option<bool> {
78 self.fast_restored
79 }
80 pub fn multi_attach_enabled(&self) -> ::std::option::Option<bool> {
82 self.multi_attach_enabled
83 }
84 pub fn throughput(&self) -> ::std::option::Option<i32> {
86 self.throughput
87 }
88 pub fn sse_type(&self) -> ::std::option::Option<&crate::types::SseType> {
93 self.sse_type.as_ref()
94 }
95 pub fn operator(&self) -> ::std::option::Option<&crate::types::OperatorResponse> {
97 self.operator.as_ref()
98 }
99 pub fn volume_id(&self) -> ::std::option::Option<&str> {
101 self.volume_id.as_deref()
102 }
103 pub fn size(&self) -> ::std::option::Option<i32> {
105 self.size
106 }
107 pub fn snapshot_id(&self) -> ::std::option::Option<&str> {
109 self.snapshot_id.as_deref()
110 }
111 pub fn availability_zone(&self) -> ::std::option::Option<&str> {
113 self.availability_zone.as_deref()
114 }
115 pub fn state(&self) -> ::std::option::Option<&crate::types::VolumeState> {
117 self.state.as_ref()
118 }
119 pub fn create_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
121 self.create_time.as_ref()
122 }
123 pub fn attachments(&self) -> &[crate::types::VolumeAttachment] {
130 self.attachments.as_deref().unwrap_or_default()
131 }
132 pub fn encrypted(&self) -> ::std::option::Option<bool> {
134 self.encrypted
135 }
136 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 pub fn builder() -> crate::operation::create_volume::builders::CreateVolumeOutputBuilder {
149 crate::operation::create_volume::builders::CreateVolumeOutputBuilder::default()
150 }
151}
152
153#[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 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 pub fn set_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185 self.outpost_arn = input;
186 self
187 }
188 pub fn get_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
190 &self.outpost_arn
191 }
192 pub fn iops(mut self, input: i32) -> Self {
194 self.iops = ::std::option::Option::Some(input);
195 self
196 }
197 pub fn set_iops(mut self, input: ::std::option::Option<i32>) -> Self {
199 self.iops = input;
200 self
201 }
202 pub fn get_iops(&self) -> &::std::option::Option<i32> {
204 &self.iops
205 }
206 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
224 &self.tags
225 }
226 pub fn volume_type(mut self, input: crate::types::VolumeType) -> Self {
228 self.volume_type = ::std::option::Option::Some(input);
229 self
230 }
231 pub fn set_volume_type(mut self, input: ::std::option::Option<crate::types::VolumeType>) -> Self {
233 self.volume_type = input;
234 self
235 }
236 pub fn get_volume_type(&self) -> &::std::option::Option<crate::types::VolumeType> {
238 &self.volume_type
239 }
240 pub fn fast_restored(mut self, input: bool) -> Self {
245 self.fast_restored = ::std::option::Option::Some(input);
246 self
247 }
248 pub fn set_fast_restored(mut self, input: ::std::option::Option<bool>) -> Self {
253 self.fast_restored = input;
254 self
255 }
256 pub fn get_fast_restored(&self) -> &::std::option::Option<bool> {
261 &self.fast_restored
262 }
263 pub fn multi_attach_enabled(mut self, input: bool) -> Self {
265 self.multi_attach_enabled = ::std::option::Option::Some(input);
266 self
267 }
268 pub fn set_multi_attach_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
270 self.multi_attach_enabled = input;
271 self
272 }
273 pub fn get_multi_attach_enabled(&self) -> &::std::option::Option<bool> {
275 &self.multi_attach_enabled
276 }
277 pub fn throughput(mut self, input: i32) -> Self {
279 self.throughput = ::std::option::Option::Some(input);
280 self
281 }
282 pub fn set_throughput(mut self, input: ::std::option::Option<i32>) -> Self {
284 self.throughput = input;
285 self
286 }
287 pub fn get_throughput(&self) -> &::std::option::Option<i32> {
289 &self.throughput
290 }
291 pub fn sse_type(mut self, input: crate::types::SseType) -> Self {
296 self.sse_type = ::std::option::Option::Some(input);
297 self
298 }
299 pub fn set_sse_type(mut self, input: ::std::option::Option<crate::types::SseType>) -> Self {
304 self.sse_type = input;
305 self
306 }
307 pub fn get_sse_type(&self) -> &::std::option::Option<crate::types::SseType> {
312 &self.sse_type
313 }
314 pub fn operator(mut self, input: crate::types::OperatorResponse) -> Self {
316 self.operator = ::std::option::Option::Some(input);
317 self
318 }
319 pub fn set_operator(mut self, input: ::std::option::Option<crate::types::OperatorResponse>) -> Self {
321 self.operator = input;
322 self
323 }
324 pub fn get_operator(&self) -> &::std::option::Option<crate::types::OperatorResponse> {
326 &self.operator
327 }
328 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 pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
335 self.volume_id = input;
336 self
337 }
338 pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
340 &self.volume_id
341 }
342 pub fn size(mut self, input: i32) -> Self {
344 self.size = ::std::option::Option::Some(input);
345 self
346 }
347 pub fn set_size(mut self, input: ::std::option::Option<i32>) -> Self {
349 self.size = input;
350 self
351 }
352 pub fn get_size(&self) -> &::std::option::Option<i32> {
354 &self.size
355 }
356 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 pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
363 self.snapshot_id = input;
364 self
365 }
366 pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
368 &self.snapshot_id
369 }
370 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 pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
377 self.availability_zone = input;
378 self
379 }
380 pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
382 &self.availability_zone
383 }
384 pub fn state(mut self, input: crate::types::VolumeState) -> Self {
386 self.state = ::std::option::Option::Some(input);
387 self
388 }
389 pub fn set_state(mut self, input: ::std::option::Option<crate::types::VolumeState>) -> Self {
391 self.state = input;
392 self
393 }
394 pub fn get_state(&self) -> &::std::option::Option<crate::types::VolumeState> {
396 &self.state
397 }
398 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 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 pub fn get_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
410 &self.create_time
411 }
412 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 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 pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>> {
439 &self.attachments
440 }
441 pub fn encrypted(mut self, input: bool) -> Self {
443 self.encrypted = ::std::option::Option::Some(input);
444 self
445 }
446 pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
448 self.encrypted = input;
449 self
450 }
451 pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
453 &self.encrypted
454 }
455 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 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 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 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}