aws_sdk_ec2/protocol_serde/
shape_network_insights_analysis.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_network_insights_analysis(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::NetworkInsightsAnalysis, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::NetworkInsightsAnalysis::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("networkInsightsAnalysisId") /* NetworkInsightsAnalysisId com.amazonaws.ec2#NetworkInsightsAnalysis$NetworkInsightsAnalysisId */ =>  {
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_network_insights_analysis_id(var_1);
21            }
22            ,
23            s if s.matches("networkInsightsAnalysisArn") /* NetworkInsightsAnalysisArn com.amazonaws.ec2#NetworkInsightsAnalysis$NetworkInsightsAnalysisArn */ =>  {
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_network_insights_analysis_arn(var_2);
34            }
35            ,
36            s if s.matches("networkInsightsPathId") /* NetworkInsightsPathId com.amazonaws.ec2#NetworkInsightsAnalysis$NetworkInsightsPathId */ =>  {
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_network_insights_path_id(var_3);
47            }
48            ,
49            s if s.matches("additionalAccountSet") /* AdditionalAccounts com.amazonaws.ec2#NetworkInsightsAnalysis$AdditionalAccounts */ =>  {
50                let var_4 =
51                    Some(
52                        crate::protocol_serde::shape_value_string_list::de_value_string_list(&mut tag)
53                        ?
54                    )
55                ;
56                builder = builder.set_additional_accounts(var_4);
57            }
58            ,
59            s if s.matches("filterInArnSet") /* FilterInArns com.amazonaws.ec2#NetworkInsightsAnalysis$FilterInArns */ =>  {
60                let var_5 =
61                    Some(
62                        crate::protocol_serde::shape_arn_list::de_arn_list(&mut tag)
63                        ?
64                    )
65                ;
66                builder = builder.set_filter_in_arns(var_5);
67            }
68            ,
69            s if s.matches("filterOutArnSet") /* FilterOutArns com.amazonaws.ec2#NetworkInsightsAnalysis$FilterOutArns */ =>  {
70                let var_6 =
71                    Some(
72                        crate::protocol_serde::shape_arn_list::de_arn_list(&mut tag)
73                        ?
74                    )
75                ;
76                builder = builder.set_filter_out_arns(var_6);
77            }
78            ,
79            s if s.matches("startDate") /* StartDate com.amazonaws.ec2#NetworkInsightsAnalysis$StartDate */ =>  {
80                let var_7 =
81                    Some(
82                        ::aws_smithy_types::DateTime::from_str(
83                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
84                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
85                        )
86                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
87                        ?
88                    )
89                ;
90                builder = builder.set_start_date(var_7);
91            }
92            ,
93            s if s.matches("status") /* Status com.amazonaws.ec2#NetworkInsightsAnalysis$Status */ =>  {
94                let var_8 =
95                    Some(
96                        Result::<crate::types::AnalysisStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
97                            crate::types::AnalysisStatus::from(
98                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
99                            )
100                        )
101                        ?
102                    )
103                ;
104                builder = builder.set_status(var_8);
105            }
106            ,
107            s if s.matches("statusMessage") /* StatusMessage com.amazonaws.ec2#NetworkInsightsAnalysis$StatusMessage */ =>  {
108                let var_9 =
109                    Some(
110                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
111                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
112                            .into()
113                        )
114                        ?
115                    )
116                ;
117                builder = builder.set_status_message(var_9);
118            }
119            ,
120            s if s.matches("warningMessage") /* WarningMessage com.amazonaws.ec2#NetworkInsightsAnalysis$WarningMessage */ =>  {
121                let var_10 =
122                    Some(
123                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
124                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
125                            .into()
126                        )
127                        ?
128                    )
129                ;
130                builder = builder.set_warning_message(var_10);
131            }
132            ,
133            s if s.matches("networkPathFound") /* NetworkPathFound com.amazonaws.ec2#NetworkInsightsAnalysis$NetworkPathFound */ =>  {
134                let var_11 =
135                    Some(
136                         {
137                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
138                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
139                            )
140                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
141                        }
142                        ?
143                    )
144                ;
145                builder = builder.set_network_path_found(var_11);
146            }
147            ,
148            s if s.matches("forwardPathComponentSet") /* ForwardPathComponents com.amazonaws.ec2#NetworkInsightsAnalysis$ForwardPathComponents */ =>  {
149                let var_12 =
150                    Some(
151                        crate::protocol_serde::shape_path_component_list::de_path_component_list(&mut tag)
152                        ?
153                    )
154                ;
155                builder = builder.set_forward_path_components(var_12);
156            }
157            ,
158            s if s.matches("returnPathComponentSet") /* ReturnPathComponents com.amazonaws.ec2#NetworkInsightsAnalysis$ReturnPathComponents */ =>  {
159                let var_13 =
160                    Some(
161                        crate::protocol_serde::shape_path_component_list::de_path_component_list(&mut tag)
162                        ?
163                    )
164                ;
165                builder = builder.set_return_path_components(var_13);
166            }
167            ,
168            s if s.matches("explanationSet") /* Explanations com.amazonaws.ec2#NetworkInsightsAnalysis$Explanations */ =>  {
169                let var_14 =
170                    Some(
171                        crate::protocol_serde::shape_explanation_list::de_explanation_list(&mut tag)
172                        ?
173                    )
174                ;
175                builder = builder.set_explanations(var_14);
176            }
177            ,
178            s if s.matches("alternatePathHintSet") /* AlternatePathHints com.amazonaws.ec2#NetworkInsightsAnalysis$AlternatePathHints */ =>  {
179                let var_15 =
180                    Some(
181                        crate::protocol_serde::shape_alternate_path_hint_list::de_alternate_path_hint_list(&mut tag)
182                        ?
183                    )
184                ;
185                builder = builder.set_alternate_path_hints(var_15);
186            }
187            ,
188            s if s.matches("suggestedAccountSet") /* SuggestedAccounts com.amazonaws.ec2#NetworkInsightsAnalysis$SuggestedAccounts */ =>  {
189                let var_16 =
190                    Some(
191                        crate::protocol_serde::shape_value_string_list::de_value_string_list(&mut tag)
192                        ?
193                    )
194                ;
195                builder = builder.set_suggested_accounts(var_16);
196            }
197            ,
198            s if s.matches("tagSet") /* Tags com.amazonaws.ec2#NetworkInsightsAnalysis$Tags */ =>  {
199                let var_17 =
200                    Some(
201                        crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
202                        ?
203                    )
204                ;
205                builder = builder.set_tags(var_17);
206            }
207            ,
208            _ => {}
209        }
210    }
211    Ok(builder.build())
212}