#[allow(unused_mut)]
pub fn ser_additional_storage_volume(
mut writer: ::aws_smithy_query::QueryValueWriter,
input: &crate::types::AdditionalStorageVolume,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope_1 = writer.prefix("VolumeName");
if let Some(var_2) = &input.volume_name {
scope_1.string(var_2);
}
#[allow(unused_mut)]
let mut scope_3 = writer.prefix("AllocatedStorage");
if let Some(var_4) = &input.allocated_storage {
scope_3.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((*var_4).into()),
);
}
#[allow(unused_mut)]
let mut scope_5 = writer.prefix("IOPS");
if let Some(var_6) = &input.iops {
scope_5.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((*var_6).into()),
);
}
#[allow(unused_mut)]
let mut scope_7 = writer.prefix("MaxAllocatedStorage");
if let Some(var_8) = &input.max_allocated_storage {
scope_7.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((*var_8).into()),
);
}
#[allow(unused_mut)]
let mut scope_9 = writer.prefix("StorageThroughput");
if let Some(var_10) = &input.storage_throughput {
scope_9.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((*var_10).into()),
);
}
#[allow(unused_mut)]
let mut scope_11 = writer.prefix("StorageType");
if let Some(var_12) = &input.storage_type {
scope_11.string(var_12);
}
Ok(())
}
#[allow(clippy::needless_question_mark)]
pub fn de_additional_storage_volume(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::AdditionalStorageVolume, ::aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::types::AdditionalStorageVolume::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("VolumeName") => {
let var_13 =
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_volume_name(var_13);
}
,
s if s.matches("AllocatedStorage") => {
let var_14 =
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.rds#IntegerOptional`)"))
}
?
)
;
builder = builder.set_allocated_storage(var_14);
}
,
s if s.matches("IOPS") => {
let var_15 =
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.rds#IntegerOptional`)"))
}
?
)
;
builder = builder.set_iops(var_15);
}
,
s if s.matches("MaxAllocatedStorage") => {
let var_16 =
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.rds#IntegerOptional`)"))
}
?
)
;
builder = builder.set_max_allocated_storage(var_16);
}
,
s if s.matches("StorageThroughput") => {
let var_17 =
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.rds#IntegerOptional`)"))
}
?
)
;
builder = builder.set_storage_throughput(var_17);
}
,
s if s.matches("StorageType") => {
let var_18 =
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_storage_type(var_18);
}
,
_ => {}
}
}
Ok(crate::serde_util::additional_storage_volume_correct_errors(builder).build())
}