aws-sdk-elasticache 1.98.0

AWS SDK for Amazon ElastiCache
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_global_replication_group(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::GlobalReplicationGroup, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::GlobalReplicationGroup::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("GlobalReplicationGroupId") /* GlobalReplicationGroupId com.amazonaws.elasticache#GlobalReplicationGroup$GlobalReplicationGroupId */ =>  {
                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_global_replication_group_id(var_1);
            }
            ,
            s if s.matches("GlobalReplicationGroupDescription") /* GlobalReplicationGroupDescription com.amazonaws.elasticache#GlobalReplicationGroup$GlobalReplicationGroupDescription */ =>  {
                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_global_replication_group_description(var_2);
            }
            ,
            s if s.matches("Status") /* Status com.amazonaws.elasticache#GlobalReplicationGroup$Status */ =>  {
                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_status(var_3);
            }
            ,
            s if s.matches("CacheNodeType") /* CacheNodeType com.amazonaws.elasticache#GlobalReplicationGroup$CacheNodeType */ =>  {
                let var_4 =
                    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_cache_node_type(var_4);
            }
            ,
            s if s.matches("Engine") /* Engine com.amazonaws.elasticache#GlobalReplicationGroup$Engine */ =>  {
                let var_5 =
                    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_engine(var_5);
            }
            ,
            s if s.matches("EngineVersion") /* EngineVersion com.amazonaws.elasticache#GlobalReplicationGroup$EngineVersion */ =>  {
                let var_6 =
                    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_engine_version(var_6);
            }
            ,
            s if s.matches("Members") /* Members com.amazonaws.elasticache#GlobalReplicationGroup$Members */ =>  {
                let var_7 =
                    Some(
                        crate::protocol_serde::shape_global_replication_group_member_list::de_global_replication_group_member_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_members(var_7);
            }
            ,
            s if s.matches("ClusterEnabled") /* ClusterEnabled com.amazonaws.elasticache#GlobalReplicationGroup$ClusterEnabled */ =>  {
                let var_8 =
                    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.elasticache#BooleanOptional`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_cluster_enabled(var_8);
            }
            ,
            s if s.matches("GlobalNodeGroups") /* GlobalNodeGroups com.amazonaws.elasticache#GlobalReplicationGroup$GlobalNodeGroups */ =>  {
                let var_9 =
                    Some(
                        crate::protocol_serde::shape_global_node_group_list::de_global_node_group_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_global_node_groups(var_9);
            }
            ,
            s if s.matches("AuthTokenEnabled") /* AuthTokenEnabled com.amazonaws.elasticache#GlobalReplicationGroup$AuthTokenEnabled */ =>  {
                let var_10 =
                    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.elasticache#BooleanOptional`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_auth_token_enabled(var_10);
            }
            ,
            s if s.matches("TransitEncryptionEnabled") /* TransitEncryptionEnabled com.amazonaws.elasticache#GlobalReplicationGroup$TransitEncryptionEnabled */ =>  {
                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.elasticache#BooleanOptional`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_transit_encryption_enabled(var_11);
            }
            ,
            s if s.matches("AtRestEncryptionEnabled") /* AtRestEncryptionEnabled com.amazonaws.elasticache#GlobalReplicationGroup$AtRestEncryptionEnabled */ =>  {
                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.elasticache#BooleanOptional`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_at_rest_encryption_enabled(var_12);
            }
            ,
            s if s.matches("ARN") /* ARN com.amazonaws.elasticache#GlobalReplicationGroup$ARN */ =>  {
                let var_13 =
                    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_13);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}