aws_sdk_ec2/protocol_serde/
shape_instance_storage_info.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_instance_storage_info(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::InstanceStorageInfo, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::InstanceStorageInfo::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("totalSizeInGB") => {
11 let var_1 =
12 Some(
13 {
14 <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
15 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
16 )
17 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `com.amazonaws.ec2#DiskSize`)"))
18 }
19 ?
20 )
21 ;
22 builder = builder.set_total_size_in_gb(var_1);
23 }
24 ,
25 s if s.matches("disks") => {
26 let var_2 =
27 Some(
28 crate::protocol_serde::shape_disk_info_list::de_disk_info_list(&mut tag)
29 ?
30 )
31 ;
32 builder = builder.set_disks(var_2);
33 }
34 ,
35 s if s.matches("nvmeSupport") => {
36 let var_3 =
37 Some(
38 Result::<crate::types::EphemeralNvmeSupport, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
39 crate::types::EphemeralNvmeSupport::from(
40 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
41 )
42 )
43 ?
44 )
45 ;
46 builder = builder.set_nvme_support(var_3);
47 }
48 ,
49 s if s.matches("encryptionSupport") => {
50 let var_4 =
51 Some(
52 Result::<crate::types::InstanceStorageEncryptionSupport, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
53 crate::types::InstanceStorageEncryptionSupport::from(
54 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
55 )
56 )
57 ?
58 )
59 ;
60 builder = builder.set_encryption_support(var_4);
61 }
62 ,
63 _ => {}
64 }
65 }
66 Ok(builder.build())
67}