aws_sdk_redshift/protocol_serde/
shape_integration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_integration(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::Integration, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::Integration::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("IntegrationArn") /* IntegrationArn com.amazonaws.redshift#Integration$IntegrationArn */ =>  {
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_integration_arn(var_1);
21            }
22            ,
23            s if s.matches("IntegrationName") /* IntegrationName com.amazonaws.redshift#Integration$IntegrationName */ =>  {
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_integration_name(var_2);
34            }
35            ,
36            s if s.matches("SourceArn") /* SourceArn com.amazonaws.redshift#Integration$SourceArn */ =>  {
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_source_arn(var_3);
47            }
48            ,
49            s if s.matches("TargetArn") /* TargetArn com.amazonaws.redshift#Integration$TargetArn */ =>  {
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_target_arn(var_4);
60            }
61            ,
62            s if s.matches("Status") /* Status com.amazonaws.redshift#Integration$Status */ =>  {
63                let var_5 =
64                    Some(
65                        Result::<crate::types::ZeroEtlIntegrationStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
66                            crate::types::ZeroEtlIntegrationStatus::from(
67                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
68                            )
69                        )
70                        ?
71                    )
72                ;
73                builder = builder.set_status(var_5);
74            }
75            ,
76            s if s.matches("Errors") /* Errors com.amazonaws.redshift#Integration$Errors */ =>  {
77                let var_6 =
78                    Some(
79                        crate::protocol_serde::shape_integration_error_list::de_integration_error_list(&mut tag)
80                        ?
81                    )
82                ;
83                builder = builder.set_errors(var_6);
84            }
85            ,
86            s if s.matches("CreateTime") /* CreateTime com.amazonaws.redshift#Integration$CreateTime */ =>  {
87                let var_7 =
88                    Some(
89                        ::aws_smithy_types::DateTime::from_str(
90                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
91                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
92                        )
93                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.redshift#TStamp`)"))
94                        ?
95                    )
96                ;
97                builder = builder.set_create_time(var_7);
98            }
99            ,
100            s if s.matches("Description") /* Description com.amazonaws.redshift#Integration$Description */ =>  {
101                let var_8 =
102                    Some(
103                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
104                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
105                            .into()
106                        )
107                        ?
108                    )
109                ;
110                builder = builder.set_description(var_8);
111            }
112            ,
113            s if s.matches("KMSKeyId") /* KMSKeyId com.amazonaws.redshift#Integration$KMSKeyId */ =>  {
114                let var_9 =
115                    Some(
116                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
117                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
118                            .into()
119                        )
120                        ?
121                    )
122                ;
123                builder = builder.set_kms_key_id(var_9);
124            }
125            ,
126            s if s.matches("AdditionalEncryptionContext") /* AdditionalEncryptionContext com.amazonaws.redshift#Integration$AdditionalEncryptionContext */ =>  {
127                let var_10 =
128                    Some(
129                        crate::protocol_serde::shape_encryption_context_map::de_encryption_context_map(&mut tag)
130                        ?
131                    )
132                ;
133                builder = builder.set_additional_encryption_context(var_10);
134            }
135            ,
136            s if s.matches("Tags") /* Tags com.amazonaws.redshift#Integration$Tags */ =>  {
137                let var_11 =
138                    Some(
139                        crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
140                        ?
141                    )
142                ;
143                builder = builder.set_tags(var_11);
144            }
145            ,
146            _ => {}
147        }
148    }
149    Ok(builder.build())
150}