// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn parse_generic_error(
    response: &http::Response<bytes::Bytes>,
) -> Result<smithy_types::Error, smithy_xml::decode::XmlError> {
    crate::rest_xml_wrapped_errors::parse_generic_error(response.body().as_ref())
}

#[allow(unused_mut)]
pub fn deser_structure_authorization_error_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::authorization_error_exception::Builder,
) -> Result<crate::error::authorization_error_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#AuthorizationErrorException$message */ =>  {
                let var_1 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_1);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_internal_error_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::internal_error_exception::Builder,
) -> Result<crate::error::internal_error_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#InternalErrorException$message */ =>  {
                let var_2 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_2);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_invalid_parameter_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::invalid_parameter_exception::Builder,
) -> Result<crate::error::invalid_parameter_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#InvalidParameterException$message */ =>  {
                let var_3 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_3);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_not_found_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::not_found_exception::Builder,
) -> Result<crate::error::not_found_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#NotFoundException$message */ =>  {
                let var_4 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_4);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_throttled_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::throttled_exception::Builder,
) -> Result<crate::error::throttled_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#ThrottledException$message */ =>  {
                let var_5 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_5);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_check_if_phone_number_is_opted_out(
    inp: &[u8],
    mut builder: crate::output::check_if_phone_number_is_opted_out_output::Builder,
) -> Result<
    crate::output::check_if_phone_number_is_opted_out_output::Builder,
    smithy_xml::decode::XmlError,
> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("CheckIfPhoneNumberIsOptedOutResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected CheckIfPhoneNumberIsOptedOutResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("CheckIfPhoneNumberIsOptedOutResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected CheckIfPhoneNumberIsOptedOutResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("isOptedOut") /* isOptedOut com.amazonaws.sns#CheckIfPhoneNumberIsOptedOutOutput$isOptedOut */ =>  {
                let var_6 =
                    Some(
                         {
                            use std::str::FromStr;
                            bool::from_str(
                                smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|smithy_xml::decode::XmlError::custom("expected (boolean: `com.amazonaws.sns#boolean`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_is_opted_out(var_6);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected CheckIfPhoneNumberIsOptedOutResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_filter_policy_limit_exceeded_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::filter_policy_limit_exceeded_exception::Builder,
) -> Result<
    crate::error::filter_policy_limit_exceeded_exception::Builder,
    smithy_xml::decode::XmlError,
> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#FilterPolicyLimitExceededException$message */ =>  {
                let var_7 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_7);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_subscription_limit_exceeded_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::subscription_limit_exceeded_exception::Builder,
) -> Result<
    crate::error::subscription_limit_exceeded_exception::Builder,
    smithy_xml::decode::XmlError,
> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#SubscriptionLimitExceededException$message */ =>  {
                let var_8 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_8);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_confirm_subscription(
    inp: &[u8],
    mut builder: crate::output::confirm_subscription_output::Builder,
) -> Result<crate::output::confirm_subscription_output::Builder, smithy_xml::decode::XmlError> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("ConfirmSubscriptionResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected ConfirmSubscriptionResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("ConfirmSubscriptionResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected ConfirmSubscriptionResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("SubscriptionArn") /* SubscriptionArn com.amazonaws.sns#ConfirmSubscriptionOutput$SubscriptionArn */ =>  {
                let var_9 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_subscription_arn(var_9);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected ConfirmSubscriptionResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_create_platform_application(
    inp: &[u8],
    mut builder: crate::output::create_platform_application_output::Builder,
) -> Result<crate::output::create_platform_application_output::Builder, smithy_xml::decode::XmlError>
{
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("CreatePlatformApplicationResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected CreatePlatformApplicationResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("CreatePlatformApplicationResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected CreatePlatformApplicationResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("PlatformApplicationArn") /* PlatformApplicationArn com.amazonaws.sns#CreatePlatformApplicationOutput$PlatformApplicationArn */ =>  {
                let var_10 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_platform_application_arn(var_10);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected CreatePlatformApplicationResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_create_platform_endpoint(
    inp: &[u8],
    mut builder: crate::output::create_platform_endpoint_output::Builder,
) -> Result<crate::output::create_platform_endpoint_output::Builder, smithy_xml::decode::XmlError> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("CreatePlatformEndpointResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected CreatePlatformEndpointResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("CreatePlatformEndpointResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected CreatePlatformEndpointResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("EndpointArn") /* EndpointArn com.amazonaws.sns#CreatePlatformEndpointOutput$EndpointArn */ =>  {
                let var_11 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_endpoint_arn(var_11);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected CreatePlatformEndpointResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_opted_out_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::opted_out_exception::Builder,
) -> Result<crate::error::opted_out_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#OptedOutException$message */ =>  {
                let var_12 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_12);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_user_error_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::user_error_exception::Builder,
) -> Result<crate::error::user_error_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#UserErrorException$message */ =>  {
                let var_13 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_13);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_concurrent_access_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::concurrent_access_exception::Builder,
) -> Result<crate::error::concurrent_access_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#ConcurrentAccessException$message */ =>  {
                let var_14 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_14);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_invalid_security_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::invalid_security_exception::Builder,
) -> Result<crate::error::invalid_security_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#InvalidSecurityException$message */ =>  {
                let var_15 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_15);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_stale_tag_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::stale_tag_exception::Builder,
) -> Result<crate::error::stale_tag_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#StaleTagException$message */ =>  {
                let var_16 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_16);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_tag_limit_exceeded_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::tag_limit_exceeded_exception::Builder,
) -> Result<crate::error::tag_limit_exceeded_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#TagLimitExceededException$message */ =>  {
                let var_17 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_17);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_tag_policy_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::tag_policy_exception::Builder,
) -> Result<crate::error::tag_policy_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#TagPolicyException$message */ =>  {
                let var_18 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_18);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_topic_limit_exceeded_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::topic_limit_exceeded_exception::Builder,
) -> Result<crate::error::topic_limit_exceeded_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#TopicLimitExceededException$message */ =>  {
                let var_19 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_19);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_create_topic(
    inp: &[u8],
    mut builder: crate::output::create_topic_output::Builder,
) -> Result<crate::output::create_topic_output::Builder, smithy_xml::decode::XmlError> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("CreateTopicResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected CreateTopicResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("CreateTopicResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected CreateTopicResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("TopicArn") /* TopicArn com.amazonaws.sns#CreateTopicOutput$TopicArn */ =>  {
                let var_20 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_topic_arn(var_20);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected CreateTopicResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_resource_not_found_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::resource_not_found_exception::Builder,
) -> Result<crate::error::resource_not_found_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#ResourceNotFoundException$message */ =>  {
                let var_21 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_21);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_get_endpoint_attributes(
    inp: &[u8],
    mut builder: crate::output::get_endpoint_attributes_output::Builder,
) -> Result<crate::output::get_endpoint_attributes_output::Builder, smithy_xml::decode::XmlError> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("GetEndpointAttributesResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected GetEndpointAttributesResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("GetEndpointAttributesResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected GetEndpointAttributesResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("Attributes") /* Attributes com.amazonaws.sns#GetEndpointAttributesOutput$Attributes */ =>  {
                let var_22 =
                    Some(
                        crate::xml_deser::deser_map_map_string_to_string(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_attributes(var_22);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected GetEndpointAttributesResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_get_platform_application_attributes(
    inp: &[u8],
    mut builder: crate::output::get_platform_application_attributes_output::Builder,
) -> Result<
    crate::output::get_platform_application_attributes_output::Builder,
    smithy_xml::decode::XmlError,
> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("GetPlatformApplicationAttributesResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected GetPlatformApplicationAttributesResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("GetPlatformApplicationAttributesResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected GetPlatformApplicationAttributesResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("Attributes") /* Attributes com.amazonaws.sns#GetPlatformApplicationAttributesOutput$Attributes */ =>  {
                let var_23 =
                    Some(
                        crate::xml_deser::deser_map_map_string_to_string(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_attributes(var_23);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected GetPlatformApplicationAttributesResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_get_sms_attributes(
    inp: &[u8],
    mut builder: crate::output::get_sms_attributes_output::Builder,
) -> Result<crate::output::get_sms_attributes_output::Builder, smithy_xml::decode::XmlError> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("GetSMSAttributesResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected GetSMSAttributesResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("GetSMSAttributesResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected GetSMSAttributesResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("attributes") /* attributes com.amazonaws.sns#GetSMSAttributesOutput$attributes */ =>  {
                let var_24 =
                    Some(
                        crate::xml_deser::deser_map_map_string_to_string(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_attributes(var_24);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected GetSMSAttributesResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_get_sms_sandbox_account_status(
    inp: &[u8],
    mut builder: crate::output::get_sms_sandbox_account_status_output::Builder,
) -> Result<
    crate::output::get_sms_sandbox_account_status_output::Builder,
    smithy_xml::decode::XmlError,
> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("GetSMSSandboxAccountStatusResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected GetSMSSandboxAccountStatusResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("GetSMSSandboxAccountStatusResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected GetSMSSandboxAccountStatusResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("IsInSandbox") /* IsInSandbox com.amazonaws.sns#GetSMSSandboxAccountStatusOutput$IsInSandbox */ =>  {
                let var_25 =
                    Some(
                         {
                            use std::str::FromStr;
                            bool::from_str(
                                smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|smithy_xml::decode::XmlError::custom("expected (boolean: `com.amazonaws.sns#boolean`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_is_in_sandbox(var_25);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected GetSMSSandboxAccountStatusResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_get_subscription_attributes(
    inp: &[u8],
    mut builder: crate::output::get_subscription_attributes_output::Builder,
) -> Result<crate::output::get_subscription_attributes_output::Builder, smithy_xml::decode::XmlError>
{
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("GetSubscriptionAttributesResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected GetSubscriptionAttributesResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("GetSubscriptionAttributesResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected GetSubscriptionAttributesResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("Attributes") /* Attributes com.amazonaws.sns#GetSubscriptionAttributesOutput$Attributes */ =>  {
                let var_26 =
                    Some(
                        crate::xml_deser::deser_map_subscription_attributes_map(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_attributes(var_26);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected GetSubscriptionAttributesResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_get_topic_attributes(
    inp: &[u8],
    mut builder: crate::output::get_topic_attributes_output::Builder,
) -> Result<crate::output::get_topic_attributes_output::Builder, smithy_xml::decode::XmlError> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("GetTopicAttributesResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected GetTopicAttributesResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("GetTopicAttributesResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected GetTopicAttributesResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("Attributes") /* Attributes com.amazonaws.sns#GetTopicAttributesOutput$Attributes */ =>  {
                let var_27 =
                    Some(
                        crate::xml_deser::deser_map_topic_attributes_map(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_attributes(var_27);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected GetTopicAttributesResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_list_endpoints_by_platform_application(
    inp: &[u8],
    mut builder: crate::output::list_endpoints_by_platform_application_output::Builder,
) -> Result<
    crate::output::list_endpoints_by_platform_application_output::Builder,
    smithy_xml::decode::XmlError,
> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("ListEndpointsByPlatformApplicationResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected ListEndpointsByPlatformApplicationResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("ListEndpointsByPlatformApplicationResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected ListEndpointsByPlatformApplicationResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("Endpoints") /* Endpoints com.amazonaws.sns#ListEndpointsByPlatformApplicationOutput$Endpoints */ =>  {
                let var_28 =
                    Some(
                        crate::xml_deser::deser_list_list_of_endpoints(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_endpoints(var_28);
            }
            ,
            s if s.matches("NextToken") /* NextToken com.amazonaws.sns#ListEndpointsByPlatformApplicationOutput$NextToken */ =>  {
                let var_29 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_next_token(var_29);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected ListEndpointsByPlatformApplicationResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_validation_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::validation_exception::Builder,
) -> Result<crate::error::validation_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Message") /* Message com.amazonaws.sns#ValidationException$Message */ =>  {
                let var_30 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_30);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_list_origination_numbers(
    inp: &[u8],
    mut builder: crate::output::list_origination_numbers_output::Builder,
) -> Result<crate::output::list_origination_numbers_output::Builder, smithy_xml::decode::XmlError> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("ListOriginationNumbersResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected ListOriginationNumbersResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("ListOriginationNumbersResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected ListOriginationNumbersResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("NextToken") /* NextToken com.amazonaws.sns#ListOriginationNumbersOutput$NextToken */ =>  {
                let var_31 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_next_token(var_31);
            }
            ,
            s if s.matches("PhoneNumbers") /* PhoneNumbers com.amazonaws.sns#ListOriginationNumbersOutput$PhoneNumbers */ =>  {
                let var_32 =
                    Some(
                        crate::xml_deser::deser_list_phone_number_information_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_phone_numbers(var_32);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected ListOriginationNumbersResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_list_phone_numbers_opted_out(
    inp: &[u8],
    mut builder: crate::output::list_phone_numbers_opted_out_output::Builder,
) -> Result<crate::output::list_phone_numbers_opted_out_output::Builder, smithy_xml::decode::XmlError>
{
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("ListPhoneNumbersOptedOutResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected ListPhoneNumbersOptedOutResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("ListPhoneNumbersOptedOutResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected ListPhoneNumbersOptedOutResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("phoneNumbers") /* phoneNumbers com.amazonaws.sns#ListPhoneNumbersOptedOutOutput$phoneNumbers */ =>  {
                let var_33 =
                    Some(
                        crate::xml_deser::deser_list_phone_number_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_phone_numbers(var_33);
            }
            ,
            s if s.matches("nextToken") /* nextToken com.amazonaws.sns#ListPhoneNumbersOptedOutOutput$nextToken */ =>  {
                let var_34 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_next_token(var_34);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected ListPhoneNumbersOptedOutResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_list_platform_applications(
    inp: &[u8],
    mut builder: crate::output::list_platform_applications_output::Builder,
) -> Result<crate::output::list_platform_applications_output::Builder, smithy_xml::decode::XmlError>
{
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("ListPlatformApplicationsResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected ListPlatformApplicationsResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("ListPlatformApplicationsResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected ListPlatformApplicationsResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("PlatformApplications") /* PlatformApplications com.amazonaws.sns#ListPlatformApplicationsOutput$PlatformApplications */ =>  {
                let var_35 =
                    Some(
                        crate::xml_deser::deser_list_list_of_platform_applications(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_platform_applications(var_35);
            }
            ,
            s if s.matches("NextToken") /* NextToken com.amazonaws.sns#ListPlatformApplicationsOutput$NextToken */ =>  {
                let var_36 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_next_token(var_36);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected ListPlatformApplicationsResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_list_sms_sandbox_phone_numbers(
    inp: &[u8],
    mut builder: crate::output::list_sms_sandbox_phone_numbers_output::Builder,
) -> Result<
    crate::output::list_sms_sandbox_phone_numbers_output::Builder,
    smithy_xml::decode::XmlError,
> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("ListSMSSandboxPhoneNumbersResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected ListSMSSandboxPhoneNumbersResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("ListSMSSandboxPhoneNumbersResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected ListSMSSandboxPhoneNumbersResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("PhoneNumbers") /* PhoneNumbers com.amazonaws.sns#ListSMSSandboxPhoneNumbersOutput$PhoneNumbers */ =>  {
                let var_37 =
                    Some(
                        crate::xml_deser::deser_list_sms_sandbox_phone_number_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_phone_numbers(var_37);
            }
            ,
            s if s.matches("NextToken") /* NextToken com.amazonaws.sns#ListSMSSandboxPhoneNumbersOutput$NextToken */ =>  {
                let var_38 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_next_token(var_38);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected ListSMSSandboxPhoneNumbersResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_list_subscriptions(
    inp: &[u8],
    mut builder: crate::output::list_subscriptions_output::Builder,
) -> Result<crate::output::list_subscriptions_output::Builder, smithy_xml::decode::XmlError> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("ListSubscriptionsResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected ListSubscriptionsResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("ListSubscriptionsResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected ListSubscriptionsResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("Subscriptions") /* Subscriptions com.amazonaws.sns#ListSubscriptionsOutput$Subscriptions */ =>  {
                let var_39 =
                    Some(
                        crate::xml_deser::deser_list_subscriptions_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_subscriptions(var_39);
            }
            ,
            s if s.matches("NextToken") /* NextToken com.amazonaws.sns#ListSubscriptionsOutput$NextToken */ =>  {
                let var_40 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_next_token(var_40);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected ListSubscriptionsResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_list_subscriptions_by_topic(
    inp: &[u8],
    mut builder: crate::output::list_subscriptions_by_topic_output::Builder,
) -> Result<crate::output::list_subscriptions_by_topic_output::Builder, smithy_xml::decode::XmlError>
{
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("ListSubscriptionsByTopicResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected ListSubscriptionsByTopicResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("ListSubscriptionsByTopicResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected ListSubscriptionsByTopicResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("Subscriptions") /* Subscriptions com.amazonaws.sns#ListSubscriptionsByTopicOutput$Subscriptions */ =>  {
                let var_41 =
                    Some(
                        crate::xml_deser::deser_list_subscriptions_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_subscriptions(var_41);
            }
            ,
            s if s.matches("NextToken") /* NextToken com.amazonaws.sns#ListSubscriptionsByTopicOutput$NextToken */ =>  {
                let var_42 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_next_token(var_42);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected ListSubscriptionsByTopicResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_list_tags_for_resource(
    inp: &[u8],
    mut builder: crate::output::list_tags_for_resource_output::Builder,
) -> Result<crate::output::list_tags_for_resource_output::Builder, smithy_xml::decode::XmlError> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("ListTagsForResourceResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected ListTagsForResourceResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("ListTagsForResourceResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected ListTagsForResourceResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("Tags") /* Tags com.amazonaws.sns#ListTagsForResourceOutput$Tags */ =>  {
                let var_43 =
                    Some(
                        crate::xml_deser::deser_list_tag_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_tags(var_43);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected ListTagsForResourceResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_list_topics(
    inp: &[u8],
    mut builder: crate::output::list_topics_output::Builder,
) -> Result<crate::output::list_topics_output::Builder, smithy_xml::decode::XmlError> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("ListTopicsResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected ListTopicsResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("ListTopicsResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected ListTopicsResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("Topics") /* Topics com.amazonaws.sns#ListTopicsOutput$Topics */ =>  {
                let var_44 =
                    Some(
                        crate::xml_deser::deser_list_topics_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_topics(var_44);
            }
            ,
            s if s.matches("NextToken") /* NextToken com.amazonaws.sns#ListTopicsOutput$NextToken */ =>  {
                let var_45 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_next_token(var_45);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected ListTopicsResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_endpoint_disabled_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::endpoint_disabled_exception::Builder,
) -> Result<crate::error::endpoint_disabled_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#EndpointDisabledException$message */ =>  {
                let var_46 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_46);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_invalid_parameter_value_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::invalid_parameter_value_exception::Builder,
) -> Result<crate::error::invalid_parameter_value_exception::Builder, smithy_xml::decode::XmlError>
{
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#InvalidParameterValueException$message */ =>  {
                let var_47 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_47);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_kms_access_denied_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::kms_access_denied_exception::Builder,
) -> Result<crate::error::kms_access_denied_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#KMSAccessDeniedException$message */ =>  {
                let var_48 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_48);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_kms_disabled_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::kms_disabled_exception::Builder,
) -> Result<crate::error::kms_disabled_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#KMSDisabledException$message */ =>  {
                let var_49 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_49);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_kms_invalid_state_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::kms_invalid_state_exception::Builder,
) -> Result<crate::error::kms_invalid_state_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#KMSInvalidStateException$message */ =>  {
                let var_50 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_50);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_kms_not_found_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::kms_not_found_exception::Builder,
) -> Result<crate::error::kms_not_found_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#KMSNotFoundException$message */ =>  {
                let var_51 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_51);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_kms_opt_in_required_xml_err(
    inp: &[u8],
    mut builder: crate::error::kms_opt_in_required::Builder,
) -> Result<crate::error::kms_opt_in_required::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#KMSOptInRequired$message */ =>  {
                let var_52 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_52);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_kms_throttling_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::kms_throttling_exception::Builder,
) -> Result<crate::error::kms_throttling_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#KMSThrottlingException$message */ =>  {
                let var_53 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_53);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_platform_application_disabled_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::platform_application_disabled_exception::Builder,
) -> Result<
    crate::error::platform_application_disabled_exception::Builder,
    smithy_xml::decode::XmlError,
> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("message") /* message com.amazonaws.sns#PlatformApplicationDisabledException$message */ =>  {
                let var_54 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_54);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_publish(
    inp: &[u8],
    mut builder: crate::output::publish_output::Builder,
) -> Result<crate::output::publish_output::Builder, smithy_xml::decode::XmlError> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("PublishResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected PublishResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("PublishResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected PublishResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("MessageId") /* MessageId com.amazonaws.sns#PublishOutput$MessageId */ =>  {
                let var_55 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message_id(var_55);
            }
            ,
            s if s.matches("SequenceNumber") /* SequenceNumber com.amazonaws.sns#PublishOutput$SequenceNumber */ =>  {
                let var_56 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_sequence_number(var_56);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected PublishResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_operation_subscribe(
    inp: &[u8],
    mut builder: crate::output::subscribe_output::Builder,
) -> Result<crate::output::subscribe_output::Builder, smithy_xml::decode::XmlError> {
    use std::convert::TryFrom;
    let mut doc = smithy_xml::decode::Document::try_from(inp)?;

    #[allow(unused_mut)]
    let mut decoder = doc.root_element()?;
    let start_el = decoder.start_el();
    if !(start_el.matches("SubscribeResponse")) {
        return Err(smithy_xml::decode::XmlError::custom(format!(
            "invalid root, expected SubscribeResponse got {:?}",
            start_el
        )));
    }
    if let Some(mut result_tag) = decoder.next_tag() {
        let start_el = result_tag.start_el();
        if !(start_el.matches("SubscribeResult")) {
            return Err(smithy_xml::decode::XmlError::custom(format!(
                "invalid result, expected SubscribeResult got {:?}",
                start_el
            )));
        }
        while let Some(mut tag) = result_tag.next_tag() {
            match tag.start_el() {
            s if s.matches("SubscriptionArn") /* SubscriptionArn com.amazonaws.sns#SubscribeOutput$SubscriptionArn */ =>  {
                let var_57 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_subscription_arn(var_57);
            }
            ,
            _ => {}
        }
        }
    } else {
        return Err(smithy_xml::decode::XmlError::custom(
            "expected SubscribeResult tag",
        ));
    };
    Ok(builder)
}

#[allow(unused_mut)]
pub fn deser_structure_verification_exception_xml_err(
    inp: &[u8],
    mut builder: crate::error::verification_exception::Builder,
) -> Result<crate::error::verification_exception::Builder, smithy_xml::decode::XmlError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    use std::convert::TryFrom;
    let mut document = smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Status") /* Status com.amazonaws.sns#VerificationException$Status */ =>  {
                let var_58 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_status(var_58);
            }
            ,
            s if s.matches("Message") /* Message com.amazonaws.sns#VerificationException$Message */ =>  {
                let var_59 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_message(var_59);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}

pub fn deser_map_map_string_to_string(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<
    std::collections::HashMap<std::string::String, std::string::String>,
    smithy_xml::decode::XmlError,
> {
    let mut out = std::collections::HashMap::new();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("entry") => {
                crate::xml_deser::deser_map_map_string_to_string_entry(&mut tag, &mut out)?;
            }
            _ => {}
        }
    }
    Ok(out)
}

pub fn deser_map_subscription_attributes_map(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<
    std::collections::HashMap<std::string::String, std::string::String>,
    smithy_xml::decode::XmlError,
> {
    let mut out = std::collections::HashMap::new();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("entry") => {
                crate::xml_deser::deser_map_subscription_attributes_map_entry(&mut tag, &mut out)?;
            }
            _ => {}
        }
    }
    Ok(out)
}

pub fn deser_map_topic_attributes_map(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<
    std::collections::HashMap<std::string::String, std::string::String>,
    smithy_xml::decode::XmlError,
> {
    let mut out = std::collections::HashMap::new();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("entry") => {
                crate::xml_deser::deser_map_topic_attributes_map_entry(&mut tag, &mut out)?;
            }
            _ => {}
        }
    }
    Ok(out)
}

pub fn deser_list_list_of_endpoints(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<std::vec::Vec<crate::model::Endpoint>, smithy_xml::decode::XmlError> {
    let mut out = std::vec::Vec::new();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("member") /* member com.amazonaws.sns#ListOfEndpoints$member */ =>  {
                out.push(
                    crate::xml_deser::deser_structure_endpoint(&mut tag)
                    ?
                );
            }
            ,
            _ => {}
        }
    }
    Ok(out)
}

pub fn deser_list_phone_number_information_list(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<std::vec::Vec<crate::model::PhoneNumberInformation>, smithy_xml::decode::XmlError> {
    let mut out = std::vec::Vec::new();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("member") /* member com.amazonaws.sns#PhoneNumberInformationList$member */ =>  {
                out.push(
                    crate::xml_deser::deser_structure_phone_number_information(&mut tag)
                    ?
                );
            }
            ,
            _ => {}
        }
    }
    Ok(out)
}

pub fn deser_list_phone_number_list(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<std::vec::Vec<std::string::String>, smithy_xml::decode::XmlError> {
    let mut out = std::vec::Vec::new();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("member") /* member com.amazonaws.sns#PhoneNumberList$member */ =>  {
                out.push(
                    Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                        smithy_xml::decode::try_data(&mut tag)?.as_ref()
                        .into()
                    )
                    ?
                );
            }
            ,
            _ => {}
        }
    }
    Ok(out)
}

pub fn deser_list_list_of_platform_applications(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<std::vec::Vec<crate::model::PlatformApplication>, smithy_xml::decode::XmlError> {
    let mut out = std::vec::Vec::new();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("member") /* member com.amazonaws.sns#ListOfPlatformApplications$member */ =>  {
                out.push(
                    crate::xml_deser::deser_structure_platform_application(&mut tag)
                    ?
                );
            }
            ,
            _ => {}
        }
    }
    Ok(out)
}

pub fn deser_list_sms_sandbox_phone_number_list(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<std::vec::Vec<crate::model::SmsSandboxPhoneNumber>, smithy_xml::decode::XmlError> {
    let mut out = std::vec::Vec::new();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("member") /* member com.amazonaws.sns#SMSSandboxPhoneNumberList$member */ =>  {
                out.push(
                    crate::xml_deser::deser_structure_sms_sandbox_phone_number(&mut tag)
                    ?
                );
            }
            ,
            _ => {}
        }
    }
    Ok(out)
}

pub fn deser_list_subscriptions_list(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<std::vec::Vec<crate::model::Subscription>, smithy_xml::decode::XmlError> {
    let mut out = std::vec::Vec::new();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("member") /* member com.amazonaws.sns#SubscriptionsList$member */ =>  {
                out.push(
                    crate::xml_deser::deser_structure_subscription(&mut tag)
                    ?
                );
            }
            ,
            _ => {}
        }
    }
    Ok(out)
}

pub fn deser_list_tag_list(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<std::vec::Vec<crate::model::Tag>, smithy_xml::decode::XmlError> {
    let mut out = std::vec::Vec::new();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("member") /* member com.amazonaws.sns#TagList$member */ =>  {
                out.push(
                    crate::xml_deser::deser_structure_tag(&mut tag)
                    ?
                );
            }
            ,
            _ => {}
        }
    }
    Ok(out)
}

pub fn deser_list_topics_list(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<std::vec::Vec<crate::model::Topic>, smithy_xml::decode::XmlError> {
    let mut out = std::vec::Vec::new();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("member") /* member com.amazonaws.sns#TopicsList$member */ =>  {
                out.push(
                    crate::xml_deser::deser_structure_topic(&mut tag)
                    ?
                );
            }
            ,
            _ => {}
        }
    }
    Ok(out)
}

pub fn deser_map_map_string_to_string_entry(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
    out: &mut std::collections::HashMap<std::string::String, std::string::String>,
) -> Result<(), smithy_xml::decode::XmlError> {
    let mut k: Option<std::string::String> = None;
    let mut v: Option<std::string::String> = None;
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("key") /* key com.amazonaws.sns#MapStringToString$key */ =>  {
                k = Some(
                    Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                        smithy_xml::decode::try_data(&mut tag)?.as_ref()
                        .into()
                    )
                    ?
                )
            }
            ,
            s if s.matches("value") /* value com.amazonaws.sns#MapStringToString$value */ =>  {
                v = Some(
                    Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                        smithy_xml::decode::try_data(&mut tag)?.as_ref()
                        .into()
                    )
                    ?
                )
            }
            ,
            _ => {}
        }
    }
    let k = k.ok_or_else(|| smithy_xml::decode::XmlError::custom("missing key map entry"))?;
    let v = v.ok_or_else(|| smithy_xml::decode::XmlError::custom("missing value map entry"))?;
    out.insert(k, v);
    Ok(())
}

pub fn deser_map_subscription_attributes_map_entry(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
    out: &mut std::collections::HashMap<std::string::String, std::string::String>,
) -> Result<(), smithy_xml::decode::XmlError> {
    let mut k: Option<std::string::String> = None;
    let mut v: Option<std::string::String> = None;
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("key") /* key com.amazonaws.sns#SubscriptionAttributesMap$key */ =>  {
                k = Some(
                    Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                        smithy_xml::decode::try_data(&mut tag)?.as_ref()
                        .into()
                    )
                    ?
                )
            }
            ,
            s if s.matches("value") /* value com.amazonaws.sns#SubscriptionAttributesMap$value */ =>  {
                v = Some(
                    Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                        smithy_xml::decode::try_data(&mut tag)?.as_ref()
                        .into()
                    )
                    ?
                )
            }
            ,
            _ => {}
        }
    }
    let k = k.ok_or_else(|| smithy_xml::decode::XmlError::custom("missing key map entry"))?;
    let v = v.ok_or_else(|| smithy_xml::decode::XmlError::custom("missing value map entry"))?;
    out.insert(k, v);
    Ok(())
}

pub fn deser_map_topic_attributes_map_entry(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
    out: &mut std::collections::HashMap<std::string::String, std::string::String>,
) -> Result<(), smithy_xml::decode::XmlError> {
    let mut k: Option<std::string::String> = None;
    let mut v: Option<std::string::String> = None;
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("key") /* key com.amazonaws.sns#TopicAttributesMap$key */ =>  {
                k = Some(
                    Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                        smithy_xml::decode::try_data(&mut tag)?.as_ref()
                        .into()
                    )
                    ?
                )
            }
            ,
            s if s.matches("value") /* value com.amazonaws.sns#TopicAttributesMap$value */ =>  {
                v = Some(
                    Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                        smithy_xml::decode::try_data(&mut tag)?.as_ref()
                        .into()
                    )
                    ?
                )
            }
            ,
            _ => {}
        }
    }
    let k = k.ok_or_else(|| smithy_xml::decode::XmlError::custom("missing key map entry"))?;
    let v = v.ok_or_else(|| smithy_xml::decode::XmlError::custom("missing value map entry"))?;
    out.insert(k, v);
    Ok(())
}

pub fn deser_structure_endpoint(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::Endpoint, smithy_xml::decode::XmlError> {
    #[allow(unused_mut)]
    let mut builder = crate::model::Endpoint::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("EndpointArn") /* EndpointArn com.amazonaws.sns#Endpoint$EndpointArn */ =>  {
                let var_60 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_endpoint_arn(var_60);
            }
            ,
            s if s.matches("Attributes") /* Attributes com.amazonaws.sns#Endpoint$Attributes */ =>  {
                let var_61 =
                    Some(
                        crate::xml_deser::deser_map_map_string_to_string(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_attributes(var_61);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}

pub fn deser_structure_phone_number_information(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::PhoneNumberInformation, smithy_xml::decode::XmlError> {
    #[allow(unused_mut)]
    let mut builder = crate::model::PhoneNumberInformation::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("CreatedAt") /* CreatedAt com.amazonaws.sns#PhoneNumberInformation$CreatedAt */ =>  {
                let var_62 =
                    Some(
                        smithy_types::Instant::from_str(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , smithy_types::instant::Format::DateTime
                        )
                        .map_err(|_|smithy_xml::decode::XmlError::custom("expected (timestamp: `com.amazonaws.sns#Timestamp`)"))
                        ?
                    )
                ;
                builder = builder.set_created_at(var_62);
            }
            ,
            s if s.matches("PhoneNumber") /* PhoneNumber com.amazonaws.sns#PhoneNumberInformation$PhoneNumber */ =>  {
                let var_63 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_phone_number(var_63);
            }
            ,
            s if s.matches("Status") /* Status com.amazonaws.sns#PhoneNumberInformation$Status */ =>  {
                let var_64 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_status(var_64);
            }
            ,
            s if s.matches("Iso2CountryCode") /* Iso2CountryCode com.amazonaws.sns#PhoneNumberInformation$Iso2CountryCode */ =>  {
                let var_65 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_iso2_country_code(var_65);
            }
            ,
            s if s.matches("RouteType") /* RouteType com.amazonaws.sns#PhoneNumberInformation$RouteType */ =>  {
                let var_66 =
                    Some(
                        Result::<crate::model::RouteType, smithy_xml::decode::XmlError>::Ok(
                            crate::model::RouteType::from(
                                smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_route_type(var_66);
            }
            ,
            s if s.matches("NumberCapabilities") /* NumberCapabilities com.amazonaws.sns#PhoneNumberInformation$NumberCapabilities */ =>  {
                let var_67 =
                    Some(
                        crate::xml_deser::deser_list_number_capability_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_number_capabilities(var_67);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}

pub fn deser_structure_platform_application(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::PlatformApplication, smithy_xml::decode::XmlError> {
    #[allow(unused_mut)]
    let mut builder = crate::model::PlatformApplication::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("PlatformApplicationArn") /* PlatformApplicationArn com.amazonaws.sns#PlatformApplication$PlatformApplicationArn */ =>  {
                let var_68 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_platform_application_arn(var_68);
            }
            ,
            s if s.matches("Attributes") /* Attributes com.amazonaws.sns#PlatformApplication$Attributes */ =>  {
                let var_69 =
                    Some(
                        crate::xml_deser::deser_map_map_string_to_string(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_attributes(var_69);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}

pub fn deser_structure_sms_sandbox_phone_number(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::SmsSandboxPhoneNumber, smithy_xml::decode::XmlError> {
    #[allow(unused_mut)]
    let mut builder = crate::model::SmsSandboxPhoneNumber::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("PhoneNumber") /* PhoneNumber com.amazonaws.sns#SMSSandboxPhoneNumber$PhoneNumber */ =>  {
                let var_70 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_phone_number(var_70);
            }
            ,
            s if s.matches("Status") /* Status com.amazonaws.sns#SMSSandboxPhoneNumber$Status */ =>  {
                let var_71 =
                    Some(
                        Result::<crate::model::SmsSandboxPhoneNumberVerificationStatus, smithy_xml::decode::XmlError>::Ok(
                            crate::model::SmsSandboxPhoneNumberVerificationStatus::from(
                                smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_status(var_71);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}

pub fn deser_structure_subscription(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::Subscription, smithy_xml::decode::XmlError> {
    #[allow(unused_mut)]
    let mut builder = crate::model::Subscription::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("SubscriptionArn") /* SubscriptionArn com.amazonaws.sns#Subscription$SubscriptionArn */ =>  {
                let var_72 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_subscription_arn(var_72);
            }
            ,
            s if s.matches("Owner") /* Owner com.amazonaws.sns#Subscription$Owner */ =>  {
                let var_73 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_owner(var_73);
            }
            ,
            s if s.matches("Protocol") /* Protocol com.amazonaws.sns#Subscription$Protocol */ =>  {
                let var_74 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_protocol(var_74);
            }
            ,
            s if s.matches("Endpoint") /* Endpoint com.amazonaws.sns#Subscription$Endpoint */ =>  {
                let var_75 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_endpoint(var_75);
            }
            ,
            s if s.matches("TopicArn") /* TopicArn com.amazonaws.sns#Subscription$TopicArn */ =>  {
                let var_76 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_topic_arn(var_76);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}

pub fn deser_structure_tag(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::Tag, smithy_xml::decode::XmlError> {
    #[allow(unused_mut)]
    let mut builder = crate::model::Tag::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Key") /* Key com.amazonaws.sns#Tag$Key */ =>  {
                let var_77 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_key(var_77);
            }
            ,
            s if s.matches("Value") /* Value com.amazonaws.sns#Tag$Value */ =>  {
                let var_78 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_value(var_78);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}

pub fn deser_structure_topic(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::Topic, smithy_xml::decode::XmlError> {
    #[allow(unused_mut)]
    let mut builder = crate::model::Topic::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("TopicArn") /* TopicArn com.amazonaws.sns#Topic$TopicArn */ =>  {
                let var_79 =
                    Some(
                        Result::<std::string::String, smithy_xml::decode::XmlError>::Ok(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_topic_arn(var_79);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}

pub fn deser_list_number_capability_list(
    decoder: &mut smithy_xml::decode::ScopedDecoder,
) -> Result<std::vec::Vec<crate::model::NumberCapability>, smithy_xml::decode::XmlError> {
    let mut out = std::vec::Vec::new();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("member") /* member com.amazonaws.sns#NumberCapabilityList$member */ =>  {
                out.push(
                    Result::<crate::model::NumberCapability, smithy_xml::decode::XmlError>::Ok(
                        crate::model::NumberCapability::from(
                            smithy_xml::decode::try_data(&mut tag)?.as_ref()
                        )
                    )
                    ?
                );
            }
            ,
            _ => {}
        }
    }
    Ok(out)
}
