aws-sdk-cloudfront 1.115.0

AWS SDK for Amazon CloudFront
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_realtime_log_config(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::RealtimeLogConfig, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::RealtimeLogConfig::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("ARN") /* ARN com.amazonaws.cloudfront#RealtimeLogConfig$ARN */ =>  {
                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_arn(var_1);
            }
            ,
            s if s.matches("Name") /* Name com.amazonaws.cloudfront#RealtimeLogConfig$Name */ =>  {
                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_name(var_2);
            }
            ,
            s if s.matches("SamplingRate") /* SamplingRate com.amazonaws.cloudfront#RealtimeLogConfig$SamplingRate */ =>  {
                let var_3 =
                    Some(
                         {
                            <i64 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 (long: `com.amazonaws.cloudfront#long`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_sampling_rate(var_3);
            }
            ,
            s if s.matches("EndPoints") /* EndPoints com.amazonaws.cloudfront#RealtimeLogConfig$EndPoints */ =>  {
                let var_4 =
                    Some(
                        crate::protocol_serde::shape_end_point_list::de_end_point_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_end_points(var_4);
            }
            ,
            s if s.matches("Fields") /* Fields com.amazonaws.cloudfront#RealtimeLogConfig$Fields */ =>  {
                let var_5 =
                    Some(
                        crate::protocol_serde::shape_field_list::de_field_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_fields(var_5);
            }
            ,
            _ => {}
        }
    }
    Ok(crate::serde_util::realtime_log_config_correct_errors(builder)
        .build()
        .map_err(|_| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing field"))?)
}