aws_sdk_redshift/protocol_serde/
shape_snapshot_schedule.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_snapshot_schedule(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::SnapshotSchedule, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::SnapshotSchedule::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("ScheduleDefinitions") => {
11 let var_1 =
12 Some(
13 crate::protocol_serde::shape_schedule_definition_list::de_schedule_definition_list(&mut tag)
14 ?
15 )
16 ;
17 builder = builder.set_schedule_definitions(var_1);
18 }
19 ,
20 s if s.matches("ScheduleIdentifier") => {
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_schedule_identifier(var_2);
31 }
32 ,
33 s if s.matches("ScheduleDescription") => {
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_schedule_description(var_3);
44 }
45 ,
46 s if s.matches("Tags") => {
47 let var_4 =
48 Some(
49 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
50 ?
51 )
52 ;
53 builder = builder.set_tags(var_4);
54 }
55 ,
56 s if s.matches("NextInvocations") => {
57 let var_5 =
58 Some(
59 crate::protocol_serde::shape_scheduled_snapshot_time_list::de_scheduled_snapshot_time_list(&mut tag)
60 ?
61 )
62 ;
63 builder = builder.set_next_invocations(var_5);
64 }
65 ,
66 s if s.matches("AssociatedClusterCount") => {
67 let var_6 =
68 Some(
69 {
70 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
71 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
72 )
73 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.redshift#IntegerOptional`)"))
74 }
75 ?
76 )
77 ;
78 builder = builder.set_associated_cluster_count(var_6);
79 }
80 ,
81 s if s.matches("AssociatedClusters") => {
82 let var_7 =
83 Some(
84 crate::protocol_serde::shape_associated_cluster_list::de_associated_cluster_list(&mut tag)
85 ?
86 )
87 ;
88 builder = builder.set_associated_clusters(var_7);
89 }
90 ,
91 _ => {}
92 }
93 }
94 Ok(builder.build())
95}