aws-sdk-ses 1.105.0

AWS SDK for Amazon Simple Email Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(unused_mut)]
pub fn ser_sns_action(
    mut writer: ::aws_smithy_query::QueryValueWriter,
    input: &crate::types::SnsAction,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("TopicArn");
    {
        scope_1.string(&input.topic_arn);
    }
    #[allow(unused_mut)]
    let mut scope_2 = writer.prefix("Encoding");
    if let Some(var_3) = &input.encoding {
        scope_2.string(var_3.as_str());
    }
    Ok(())
}

#[allow(clippy::needless_question_mark)]
pub fn de_sns_action(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    depth: u32,
) -> ::std::result::Result<crate::types::SnsAction, ::aws_smithy_xml::decode::XmlDecodeError> {
    if depth >= 128u32 {
        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("maximum nesting depth exceeded"));
    }
    #[allow(unused_mut)]
    let mut builder = crate::types::SnsAction::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("TopicArn") /* TopicArn com.amazonaws.ses#SNSAction$TopicArn */ =>  {
                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_topic_arn(var_4);
            }
            ,
            s if s.matches("Encoding") /* Encoding com.amazonaws.ses#SNSAction$Encoding */ =>  {
                let var_5 =
                    Some(
                        Result::<crate::types::SnsActionEncoding, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::SnsActionEncoding::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_encoding(var_5);
            }
            ,
            _ => {}
        }
    }
    Ok(crate::serde_util::sns_action_correct_errors(builder)
        .build()
        .map_err(|_| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing field"))?)
}