1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Volume {
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_initialization_rate: ::std::option::Option<i32>,
33 pub volume_id: ::std::option::Option<::std::string::String>,
35 pub size: ::std::option::Option<i32>,
37 pub snapshot_id: ::std::option::Option<::std::string::String>,
39 pub availability_zone: ::std::option::Option<::std::string::String>,
41 pub state: ::std::option::Option<crate::types::VolumeState>,
43 pub create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
45 pub attachments: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>,
50 pub encrypted: ::std::option::Option<bool>,
52 pub kms_key_id: ::std::option::Option<::std::string::String>,
54}
55impl Volume {
56 pub fn outpost_arn(&self) -> ::std::option::Option<&str> {
58 self.outpost_arn.as_deref()
59 }
60 pub fn iops(&self) -> ::std::option::Option<i32> {
62 self.iops
63 }
64 pub fn tags(&self) -> &[crate::types::Tag] {
68 self.tags.as_deref().unwrap_or_default()
69 }
70 pub fn volume_type(&self) -> ::std::option::Option<&crate::types::VolumeType> {
72 self.volume_type.as_ref()
73 }
74 pub fn fast_restored(&self) -> ::std::option::Option<bool> {
79 self.fast_restored
80 }
81 pub fn multi_attach_enabled(&self) -> ::std::option::Option<bool> {
83 self.multi_attach_enabled
84 }
85 pub fn throughput(&self) -> ::std::option::Option<i32> {
87 self.throughput
88 }
89 pub fn sse_type(&self) -> ::std::option::Option<&crate::types::SseType> {
94 self.sse_type.as_ref()
95 }
96 pub fn operator(&self) -> ::std::option::Option<&crate::types::OperatorResponse> {
98 self.operator.as_ref()
99 }
100 pub fn volume_initialization_rate(&self) -> ::std::option::Option<i32> {
102 self.volume_initialization_rate
103 }
104 pub fn volume_id(&self) -> ::std::option::Option<&str> {
106 self.volume_id.as_deref()
107 }
108 pub fn size(&self) -> ::std::option::Option<i32> {
110 self.size
111 }
112 pub fn snapshot_id(&self) -> ::std::option::Option<&str> {
114 self.snapshot_id.as_deref()
115 }
116 pub fn availability_zone(&self) -> ::std::option::Option<&str> {
118 self.availability_zone.as_deref()
119 }
120 pub fn state(&self) -> ::std::option::Option<&crate::types::VolumeState> {
122 self.state.as_ref()
123 }
124 pub fn create_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
126 self.create_time.as_ref()
127 }
128 pub fn attachments(&self) -> &[crate::types::VolumeAttachment] {
135 self.attachments.as_deref().unwrap_or_default()
136 }
137 pub fn encrypted(&self) -> ::std::option::Option<bool> {
139 self.encrypted
140 }
141 pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
143 self.kms_key_id.as_deref()
144 }
145}
146impl Volume {
147 pub fn builder() -> crate::types::builders::VolumeBuilder {
149 crate::types::builders::VolumeBuilder::default()
150 }
151}
152
153#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
155#[non_exhaustive]
156pub struct VolumeBuilder {
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_initialization_rate: ::std::option::Option<i32>,
167 pub(crate) volume_id: ::std::option::Option<::std::string::String>,
168 pub(crate) size: ::std::option::Option<i32>,
169 pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
170 pub(crate) availability_zone: ::std::option::Option<::std::string::String>,
171 pub(crate) state: ::std::option::Option<crate::types::VolumeState>,
172 pub(crate) create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
173 pub(crate) attachments: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>,
174 pub(crate) encrypted: ::std::option::Option<bool>,
175 pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
176}
177impl VolumeBuilder {
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_initialization_rate(mut self, input: i32) -> Self {
330 self.volume_initialization_rate = ::std::option::Option::Some(input);
331 self
332 }
333 pub fn set_volume_initialization_rate(mut self, input: ::std::option::Option<i32>) -> Self {
335 self.volume_initialization_rate = input;
336 self
337 }
338 pub fn get_volume_initialization_rate(&self) -> &::std::option::Option<i32> {
340 &self.volume_initialization_rate
341 }
342 pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
344 self.volume_id = ::std::option::Option::Some(input.into());
345 self
346 }
347 pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
349 self.volume_id = input;
350 self
351 }
352 pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
354 &self.volume_id
355 }
356 pub fn size(mut self, input: i32) -> Self {
358 self.size = ::std::option::Option::Some(input);
359 self
360 }
361 pub fn set_size(mut self, input: ::std::option::Option<i32>) -> Self {
363 self.size = input;
364 self
365 }
366 pub fn get_size(&self) -> &::std::option::Option<i32> {
368 &self.size
369 }
370 pub fn snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
372 self.snapshot_id = ::std::option::Option::Some(input.into());
373 self
374 }
375 pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
377 self.snapshot_id = input;
378 self
379 }
380 pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
382 &self.snapshot_id
383 }
384 pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
386 self.availability_zone = ::std::option::Option::Some(input.into());
387 self
388 }
389 pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
391 self.availability_zone = input;
392 self
393 }
394 pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
396 &self.availability_zone
397 }
398 pub fn state(mut self, input: crate::types::VolumeState) -> Self {
400 self.state = ::std::option::Option::Some(input);
401 self
402 }
403 pub fn set_state(mut self, input: ::std::option::Option<crate::types::VolumeState>) -> Self {
405 self.state = input;
406 self
407 }
408 pub fn get_state(&self) -> &::std::option::Option<crate::types::VolumeState> {
410 &self.state
411 }
412 pub fn create_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
414 self.create_time = ::std::option::Option::Some(input);
415 self
416 }
417 pub fn set_create_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
419 self.create_time = input;
420 self
421 }
422 pub fn get_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
424 &self.create_time
425 }
426 pub fn attachments(mut self, input: crate::types::VolumeAttachment) -> Self {
435 let mut v = self.attachments.unwrap_or_default();
436 v.push(input);
437 self.attachments = ::std::option::Option::Some(v);
438 self
439 }
440 pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>) -> Self {
445 self.attachments = input;
446 self
447 }
448 pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>> {
453 &self.attachments
454 }
455 pub fn encrypted(mut self, input: bool) -> Self {
457 self.encrypted = ::std::option::Option::Some(input);
458 self
459 }
460 pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
462 self.encrypted = input;
463 self
464 }
465 pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
467 &self.encrypted
468 }
469 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
471 self.kms_key_id = ::std::option::Option::Some(input.into());
472 self
473 }
474 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
476 self.kms_key_id = input;
477 self
478 }
479 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
481 &self.kms_key_id
482 }
483 pub fn build(self) -> crate::types::Volume {
485 crate::types::Volume {
486 outpost_arn: self.outpost_arn,
487 iops: self.iops,
488 tags: self.tags,
489 volume_type: self.volume_type,
490 fast_restored: self.fast_restored,
491 multi_attach_enabled: self.multi_attach_enabled,
492 throughput: self.throughput,
493 sse_type: self.sse_type,
494 operator: self.operator,
495 volume_initialization_rate: self.volume_initialization_rate,
496 volume_id: self.volume_id,
497 size: self.size,
498 snapshot_id: self.snapshot_id,
499 availability_zone: self.availability_zone,
500 state: self.state,
501 create_time: self.create_time,
502 attachments: self.attachments,
503 encrypted: self.encrypted,
504 kms_key_id: self.kms_key_id,
505 }
506 }
507}