aws_sdk_ec2/protocol_serde/
shape_fpga_image.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_fpga_image(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::FpgaImage, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::FpgaImage::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("fpgaImageId") /* FpgaImageId com.amazonaws.ec2#FpgaImage$FpgaImageId */ =>  {
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_fpga_image_id(var_1);
21            }
22            ,
23            s if s.matches("fpgaImageGlobalId") /* FpgaImageGlobalId com.amazonaws.ec2#FpgaImage$FpgaImageGlobalId */ =>  {
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_fpga_image_global_id(var_2);
34            }
35            ,
36            s if s.matches("name") /* Name com.amazonaws.ec2#FpgaImage$Name */ =>  {
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_name(var_3);
47            }
48            ,
49            s if s.matches("description") /* Description com.amazonaws.ec2#FpgaImage$Description */ =>  {
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_description(var_4);
60            }
61            ,
62            s if s.matches("shellVersion") /* ShellVersion com.amazonaws.ec2#FpgaImage$ShellVersion */ =>  {
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_shell_version(var_5);
73            }
74            ,
75            s if s.matches("pciId") /* PciId com.amazonaws.ec2#FpgaImage$PciId */ =>  {
76                let var_6 =
77                    Some(
78                        crate::protocol_serde::shape_pci_id::de_pci_id(&mut tag)
79                        ?
80                    )
81                ;
82                builder = builder.set_pci_id(var_6);
83            }
84            ,
85            s if s.matches("state") /* State com.amazonaws.ec2#FpgaImage$State */ =>  {
86                let var_7 =
87                    Some(
88                        crate::protocol_serde::shape_fpga_image_state::de_fpga_image_state(&mut tag)
89                        ?
90                    )
91                ;
92                builder = builder.set_state(var_7);
93            }
94            ,
95            s if s.matches("createTime") /* CreateTime com.amazonaws.ec2#FpgaImage$CreateTime */ =>  {
96                let var_8 =
97                    Some(
98                        ::aws_smithy_types::DateTime::from_str(
99                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
100                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
101                        )
102                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
103                        ?
104                    )
105                ;
106                builder = builder.set_create_time(var_8);
107            }
108            ,
109            s if s.matches("updateTime") /* UpdateTime com.amazonaws.ec2#FpgaImage$UpdateTime */ =>  {
110                let var_9 =
111                    Some(
112                        ::aws_smithy_types::DateTime::from_str(
113                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
114                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
115                        )
116                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
117                        ?
118                    )
119                ;
120                builder = builder.set_update_time(var_9);
121            }
122            ,
123            s if s.matches("ownerId") /* OwnerId com.amazonaws.ec2#FpgaImage$OwnerId */ =>  {
124                let var_10 =
125                    Some(
126                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
127                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
128                            .into()
129                        )
130                        ?
131                    )
132                ;
133                builder = builder.set_owner_id(var_10);
134            }
135            ,
136            s if s.matches("ownerAlias") /* OwnerAlias com.amazonaws.ec2#FpgaImage$OwnerAlias */ =>  {
137                let var_11 =
138                    Some(
139                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
140                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
141                            .into()
142                        )
143                        ?
144                    )
145                ;
146                builder = builder.set_owner_alias(var_11);
147            }
148            ,
149            s if s.matches("productCodes") /* ProductCodes com.amazonaws.ec2#FpgaImage$ProductCodes */ =>  {
150                let var_12 =
151                    Some(
152                        crate::protocol_serde::shape_product_code_list::de_product_code_list(&mut tag)
153                        ?
154                    )
155                ;
156                builder = builder.set_product_codes(var_12);
157            }
158            ,
159            s if s.matches("tags") /* Tags com.amazonaws.ec2#FpgaImage$Tags */ =>  {
160                let var_13 =
161                    Some(
162                        crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
163                        ?
164                    )
165                ;
166                builder = builder.set_tags(var_13);
167            }
168            ,
169            s if s.matches("public") /* Public com.amazonaws.ec2#FpgaImage$Public */ =>  {
170                let var_14 =
171                    Some(
172                         {
173                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
174                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
175                            )
176                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
177                        }
178                        ?
179                    )
180                ;
181                builder = builder.set_public(var_14);
182            }
183            ,
184            s if s.matches("dataRetentionSupport") /* DataRetentionSupport com.amazonaws.ec2#FpgaImage$DataRetentionSupport */ =>  {
185                let var_15 =
186                    Some(
187                         {
188                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
189                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
190                            )
191                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
192                        }
193                        ?
194                    )
195                ;
196                builder = builder.set_data_retention_support(var_15);
197            }
198            ,
199            s if s.matches("instanceTypes") /* InstanceTypes com.amazonaws.ec2#FpgaImage$InstanceTypes */ =>  {
200                let var_16 =
201                    Some(
202                        crate::protocol_serde::shape_instance_types_list::de_instance_types_list(&mut tag)
203                        ?
204                    )
205                ;
206                builder = builder.set_instance_types(var_16);
207            }
208            ,
209            _ => {}
210        }
211    }
212    Ok(builder.build())
213}