#[allow(unused_mut)]
pub fn ser_cloud_watch_dimension_configuration(
mut writer: ::aws_smithy_query::QueryValueWriter,
input: &crate::types::CloudWatchDimensionConfiguration,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope_1 = writer.prefix("DimensionName");
{
scope_1.string(&input.dimension_name);
}
#[allow(unused_mut)]
let mut scope_2 = writer.prefix("DimensionValueSource");
{
scope_2.string(input.dimension_value_source.as_str());
}
#[allow(unused_mut)]
let mut scope_3 = writer.prefix("DefaultDimensionValue");
{
scope_3.string(&input.default_dimension_value);
}
Ok(())
}
#[allow(clippy::needless_question_mark)]
pub fn de_cloud_watch_dimension_configuration(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
depth: u32,
) -> ::std::result::Result<crate::types::CloudWatchDimensionConfiguration, ::aws_smithy_xml::decode::XmlDecodeError> {
if depth >= 128u32 {
return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("maximum nesting depth exceeded"));
}
#[allow(unused_mut)]
let mut builder = crate::types::CloudWatchDimensionConfiguration::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("DimensionName") => {
let var_4 =
Some(
Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_dimension_name(var_4);
}
,
s if s.matches("DimensionValueSource") => {
let var_5 =
Some(
Result::<crate::types::DimensionValueSource, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::types::DimensionValueSource::from(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_dimension_value_source(var_5);
}
,
s if s.matches("DefaultDimensionValue") => {
let var_6 =
Some(
Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_default_dimension_value(var_6);
}
,
_ => {}
}
}
Ok(crate::serde_util::cloud_watch_dimension_configuration_correct_errors(builder)
.build()
.map_err(|_| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing field"))?)
}