aws_sdk_rds/protocol_serde/
shape_scaling_configuration_info.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_scaling_configuration_info(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::ScalingConfigurationInfo, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::ScalingConfigurationInfo::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("MinCapacity") /* MinCapacity com.amazonaws.rds#ScalingConfigurationInfo$MinCapacity */ =>  {
11                let var_1 =
12                    Some(
13                         {
14                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
15                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
16                            )
17                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.rds#IntegerOptional`)"))
18                        }
19                        ?
20                    )
21                ;
22                builder = builder.set_min_capacity(var_1);
23            }
24            ,
25            s if s.matches("MaxCapacity") /* MaxCapacity com.amazonaws.rds#ScalingConfigurationInfo$MaxCapacity */ =>  {
26                let var_2 =
27                    Some(
28                         {
29                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
30                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
31                            )
32                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.rds#IntegerOptional`)"))
33                        }
34                        ?
35                    )
36                ;
37                builder = builder.set_max_capacity(var_2);
38            }
39            ,
40            s if s.matches("AutoPause") /* AutoPause com.amazonaws.rds#ScalingConfigurationInfo$AutoPause */ =>  {
41                let var_3 =
42                    Some(
43                         {
44                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
45                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
46                            )
47                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.rds#BooleanOptional`)"))
48                        }
49                        ?
50                    )
51                ;
52                builder = builder.set_auto_pause(var_3);
53            }
54            ,
55            s if s.matches("SecondsUntilAutoPause") /* SecondsUntilAutoPause com.amazonaws.rds#ScalingConfigurationInfo$SecondsUntilAutoPause */ =>  {
56                let var_4 =
57                    Some(
58                         {
59                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
60                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
61                            )
62                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.rds#IntegerOptional`)"))
63                        }
64                        ?
65                    )
66                ;
67                builder = builder.set_seconds_until_auto_pause(var_4);
68            }
69            ,
70            s if s.matches("TimeoutAction") /* TimeoutAction com.amazonaws.rds#ScalingConfigurationInfo$TimeoutAction */ =>  {
71                let var_5 =
72                    Some(
73                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
74                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
75                            .into()
76                        )
77                        ?
78                    )
79                ;
80                builder = builder.set_timeout_action(var_5);
81            }
82            ,
83            s if s.matches("SecondsBeforeTimeout") /* SecondsBeforeTimeout com.amazonaws.rds#ScalingConfigurationInfo$SecondsBeforeTimeout */ =>  {
84                let var_6 =
85                    Some(
86                         {
87                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
88                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
89                            )
90                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.rds#IntegerOptional`)"))
91                        }
92                        ?
93                    )
94                ;
95                builder = builder.set_seconds_before_timeout(var_6);
96            }
97            ,
98            _ => {}
99        }
100    }
101    Ok(builder.build())
102}