aws_sdk_ec2/protocol_serde/
shape_mac_modification_task.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_mac_modification_task(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::MacModificationTask, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::MacModificationTask::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("instanceId") => {
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_instance_id(var_1);
21 }
22 ,
23 s if s.matches("macModificationTaskId") => {
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_mac_modification_task_id(var_2);
34 }
35 ,
36 s if s.matches("macSystemIntegrityProtectionConfig") => {
37 let var_3 =
38 Some(
39 crate::protocol_serde::shape_mac_system_integrity_protection_configuration::de_mac_system_integrity_protection_configuration(&mut tag)
40 ?
41 )
42 ;
43 builder = builder.set_mac_system_integrity_protection_config(var_3);
44 }
45 ,
46 s if s.matches("startTime") => {
47 let var_4 =
48 Some(
49 ::aws_smithy_types::DateTime::from_str(
50 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
51 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
52 )
53 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
54 ?
55 )
56 ;
57 builder = builder.set_start_time(var_4);
58 }
59 ,
60 s if s.matches("tagSet") => {
61 let var_5 =
62 Some(
63 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
64 ?
65 )
66 ;
67 builder = builder.set_tags(var_5);
68 }
69 ,
70 s if s.matches("taskState") => {
71 let var_6 =
72 Some(
73 Result::<crate::types::MacModificationTaskState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
74 crate::types::MacModificationTaskState::from(
75 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
76 )
77 )
78 ?
79 )
80 ;
81 builder = builder.set_task_state(var_6);
82 }
83 ,
84 s if s.matches("taskType") => {
85 let var_7 =
86 Some(
87 Result::<crate::types::MacModificationTaskType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
88 crate::types::MacModificationTaskType::from(
89 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
90 )
91 )
92 ?
93 )
94 ;
95 builder = builder.set_task_type(var_7);
96 }
97 ,
98 _ => {}
99 }
100 }
101 Ok(builder.build())
102}