aws-sdk-ec2 1.221.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(unused_mut)]
pub fn ser_instance_ipv6_address(
    mut writer: ::aws_smithy_query::QueryValueWriter,
    input: &crate::types::InstanceIpv6Address,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("Ipv6Address");
    if let Some(var_2) = &input.ipv6_address {
        scope_1.string(var_2);
    }
    #[allow(unused_mut)]
    let mut scope_3 = writer.prefix("IsPrimaryIpv6");
    if let Some(var_4) = &input.is_primary_ipv6 {
        scope_3.boolean(*var_4);
    }
    Ok(())
}

#[allow(clippy::needless_question_mark)]
pub fn de_instance_ipv6_address(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::InstanceIpv6Address, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::InstanceIpv6Address::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("ipv6Address") /* Ipv6Address com.amazonaws.ec2#InstanceIpv6Address$Ipv6Address */ =>  {
                let var_5 =
                    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_ipv6_address(var_5);
            }
            ,
            s if s.matches("isPrimaryIpv6") /* IsPrimaryIpv6 com.amazonaws.ec2#InstanceIpv6Address$IsPrimaryIpv6 */ =>  {
                let var_6 =
                    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#Boolean`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_is_primary_ipv6(var_6);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}