aws-sdk-elasticache 1.110.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_serverless_cache_snapshot(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    depth: u32,
) -> ::std::result::Result<crate::types::ServerlessCacheSnapshot, ::aws_smithy_xml::decode::XmlDecodeError> {
    if depth >= 128u32 {
        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("maximum nesting depth exceeded"));
    }
    #[allow(unused_mut)]
    let mut builder = crate::types::ServerlessCacheSnapshot::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("ServerlessCacheSnapshotName") /* ServerlessCacheSnapshotName com.amazonaws.elasticache#ServerlessCacheSnapshot$ServerlessCacheSnapshotName */ =>  {
                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_serverless_cache_snapshot_name(var_1);
            }
            ,
            s if s.matches("ARN") /* ARN com.amazonaws.elasticache#ServerlessCacheSnapshot$ARN */ =>  {
                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_arn(var_2);
            }
            ,
            s if s.matches("KmsKeyId") /* KmsKeyId com.amazonaws.elasticache#ServerlessCacheSnapshot$KmsKeyId */ =>  {
                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_kms_key_id(var_3);
            }
            ,
            s if s.matches("SnapshotType") /* SnapshotType com.amazonaws.elasticache#ServerlessCacheSnapshot$SnapshotType */ =>  {
                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_snapshot_type(var_4);
            }
            ,
            s if s.matches("Status") /* Status com.amazonaws.elasticache#ServerlessCacheSnapshot$Status */ =>  {
                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_status(var_5);
            }
            ,
            s if s.matches("CreateTime") /* CreateTime com.amazonaws.elasticache#ServerlessCacheSnapshot$CreateTime */ =>  {
                let var_6 =
                    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.elasticache#TStamp`)"))
                        ?
                    )
                ;
                builder = builder.set_create_time(var_6);
            }
            ,
            s if s.matches("ExpiryTime") /* ExpiryTime com.amazonaws.elasticache#ServerlessCacheSnapshot$ExpiryTime */ =>  {
                let var_7 =
                    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.elasticache#TStamp`)"))
                        ?
                    )
                ;
                builder = builder.set_expiry_time(var_7);
            }
            ,
            s if s.matches("BytesUsedForCache") /* BytesUsedForCache com.amazonaws.elasticache#ServerlessCacheSnapshot$BytesUsedForCache */ =>  {
                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_bytes_used_for_cache(var_8);
            }
            ,
            s if s.matches("ServerlessCacheConfiguration") /* ServerlessCacheConfiguration com.amazonaws.elasticache#ServerlessCacheSnapshot$ServerlessCacheConfiguration */ =>  {
                let var_9 =
                    Some(
                        crate::protocol_serde::shape_serverless_cache_configuration::de_serverless_cache_configuration(&mut tag, depth + 1)
                        ?
                    )
                ;
                builder = builder.set_serverless_cache_configuration(var_9);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}