aws_sdk_elasticache/protocol_serde/
shape_global_replication_group.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_global_replication_group(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::GlobalReplicationGroup, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::GlobalReplicationGroup::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("GlobalReplicationGroupId") /* GlobalReplicationGroupId com.amazonaws.elasticache#GlobalReplicationGroup$GlobalReplicationGroupId */ =>  {
11                let var_1 =
12                    Some(
13                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
14                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
15                            .into()
16                        )
17                        ?
18                    )
19                ;
20                builder = builder.set_global_replication_group_id(var_1);
21            }
22            ,
23            s if s.matches("GlobalReplicationGroupDescription") /* GlobalReplicationGroupDescription com.amazonaws.elasticache#GlobalReplicationGroup$GlobalReplicationGroupDescription */ =>  {
24                let var_2 =
25                    Some(
26                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
27                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
28                            .into()
29                        )
30                        ?
31                    )
32                ;
33                builder = builder.set_global_replication_group_description(var_2);
34            }
35            ,
36            s if s.matches("Status") /* Status com.amazonaws.elasticache#GlobalReplicationGroup$Status */ =>  {
37                let var_3 =
38                    Some(
39                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
40                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
41                            .into()
42                        )
43                        ?
44                    )
45                ;
46                builder = builder.set_status(var_3);
47            }
48            ,
49            s if s.matches("CacheNodeType") /* CacheNodeType com.amazonaws.elasticache#GlobalReplicationGroup$CacheNodeType */ =>  {
50                let var_4 =
51                    Some(
52                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
53                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
54                            .into()
55                        )
56                        ?
57                    )
58                ;
59                builder = builder.set_cache_node_type(var_4);
60            }
61            ,
62            s if s.matches("Engine") /* Engine com.amazonaws.elasticache#GlobalReplicationGroup$Engine */ =>  {
63                let var_5 =
64                    Some(
65                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
66                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
67                            .into()
68                        )
69                        ?
70                    )
71                ;
72                builder = builder.set_engine(var_5);
73            }
74            ,
75            s if s.matches("EngineVersion") /* EngineVersion com.amazonaws.elasticache#GlobalReplicationGroup$EngineVersion */ =>  {
76                let var_6 =
77                    Some(
78                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
79                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
80                            .into()
81                        )
82                        ?
83                    )
84                ;
85                builder = builder.set_engine_version(var_6);
86            }
87            ,
88            s if s.matches("Members") /* Members com.amazonaws.elasticache#GlobalReplicationGroup$Members */ =>  {
89                let var_7 =
90                    Some(
91                        crate::protocol_serde::shape_global_replication_group_member_list::de_global_replication_group_member_list(&mut tag)
92                        ?
93                    )
94                ;
95                builder = builder.set_members(var_7);
96            }
97            ,
98            s if s.matches("ClusterEnabled") /* ClusterEnabled com.amazonaws.elasticache#GlobalReplicationGroup$ClusterEnabled */ =>  {
99                let var_8 =
100                    Some(
101                         {
102                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
103                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
104                            )
105                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.elasticache#BooleanOptional`)"))
106                        }
107                        ?
108                    )
109                ;
110                builder = builder.set_cluster_enabled(var_8);
111            }
112            ,
113            s if s.matches("GlobalNodeGroups") /* GlobalNodeGroups com.amazonaws.elasticache#GlobalReplicationGroup$GlobalNodeGroups */ =>  {
114                let var_9 =
115                    Some(
116                        crate::protocol_serde::shape_global_node_group_list::de_global_node_group_list(&mut tag)
117                        ?
118                    )
119                ;
120                builder = builder.set_global_node_groups(var_9);
121            }
122            ,
123            s if s.matches("AuthTokenEnabled") /* AuthTokenEnabled com.amazonaws.elasticache#GlobalReplicationGroup$AuthTokenEnabled */ =>  {
124                let var_10 =
125                    Some(
126                         {
127                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
128                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
129                            )
130                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.elasticache#BooleanOptional`)"))
131                        }
132                        ?
133                    )
134                ;
135                builder = builder.set_auth_token_enabled(var_10);
136            }
137            ,
138            s if s.matches("TransitEncryptionEnabled") /* TransitEncryptionEnabled com.amazonaws.elasticache#GlobalReplicationGroup$TransitEncryptionEnabled */ =>  {
139                let var_11 =
140                    Some(
141                         {
142                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
143                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
144                            )
145                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.elasticache#BooleanOptional`)"))
146                        }
147                        ?
148                    )
149                ;
150                builder = builder.set_transit_encryption_enabled(var_11);
151            }
152            ,
153            s if s.matches("AtRestEncryptionEnabled") /* AtRestEncryptionEnabled com.amazonaws.elasticache#GlobalReplicationGroup$AtRestEncryptionEnabled */ =>  {
154                let var_12 =
155                    Some(
156                         {
157                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
158                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
159                            )
160                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.elasticache#BooleanOptional`)"))
161                        }
162                        ?
163                    )
164                ;
165                builder = builder.set_at_rest_encryption_enabled(var_12);
166            }
167            ,
168            s if s.matches("ARN") /* ARN com.amazonaws.elasticache#GlobalReplicationGroup$ARN */ =>  {
169                let var_13 =
170                    Some(
171                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
172                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
173                            .into()
174                        )
175                        ?
176                    )
177                ;
178                builder = builder.set_arn(var_13);
179            }
180            ,
181            _ => {}
182        }
183    }
184    Ok(builder.build())
185}