pub fn ser_glue_connection_mapping(
encoder: &mut ::aws_smithy_cbor::Encoder,
#[allow(unused)] input: &crate::types::GlueConnectionMapping,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
encoder.begin_map();
{
encoder.str("path");
encoder.array((input.path).len());
for item_1 in &input.path {
{
crate::protocol_serde::shape_path_segment::ser_path_segment(encoder, item_1)?;
}
}
}
{
encoder.str("glueConnectionArn").str(input.glue_connection_arn.as_str());
}
encoder.end();
Ok(())
}
pub(crate) fn de_glue_connection_mapping(
decoder: &mut ::aws_smithy_cbor::Decoder,
depth: u32,
) -> ::std::result::Result<crate::types::GlueConnectionMapping, ::aws_smithy_cbor::decode::DeserializeError> {
if depth >= 128u32 {
return Err(::aws_smithy_cbor::decode::DeserializeError::custom(
"maximum nesting depth exceeded",
decoder.position(),
));
}
#[allow(clippy::match_single_binding, unused_variables)]
fn pair(
mut builder: crate::types::builders::GlueConnectionMappingBuilder,
decoder: &mut ::aws_smithy_cbor::Decoder,
depth: u32,
) -> ::std::result::Result<crate::types::builders::GlueConnectionMappingBuilder, ::aws_smithy_cbor::decode::DeserializeError> {
builder = match decoder.str()?.as_ref() {
"path" => builder.set_path(Some(crate::protocol_serde::shape_path_segment_list::de_path_segment_list(
decoder,
depth + 1,
)?)),
"glueConnectionArn" => builder.set_glue_connection_arn(Some(decoder.string()?)),
_ => {
decoder.skip()?;
builder
}
};
Ok(builder)
}
let mut builder = crate::types::builders::GlueConnectionMappingBuilder::default();
match decoder.map()? {
None => loop {
match decoder.datatype()? {
::aws_smithy_cbor::data::Type::Break => {
decoder.skip()?;
break;
}
_ => {
builder = pair(builder, decoder, depth)?;
}
};
},
Some(n) => {
for _ in 0..n {
builder = pair(builder, decoder, depth)?;
}
}
};
#[allow(clippy::needless_question_mark)]
{
return Ok(crate::serde_util::glue_connection_mapping_correct_errors(builder)
.build()
.map_err(|err| ::aws_smithy_cbor::decode::DeserializeError::custom(err.to_string(), decoder.position()))?);
}
}