aws_sdk_redshift/protocol_serde/
shape_data_share.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_data_share(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::DataShare, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::DataShare::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("DataShareArn") => {
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_data_share_arn(var_1);
21 }
22 ,
23 s if s.matches("ProducerArn") => {
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_producer_arn(var_2);
34 }
35 ,
36 s if s.matches("AllowPubliclyAccessibleConsumers") => {
37 let var_3 =
38 Some(
39 {
40 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
41 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
42 )
43 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.redshift#Boolean`)"))
44 }
45 ?
46 )
47 ;
48 builder = builder.set_allow_publicly_accessible_consumers(var_3);
49 }
50 ,
51 s if s.matches("DataShareAssociations") => {
52 let var_4 =
53 Some(
54 crate::protocol_serde::shape_data_share_association_list::de_data_share_association_list(&mut tag)
55 ?
56 )
57 ;
58 builder = builder.set_data_share_associations(var_4);
59 }
60 ,
61 s if s.matches("ManagedBy") => {
62 let var_5 =
63 Some(
64 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
65 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
66 .into()
67 )
68 ?
69 )
70 ;
71 builder = builder.set_managed_by(var_5);
72 }
73 ,
74 s if s.matches("DataShareType") => {
75 let var_6 =
76 Some(
77 Result::<crate::types::DataShareType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
78 crate::types::DataShareType::from(
79 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
80 )
81 )
82 ?
83 )
84 ;
85 builder = builder.set_data_share_type(var_6);
86 }
87 ,
88 _ => {}
89 }
90 }
91 Ok(builder.build())
92}