aws_sdk_redshift/protocol_serde/
shape_read_write_access.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(unused_mut)]
3pub fn ser_read_write_access(
4    mut writer: ::aws_smithy_query::QueryValueWriter,
5    input: &crate::types::ReadWriteAccess,
6) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
7    #[allow(unused_mut)]
8    let mut scope_1 = writer.prefix("Authorization");
9    if let Some(var_2) = &input.authorization {
10        scope_1.string(var_2.as_str());
11    }
12    Ok(())
13}
14
15#[allow(clippy::needless_question_mark)]
16pub fn de_read_write_access(
17    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
18) -> ::std::result::Result<crate::types::ReadWriteAccess, ::aws_smithy_xml::decode::XmlDecodeError> {
19    #[allow(unused_mut)]
20    let mut builder = crate::types::ReadWriteAccess::builder();
21    while let Some(mut tag) = decoder.next_tag() {
22        match tag.start_el() {
23            s if s.matches("Authorization") /* Authorization com.amazonaws.redshift#ReadWriteAccess$Authorization */ =>  {
24                let var_3 =
25                    Some(
26                        Result::<crate::types::ServiceAuthorization, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
27                            crate::types::ServiceAuthorization::from(
28                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
29                            )
30                        )
31                        ?
32                    )
33                ;
34                builder = builder.set_authorization(var_3);
35            }
36            ,
37            _ => {}
38        }
39    }
40    Ok(crate::serde_util::read_write_access_correct_errors(builder).build())
41}