#[allow(unused_mut)]
pub fn ser_redshift_scope_union(
mut writer: ::aws_smithy_query::QueryValueWriter,
input: &crate::types::RedshiftScopeUnion,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
match input {
crate::types::RedshiftScopeUnion::Connect(inner) => {
crate::protocol_serde::shape_connect::ser_connect(writer, inner)?;
}
crate::types::RedshiftScopeUnion::Unknown => {
return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant(
"RedshiftScopeUnion",
))
}
}
Ok(())
}
pub fn de_redshift_scope_union(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
depth: u32,
) -> ::std::result::Result<crate::types::RedshiftScopeUnion, ::aws_smithy_xml::decode::XmlDecodeError> {
if depth >= 128u32 {
return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("maximum nesting depth exceeded"));
}
let mut base: Option<crate::types::RedshiftScopeUnion> = None;
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("Connect") => {
let tmp =
crate::protocol_serde::shape_connect::de_connect(&mut tag, depth + 1)
?
;
base = Some(crate::types::RedshiftScopeUnion::Connect(tmp));
}
,
_unknown => base = Some(crate::types::RedshiftScopeUnion::Unknown),
}
}
base.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("expected union, got nothing"))
}