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.
pub fn ser_restrictions(
    input: &crate::types::Restrictions,
    writer: ::aws_smithy_xml::encode::ElWriter,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_1) = &input.geo_restriction {
        let inner_writer = scope.start_el("GeoRestriction");
        crate::protocol_serde::shape_geo_restriction::ser_geo_restriction(var_1, inner_writer)?
    }
    scope.finish();
    Ok(())
}

#[allow(clippy::needless_question_mark)]
pub fn de_restrictions(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::Restrictions, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::Restrictions::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("GeoRestriction") /* GeoRestriction com.amazonaws.cloudfront#Restrictions$GeoRestriction */ =>  {
                let var_2 =
                    Some(
                        crate::protocol_serde::shape_geo_restriction::de_geo_restriction(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_geo_restriction(var_2);
            }
            ,
            _ => {}
        }
    }
    Ok(crate::serde_util::restrictions_correct_errors(builder).build())
}