pub fn ser_domain_join_info(
encoder: &mut ::aws_smithy_cbor::Encoder,
#[allow(unused)] input: &crate::types::DomainJoinInfo,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
encoder.begin_map();
if let Some(var_1) = &input.directory_name {
encoder.str("DirectoryName").str(var_1.as_str());
}
if let Some(var_2) = &input.organizational_unit_distinguished_name {
encoder.str("OrganizationalUnitDistinguishedName").str(var_2.as_str());
}
encoder.end();
Ok(())
}
pub(crate) fn de_domain_join_info(
decoder: &mut ::aws_smithy_cbor::Decoder,
depth: u32,
) -> ::std::result::Result<crate::types::DomainJoinInfo, ::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::DomainJoinInfoBuilder,
decoder: &mut ::aws_smithy_cbor::Decoder,
depth: u32,
) -> ::std::result::Result<crate::types::builders::DomainJoinInfoBuilder, ::aws_smithy_cbor::decode::DeserializeError> {
builder = match decoder.str()?.as_ref() {
"DirectoryName" => ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
Ok(builder.set_directory_name(Some(decoder.string()?)))
})?,
"OrganizationalUnitDistinguishedName" => ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
Ok(builder.set_organizational_unit_distinguished_name(Some(decoder.string()?)))
})?,
_ => {
decoder.skip()?;
builder
}
};
Ok(builder)
}
let mut builder = crate::types::builders::DomainJoinInfoBuilder::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(builder.build());
}
}