aws_sdk_redshift/protocol_serde/
shape_data_transfer_progress.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_data_transfer_progress(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::DataTransferProgress, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::DataTransferProgress::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("Status") /* Status com.amazonaws.redshift#DataTransferProgress$Status */ =>  {
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_status(var_1);
21            }
22            ,
23            s if s.matches("CurrentRateInMegaBytesPerSecond") /* CurrentRateInMegaBytesPerSecond com.amazonaws.redshift#DataTransferProgress$CurrentRateInMegaBytesPerSecond */ =>  {
24                let var_2 =
25                    Some(
26                         {
27                            <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
28                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
29                            )
30                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (double: `com.amazonaws.redshift#DoubleOptional`)"))
31                        }
32                        ?
33                    )
34                ;
35                builder = builder.set_current_rate_in_mega_bytes_per_second(var_2);
36            }
37            ,
38            s if s.matches("TotalDataInMegaBytes") /* TotalDataInMegaBytes com.amazonaws.redshift#DataTransferProgress$TotalDataInMegaBytes */ =>  {
39                let var_3 =
40                    Some(
41                         {
42                            <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
43                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
44                            )
45                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `com.amazonaws.redshift#Long`)"))
46                        }
47                        ?
48                    )
49                ;
50                builder = builder.set_total_data_in_mega_bytes(var_3);
51            }
52            ,
53            s if s.matches("DataTransferredInMegaBytes") /* DataTransferredInMegaBytes com.amazonaws.redshift#DataTransferProgress$DataTransferredInMegaBytes */ =>  {
54                let var_4 =
55                    Some(
56                         {
57                            <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
58                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
59                            )
60                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `com.amazonaws.redshift#Long`)"))
61                        }
62                        ?
63                    )
64                ;
65                builder = builder.set_data_transferred_in_mega_bytes(var_4);
66            }
67            ,
68            s if s.matches("EstimatedTimeToCompletionInSeconds") /* EstimatedTimeToCompletionInSeconds com.amazonaws.redshift#DataTransferProgress$EstimatedTimeToCompletionInSeconds */ =>  {
69                let var_5 =
70                    Some(
71                         {
72                            <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
73                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
74                            )
75                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `com.amazonaws.redshift#LongOptional`)"))
76                        }
77                        ?
78                    )
79                ;
80                builder = builder.set_estimated_time_to_completion_in_seconds(var_5);
81            }
82            ,
83            s if s.matches("ElapsedTimeInSeconds") /* ElapsedTimeInSeconds com.amazonaws.redshift#DataTransferProgress$ElapsedTimeInSeconds */ =>  {
84                let var_6 =
85                    Some(
86                         {
87                            <i64 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 (long: `com.amazonaws.redshift#LongOptional`)"))
91                        }
92                        ?
93                    )
94                ;
95                builder = builder.set_elapsed_time_in_seconds(var_6);
96            }
97            ,
98            _ => {}
99        }
100    }
101    Ok(builder.build())
102}