#[allow(unused_mut)]
pub fn ser_scaling_parameters(
mut writer: ::aws_smithy_query::QueryValueWriter,
input: &crate::types::ScalingParameters,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope_1 = writer.prefix("DesiredInstanceType");
if let Some(var_2) = &input.desired_instance_type {
scope_1.string(var_2.as_str());
}
#[allow(unused_mut)]
let mut scope_3 = writer.prefix("DesiredReplicationCount");
if input.desired_replication_count != 0 {
scope_3.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((input.desired_replication_count).into()),
);
}
#[allow(unused_mut)]
let mut scope_4 = writer.prefix("DesiredPartitionCount");
if input.desired_partition_count != 0 {
scope_4.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((input.desired_partition_count).into()),
);
}
Ok(())
}
#[allow(clippy::needless_question_mark)]
pub fn de_scaling_parameters(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::ScalingParameters, ::aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::types::ScalingParameters::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("DesiredInstanceType") => {
let var_5 =
Some(
Result::<crate::types::PartitionInstanceType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::types::PartitionInstanceType::from(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_desired_instance_type(var_5);
}
,
s if s.matches("DesiredReplicationCount") => {
let var_6 =
Some(
{
<i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudsearch#UIntValue`)"))
}
?
)
;
builder = builder.set_desired_replication_count(var_6);
}
,
s if s.matches("DesiredPartitionCount") => {
let var_7 =
Some(
{
<i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudsearch#UIntValue`)"))
}
?
)
;
builder = builder.set_desired_partition_count(var_7);
}
,
_ => {}
}
}
Ok(builder.build())
}