aws-sdk-ses 1.95.0

AWS SDK for Amazon Simple Email Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_identity_notification_attributes(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::IdentityNotificationAttributes, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::IdentityNotificationAttributes::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("BounceTopic") /* BounceTopic com.amazonaws.ses#IdentityNotificationAttributes$BounceTopic */ =>  {
                let var_1 =
                    Some(
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_bounce_topic(var_1);
            }
            ,
            s if s.matches("ComplaintTopic") /* ComplaintTopic com.amazonaws.ses#IdentityNotificationAttributes$ComplaintTopic */ =>  {
                let var_2 =
                    Some(
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_complaint_topic(var_2);
            }
            ,
            s if s.matches("DeliveryTopic") /* DeliveryTopic com.amazonaws.ses#IdentityNotificationAttributes$DeliveryTopic */ =>  {
                let var_3 =
                    Some(
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_delivery_topic(var_3);
            }
            ,
            s if s.matches("ForwardingEnabled") /* ForwardingEnabled com.amazonaws.ses#IdentityNotificationAttributes$ForwardingEnabled */ =>  {
                let var_4 =
                    Some(
                         {
                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ses#Enabled`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_forwarding_enabled(var_4);
            }
            ,
            s if s.matches("HeadersInBounceNotificationsEnabled") /* HeadersInBounceNotificationsEnabled com.amazonaws.ses#IdentityNotificationAttributes$HeadersInBounceNotificationsEnabled */ =>  {
                let var_5 =
                    Some(
                         {
                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ses#Enabled`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_headers_in_bounce_notifications_enabled(var_5);
            }
            ,
            s if s.matches("HeadersInComplaintNotificationsEnabled") /* HeadersInComplaintNotificationsEnabled com.amazonaws.ses#IdentityNotificationAttributes$HeadersInComplaintNotificationsEnabled */ =>  {
                let var_6 =
                    Some(
                         {
                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ses#Enabled`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_headers_in_complaint_notifications_enabled(var_6);
            }
            ,
            s if s.matches("HeadersInDeliveryNotificationsEnabled") /* HeadersInDeliveryNotificationsEnabled com.amazonaws.ses#IdentityNotificationAttributes$HeadersInDeliveryNotificationsEnabled */ =>  {
                let var_7 =
                    Some(
                         {
                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ses#Enabled`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_headers_in_delivery_notifications_enabled(var_7);
            }
            ,
            _ => {}
        }
    }
    Ok(crate::serde_util::identity_notification_attributes_correct_errors(builder)
        .build()
        .map_err(|_| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing field"))?)
}