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_network_info(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::NetworkInfo, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::NetworkInfo::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("networkPerformance") /* NetworkPerformance com.amazonaws.ec2#NetworkInfo$NetworkPerformance */ =>  {
                let var_1 =
                    Some(
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_network_performance(var_1);
            }
            ,
            s if s.matches("maximumNetworkInterfaces") /* MaximumNetworkInterfaces com.amazonaws.ec2#NetworkInfo$MaximumNetworkInterfaces */ =>  {
                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#MaxNetworkInterfaces`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_maximum_network_interfaces(var_2);
            }
            ,
            s if s.matches("maximumNetworkCards") /* MaximumNetworkCards com.amazonaws.ec2#NetworkInfo$MaximumNetworkCards */ =>  {
                let var_3 =
                    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#MaximumNetworkCards`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_maximum_network_cards(var_3);
            }
            ,
            s if s.matches("defaultNetworkCardIndex") /* DefaultNetworkCardIndex com.amazonaws.ec2#NetworkInfo$DefaultNetworkCardIndex */ =>  {
                let var_4 =
                    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#DefaultNetworkCardIndex`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_default_network_card_index(var_4);
            }
            ,
            s if s.matches("networkCards") /* NetworkCards com.amazonaws.ec2#NetworkInfo$NetworkCards */ =>  {
                let var_5 =
                    Some(
                        crate::protocol_serde::shape_network_card_info_list::de_network_card_info_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_network_cards(var_5);
            }
            ,
            s if s.matches("ipv4AddressesPerInterface") /* Ipv4AddressesPerInterface com.amazonaws.ec2#NetworkInfo$Ipv4AddressesPerInterface */ =>  {
                let var_6 =
                    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#MaxIpv4AddrPerInterface`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_ipv4_addresses_per_interface(var_6);
            }
            ,
            s if s.matches("ipv6AddressesPerInterface") /* Ipv6AddressesPerInterface com.amazonaws.ec2#NetworkInfo$Ipv6AddressesPerInterface */ =>  {
                let var_7 =
                    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#MaxIpv6AddrPerInterface`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_ipv6_addresses_per_interface(var_7);
            }
            ,
            s if s.matches("ipv6Supported") /* Ipv6Supported com.amazonaws.ec2#NetworkInfo$Ipv6Supported */ =>  {
                let var_8 =
                    Some(
                         {
                            <bool 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 (boolean: `com.amazonaws.ec2#Ipv6Flag`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_ipv6_supported(var_8);
            }
            ,
            s if s.matches("enaSupport") /* EnaSupport com.amazonaws.ec2#NetworkInfo$EnaSupport */ =>  {
                let var_9 =
                    Some(
                        Result::<crate::types::EnaSupport, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::EnaSupport::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_ena_support(var_9);
            }
            ,
            s if s.matches("efaSupported") /* EfaSupported com.amazonaws.ec2#NetworkInfo$EfaSupported */ =>  {
                let var_10 =
                    Some(
                         {
                            <bool 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 (boolean: `com.amazonaws.ec2#EfaSupportedFlag`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_efa_supported(var_10);
            }
            ,
            s if s.matches("efaInfo") /* EfaInfo com.amazonaws.ec2#NetworkInfo$EfaInfo */ =>  {
                let var_11 =
                    Some(
                        crate::protocol_serde::shape_efa_info::de_efa_info(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_efa_info(var_11);
            }
            ,
            s if s.matches("encryptionInTransitSupported") /* EncryptionInTransitSupported com.amazonaws.ec2#NetworkInfo$EncryptionInTransitSupported */ =>  {
                let var_12 =
                    Some(
                         {
                            <bool 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 (boolean: `com.amazonaws.ec2#EncryptionInTransitSupported`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_encryption_in_transit_supported(var_12);
            }
            ,
            s if s.matches("enaSrdSupported") /* EnaSrdSupported com.amazonaws.ec2#NetworkInfo$EnaSrdSupported */ =>  {
                let var_13 =
                    Some(
                         {
                            <bool 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 (boolean: `com.amazonaws.ec2#EnaSrdSupported`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_ena_srd_supported(var_13);
            }
            ,
            s if s.matches("bandwidthWeightings") /* BandwidthWeightings com.amazonaws.ec2#NetworkInfo$BandwidthWeightings */ =>  {
                let var_14 =
                    Some(
                        crate::protocol_serde::shape_bandwidth_weighting_type_list::de_bandwidth_weighting_type_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_bandwidth_weightings(var_14);
            }
            ,
            s if s.matches("flexibleEnaQueuesSupport") /* FlexibleEnaQueuesSupport com.amazonaws.ec2#NetworkInfo$FlexibleEnaQueuesSupport */ =>  {
                let var_15 =
                    Some(
                        Result::<crate::types::FlexibleEnaQueuesSupport, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::FlexibleEnaQueuesSupport::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_flexible_ena_queues_support(var_15);
            }
            ,
            s if s.matches("secondaryNetworkSupported") /* SecondaryNetworkSupported com.amazonaws.ec2#NetworkInfo$SecondaryNetworkSupported */ =>  {
                let var_16 =
                    Some(
                         {
                            <bool 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 (boolean: `com.amazonaws.ec2#SecondaryNetworkSupportedFlag`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_secondary_network_supported(var_16);
            }
            ,
            s if s.matches("maximumSecondaryNetworkInterfaces") /* MaximumSecondaryNetworkInterfaces com.amazonaws.ec2#NetworkInfo$MaximumSecondaryNetworkInterfaces */ =>  {
                let var_17 =
                    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#MaximumSecondaryNetworkInterfaces`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_maximum_secondary_network_interfaces(var_17);
            }
            ,
            s if s.matches("ipv4AddressesPerSecondaryInterface") /* Ipv4AddressesPerSecondaryInterface com.amazonaws.ec2#NetworkInfo$Ipv4AddressesPerSecondaryInterface */ =>  {
                let var_18 =
                    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#Ipv4AddressesPerSecondaryInterface`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_ipv4_addresses_per_secondary_interface(var_18);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}