aws_sdk_ec2/protocol_serde/
shape_prefix_list.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_prefix_list(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::PrefixList, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::PrefixList::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("cidrSet") /* Cidrs com.amazonaws.ec2#PrefixList$Cidrs */ =>  {
11                let var_1 =
12                    Some(
13                        crate::protocol_serde::shape_value_string_list::de_value_string_list(&mut tag)
14                        ?
15                    )
16                ;
17                builder = builder.set_cidrs(var_1);
18            }
19            ,
20            s if s.matches("prefixListId") /* PrefixListId com.amazonaws.ec2#PrefixList$PrefixListId */ =>  {
21                let var_2 =
22                    Some(
23                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
24                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
25                            .into()
26                        )
27                        ?
28                    )
29                ;
30                builder = builder.set_prefix_list_id(var_2);
31            }
32            ,
33            s if s.matches("prefixListName") /* PrefixListName com.amazonaws.ec2#PrefixList$PrefixListName */ =>  {
34                let var_3 =
35                    Some(
36                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
37                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
38                            .into()
39                        )
40                        ?
41                    )
42                ;
43                builder = builder.set_prefix_list_name(var_3);
44            }
45            ,
46            _ => {}
47        }
48    }
49    Ok(builder.build())
50}