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_cache_policy_summary(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::CachePolicySummary, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::CachePolicySummary::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Type") /* Type com.amazonaws.cloudfront#CachePolicySummary$Type */ =>  {
                let var_1 =
                    Some(
                        Result::<crate::types::CachePolicyType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::CachePolicyType::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_type(var_1);
            }
            ,
            s if s.matches("CachePolicy") /* CachePolicy com.amazonaws.cloudfront#CachePolicySummary$CachePolicy */ =>  {
                let var_2 =
                    Some(
                        crate::protocol_serde::shape_cache_policy::de_cache_policy(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_cache_policy(var_2);
            }
            ,
            _ => {}
        }
    }
    Ok(crate::serde_util::cache_policy_summary_correct_errors(builder)
        .build()
        .map_err(|_| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing field"))?)
}