aws-sdk-cloudsearch 1.98.0

AWS SDK for Amazon CloudSearch
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(unused_mut)]
pub fn ser_expression(
    mut writer: ::aws_smithy_query::QueryValueWriter,
    input: &crate::types::Expression,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("ExpressionName");
    {
        scope_1.string(&input.expression_name);
    }
    #[allow(unused_mut)]
    let mut scope_2 = writer.prefix("ExpressionValue");
    {
        scope_2.string(&input.expression_value);
    }
    Ok(())
}

#[allow(clippy::needless_question_mark)]
pub fn de_expression(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::Expression, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::Expression::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("ExpressionName") /* ExpressionName com.amazonaws.cloudsearch#Expression$ExpressionName */ =>  {
                let var_3 =
                    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_expression_name(var_3);
            }
            ,
            s if s.matches("ExpressionValue") /* ExpressionValue com.amazonaws.cloudsearch#Expression$ExpressionValue */ =>  {
                let var_4 =
                    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_expression_value(var_4);
            }
            ,
            _ => {}
        }
    }
    Ok(crate::serde_util::expression_correct_errors(builder)
        .build()
        .map_err(|_| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing field"))?)
}