aws-sdk-ec2 1.224.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_launch_template_cpu_options(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::LaunchTemplateCpuOptions, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::LaunchTemplateCpuOptions::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("coreCount") /* CoreCount com.amazonaws.ec2#LaunchTemplateCpuOptions$CoreCount */ =>  {
                let var_1 =
                    Some(
                         {
                            <i32 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 (integer: `com.amazonaws.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_core_count(var_1);
            }
            ,
            s if s.matches("threadsPerCore") /* ThreadsPerCore com.amazonaws.ec2#LaunchTemplateCpuOptions$ThreadsPerCore */ =>  {
                let var_2 =
                    Some(
                         {
                            <i32 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 (integer: `com.amazonaws.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_threads_per_core(var_2);
            }
            ,
            s if s.matches("amdSevSnp") /* AmdSevSnp com.amazonaws.ec2#LaunchTemplateCpuOptions$AmdSevSnp */ =>  {
                let var_3 =
                    Some(
                        Result::<crate::types::AmdSevSnpSpecification, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::AmdSevSnpSpecification::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_amd_sev_snp(var_3);
            }
            ,
            s if s.matches("nestedVirtualization") /* NestedVirtualization com.amazonaws.ec2#LaunchTemplateCpuOptions$NestedVirtualization */ =>  {
                let var_4 =
                    Some(
                        Result::<crate::types::NestedVirtualizationSpecification, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::NestedVirtualizationSpecification::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_nested_virtualization(var_4);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}