aws-sdk-ec2 1.218.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_instance_storage_info(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::InstanceStorageInfo, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::InstanceStorageInfo::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("totalSizeInGB") /* TotalSizeInGB com.amazonaws.ec2#InstanceStorageInfo$TotalSizeInGB */ =>  {
                let var_1 =
                    Some(
                         {
                            <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `com.amazonaws.ec2#DiskSize`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_total_size_in_gb(var_1);
            }
            ,
            s if s.matches("disks") /* Disks com.amazonaws.ec2#InstanceStorageInfo$Disks */ =>  {
                let var_2 =
                    Some(
                        crate::protocol_serde::shape_disk_info_list::de_disk_info_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_disks(var_2);
            }
            ,
            s if s.matches("nvmeSupport") /* NvmeSupport com.amazonaws.ec2#InstanceStorageInfo$NvmeSupport */ =>  {
                let var_3 =
                    Some(
                        Result::<crate::types::EphemeralNvmeSupport, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::EphemeralNvmeSupport::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_nvme_support(var_3);
            }
            ,
            s if s.matches("encryptionSupport") /* EncryptionSupport com.amazonaws.ec2#InstanceStorageInfo$EncryptionSupport */ =>  {
                let var_4 =
                    Some(
                        Result::<crate::types::InstanceStorageEncryptionSupport, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::InstanceStorageEncryptionSupport::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_encryption_support(var_4);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}