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_stop_action(
    mut writer: ::aws_smithy_query::QueryValueWriter,
    input: &crate::types::StopAction,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("Scope");
    {
        scope_1.string(input.scope.as_str());
    }
    #[allow(unused_mut)]
    let mut scope_2 = writer.prefix("TopicArn");
    if let Some(var_3) = &input.topic_arn {
        scope_2.string(var_3);
    }
    Ok(())
}

#[allow(clippy::needless_question_mark)]
pub fn de_stop_action(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    depth: u32,
) -> ::std::result::Result<crate::types::StopAction, ::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::StopAction::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Scope") /* Scope com.amazonaws.ses#StopAction$Scope */ =>  {
                let var_4 =
                    Some(
                        Result::<crate::types::StopScope, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::StopScope::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_scope(var_4);
            }
            ,
            s if s.matches("TopicArn") /* TopicArn com.amazonaws.ses#StopAction$TopicArn */ =>  {
                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_topic_arn(var_5);
            }
            ,
            _ => {}
        }
    }
    Ok(crate::serde_util::stop_action_correct_errors(builder)
        .build()
        .map_err(|_| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing field"))?)
}