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_update_action(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    depth: u32,
) -> ::std::result::Result<crate::types::UpdateAction, ::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::UpdateAction::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("ReplicationGroupId") /* ReplicationGroupId com.amazonaws.elasticache#UpdateAction$ReplicationGroupId */ =>  {
                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_replication_group_id(var_1);
            }
            ,
            s if s.matches("CacheClusterId") /* CacheClusterId com.amazonaws.elasticache#UpdateAction$CacheClusterId */ =>  {
                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_cache_cluster_id(var_2);
            }
            ,
            s if s.matches("ServiceUpdateName") /* ServiceUpdateName com.amazonaws.elasticache#UpdateAction$ServiceUpdateName */ =>  {
                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_service_update_name(var_3);
            }
            ,
            s if s.matches("ServiceUpdateReleaseDate") /* ServiceUpdateReleaseDate com.amazonaws.elasticache#UpdateAction$ServiceUpdateReleaseDate */ =>  {
                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.elasticache#TStamp`)"))
                        ?
                    )
                ;
                builder = builder.set_service_update_release_date(var_4);
            }
            ,
            s if s.matches("ServiceUpdateSeverity") /* ServiceUpdateSeverity com.amazonaws.elasticache#UpdateAction$ServiceUpdateSeverity */ =>  {
                let var_5 =
                    Some(
                        Result::<crate::types::ServiceUpdateSeverity, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::ServiceUpdateSeverity::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_service_update_severity(var_5);
            }
            ,
            s if s.matches("ServiceUpdateStatus") /* ServiceUpdateStatus com.amazonaws.elasticache#UpdateAction$ServiceUpdateStatus */ =>  {
                let var_6 =
                    Some(
                        Result::<crate::types::ServiceUpdateStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::ServiceUpdateStatus::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_service_update_status(var_6);
            }
            ,
            s if s.matches("ServiceUpdateRecommendedApplyByDate") /* ServiceUpdateRecommendedApplyByDate com.amazonaws.elasticache#UpdateAction$ServiceUpdateRecommendedApplyByDate */ =>  {
                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_service_update_recommended_apply_by_date(var_7);
            }
            ,
            s if s.matches("ServiceUpdateType") /* ServiceUpdateType com.amazonaws.elasticache#UpdateAction$ServiceUpdateType */ =>  {
                let var_8 =
                    Some(
                        Result::<crate::types::ServiceUpdateType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::ServiceUpdateType::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_service_update_type(var_8);
            }
            ,
            s if s.matches("UpdateActionAvailableDate") /* UpdateActionAvailableDate com.amazonaws.elasticache#UpdateAction$UpdateActionAvailableDate */ =>  {
                let var_9 =
                    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_update_action_available_date(var_9);
            }
            ,
            s if s.matches("UpdateActionStatus") /* UpdateActionStatus com.amazonaws.elasticache#UpdateAction$UpdateActionStatus */ =>  {
                let var_10 =
                    Some(
                        Result::<crate::types::UpdateActionStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::UpdateActionStatus::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_update_action_status(var_10);
            }
            ,
            s if s.matches("NodesUpdated") /* NodesUpdated com.amazonaws.elasticache#UpdateAction$NodesUpdated */ =>  {
                let var_11 =
                    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_nodes_updated(var_11);
            }
            ,
            s if s.matches("UpdateActionStatusModifiedDate") /* UpdateActionStatusModifiedDate com.amazonaws.elasticache#UpdateAction$UpdateActionStatusModifiedDate */ =>  {
                let var_12 =
                    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_update_action_status_modified_date(var_12);
            }
            ,
            s if s.matches("SlaMet") /* SlaMet com.amazonaws.elasticache#UpdateAction$SlaMet */ =>  {
                let var_13 =
                    Some(
                        Result::<crate::types::SlaMet, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::SlaMet::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_sla_met(var_13);
            }
            ,
            s if s.matches("NodeGroupUpdateStatus") /* NodeGroupUpdateStatus com.amazonaws.elasticache#UpdateAction$NodeGroupUpdateStatus */ =>  {
                let var_14 =
                    Some(
                        crate::protocol_serde::shape_node_group_update_status_list::de_node_group_update_status_list(&mut tag, depth + 1)
                        ?
                    )
                ;
                builder = builder.set_node_group_update_status(var_14);
            }
            ,
            s if s.matches("CacheNodeUpdateStatus") /* CacheNodeUpdateStatus com.amazonaws.elasticache#UpdateAction$CacheNodeUpdateStatus */ =>  {
                let var_15 =
                    Some(
                        crate::protocol_serde::shape_cache_node_update_status_list::de_cache_node_update_status_list(&mut tag, depth + 1)
                        ?
                    )
                ;
                builder = builder.set_cache_node_update_status(var_15);
            }
            ,
            s if s.matches("EstimatedUpdateTime") /* EstimatedUpdateTime com.amazonaws.elasticache#UpdateAction$EstimatedUpdateTime */ =>  {
                let var_16 =
                    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_estimated_update_time(var_16);
            }
            ,
            s if s.matches("Engine") /* Engine com.amazonaws.elasticache#UpdateAction$Engine */ =>  {
                let var_17 =
                    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_17);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}