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_connection_group(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::ConnectionGroup, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::ConnectionGroup::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Id") /* Id com.amazonaws.cloudfront#ConnectionGroup$Id */ =>  {
                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_id(var_1);
            }
            ,
            s if s.matches("Name") /* Name com.amazonaws.cloudfront#ConnectionGroup$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("Arn") /* Arn com.amazonaws.cloudfront#ConnectionGroup$Arn */ =>  {
                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_arn(var_3);
            }
            ,
            s if s.matches("CreatedTime") /* CreatedTime com.amazonaws.cloudfront#ConnectionGroup$CreatedTime */ =>  {
                let var_4 =
                    Some(
                        ::aws_smithy_types::DateTime::from_str(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
                        )
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.cloudfront#timestamp`)"))
                        ?
                    )
                ;
                builder = builder.set_created_time(var_4);
            }
            ,
            s if s.matches("LastModifiedTime") /* LastModifiedTime com.amazonaws.cloudfront#ConnectionGroup$LastModifiedTime */ =>  {
                let var_5 =
                    Some(
                        ::aws_smithy_types::DateTime::from_str(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
                        )
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.cloudfront#timestamp`)"))
                        ?
                    )
                ;
                builder = builder.set_last_modified_time(var_5);
            }
            ,
            s if s.matches("Tags") /* Tags com.amazonaws.cloudfront#ConnectionGroup$Tags */ =>  {
                let var_6 =
                    Some(
                        crate::protocol_serde::shape_tags::de_tags(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_tags(var_6);
            }
            ,
            s if s.matches("Ipv6Enabled") /* Ipv6Enabled com.amazonaws.cloudfront#ConnectionGroup$Ipv6Enabled */ =>  {
                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.cloudfront#boolean`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_ipv6_enabled(var_7);
            }
            ,
            s if s.matches("RoutingEndpoint") /* RoutingEndpoint com.amazonaws.cloudfront#ConnectionGroup$RoutingEndpoint */ =>  {
                let var_8 =
                    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_routing_endpoint(var_8);
            }
            ,
            s if s.matches("AnycastIpListId") /* AnycastIpListId com.amazonaws.cloudfront#ConnectionGroup$AnycastIpListId */ =>  {
                let var_9 =
                    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_anycast_ip_list_id(var_9);
            }
            ,
            s if s.matches("Status") /* Status com.amazonaws.cloudfront#ConnectionGroup$Status */ =>  {
                let var_10 =
                    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_status(var_10);
            }
            ,
            s if s.matches("Enabled") /* Enabled com.amazonaws.cloudfront#ConnectionGroup$Enabled */ =>  {
                let var_11 =
                    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.cloudfront#boolean`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_enabled(var_11);
            }
            ,
            s if s.matches("IsDefault") /* IsDefault com.amazonaws.cloudfront#ConnectionGroup$IsDefault */ =>  {
                let var_12 =
                    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.cloudfront#boolean`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_is_default(var_12);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}