aws_sdk_ec2/protocol_serde/
shape_instance_network_interface_attachment.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_instance_network_interface_attachment(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::InstanceNetworkInterfaceAttachment, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::InstanceNetworkInterfaceAttachment::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("attachTime") => {
11 let var_1 =
12 Some(
13 ::aws_smithy_types::DateTime::from_str(
14 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
15 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
16 )
17 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
18 ?
19 )
20 ;
21 builder = builder.set_attach_time(var_1);
22 }
23 ,
24 s if s.matches("attachmentId") => {
25 let var_2 =
26 Some(
27 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
28 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
29 .into()
30 )
31 ?
32 )
33 ;
34 builder = builder.set_attachment_id(var_2);
35 }
36 ,
37 s if s.matches("deleteOnTermination") => {
38 let var_3 =
39 Some(
40 {
41 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
42 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
43 )
44 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
45 }
46 ?
47 )
48 ;
49 builder = builder.set_delete_on_termination(var_3);
50 }
51 ,
52 s if s.matches("deviceIndex") => {
53 let var_4 =
54 Some(
55 {
56 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
57 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
58 )
59 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
60 }
61 ?
62 )
63 ;
64 builder = builder.set_device_index(var_4);
65 }
66 ,
67 s if s.matches("status") => {
68 let var_5 =
69 Some(
70 Result::<crate::types::AttachmentStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
71 crate::types::AttachmentStatus::from(
72 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
73 )
74 )
75 ?
76 )
77 ;
78 builder = builder.set_status(var_5);
79 }
80 ,
81 s if s.matches("networkCardIndex") => {
82 let var_6 =
83 Some(
84 {
85 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
86 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
87 )
88 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
89 }
90 ?
91 )
92 ;
93 builder = builder.set_network_card_index(var_6);
94 }
95 ,
96 s if s.matches("enaSrdSpecification") => {
97 let var_7 =
98 Some(
99 crate::protocol_serde::shape_instance_attachment_ena_srd_specification::de_instance_attachment_ena_srd_specification(&mut tag)
100 ?
101 )
102 ;
103 builder = builder.set_ena_srd_specification(var_7);
104 }
105 ,
106 s if s.matches("enaQueueCount") => {
107 let var_8 =
108 Some(
109 {
110 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
111 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
112 )
113 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
114 }
115 ?
116 )
117 ;
118 builder = builder.set_ena_queue_count(var_8);
119 }
120 ,
121 _ => {}
122 }
123 }
124 Ok(builder.build())
125}