aws-sdk-cloudformation 1.111.0

AWS SDK for AWS CloudFormation
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(unused_mut)]
pub fn ser_resource_mapping(
    mut writer: ::aws_smithy_query::QueryValueWriter,
    input: &crate::types::ResourceMapping,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("Source");
    if let Some(var_2) = &input.source {
        crate::protocol_serde::shape_resource_location::ser_resource_location(scope_1, var_2)?;
    }
    #[allow(unused_mut)]
    let mut scope_3 = writer.prefix("Destination");
    if let Some(var_4) = &input.destination {
        crate::protocol_serde::shape_resource_location::ser_resource_location(scope_3, var_4)?;
    }
    Ok(())
}

#[allow(clippy::needless_question_mark)]
pub fn de_resource_mapping(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::ResourceMapping, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::ResourceMapping::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Source") /* Source com.amazonaws.cloudformation#ResourceMapping$Source */ =>  {
                let var_5 =
                    Some(
                        crate::protocol_serde::shape_resource_location::de_resource_location(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_source(var_5);
            }
            ,
            s if s.matches("Destination") /* Destination com.amazonaws.cloudformation#ResourceMapping$Destination */ =>  {
                let var_6 =
                    Some(
                        crate::protocol_serde::shape_resource_location::de_resource_location(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_destination(var_6);
            }
            ,
            _ => {}
        }
    }
    Ok(crate::serde_util::resource_mapping_correct_errors(builder).build())
}