#[allow(unused_mut)]
pub fn ser_ebs_block_device(
mut writer: ::aws_smithy_query::QueryValueWriter,
input: &crate::types::EbsBlockDevice,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope_1 = writer.prefix("DeleteOnTermination");
if let Some(var_2) = &input.delete_on_termination {
scope_1.boolean(*var_2);
}
#[allow(unused_mut)]
let mut scope_3 = writer.prefix("Iops");
if let Some(var_4) = &input.iops {
scope_3.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((*var_4).into()),
);
}
#[allow(unused_mut)]
let mut scope_5 = writer.prefix("SnapshotId");
if let Some(var_6) = &input.snapshot_id {
scope_5.string(var_6);
}
#[allow(unused_mut)]
let mut scope_7 = writer.prefix("VolumeSize");
if let Some(var_8) = &input.volume_size {
scope_7.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((*var_8).into()),
);
}
#[allow(unused_mut)]
let mut scope_9 = writer.prefix("VolumeType");
if let Some(var_10) = &input.volume_type {
scope_9.string(var_10.as_str());
}
#[allow(unused_mut)]
let mut scope_11 = writer.prefix("KmsKeyId");
if let Some(var_12) = &input.kms_key_id {
scope_11.string(var_12);
}
#[allow(unused_mut)]
let mut scope_13 = writer.prefix("Throughput");
if let Some(var_14) = &input.throughput {
scope_13.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((*var_14).into()),
);
}
#[allow(unused_mut)]
let mut scope_15 = writer.prefix("OutpostArn");
if let Some(var_16) = &input.outpost_arn {
scope_15.string(var_16);
}
#[allow(unused_mut)]
let mut scope_17 = writer.prefix("AvailabilityZone");
if let Some(var_18) = &input.availability_zone {
scope_17.string(var_18);
}
#[allow(unused_mut)]
let mut scope_19 = writer.prefix("Encrypted");
if let Some(var_20) = &input.encrypted {
scope_19.boolean(*var_20);
}
#[allow(unused_mut)]
let mut scope_21 = writer.prefix("VolumeInitializationRate");
if let Some(var_22) = &input.volume_initialization_rate {
scope_21.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((*var_22).into()),
);
}
#[allow(unused_mut)]
let mut scope_23 = writer.prefix("AvailabilityZoneId");
if let Some(var_24) = &input.availability_zone_id {
scope_23.string(var_24);
}
#[allow(unused_mut)]
let mut scope_25 = writer.prefix("EbsCardIndex");
if let Some(var_26) = &input.ebs_card_index {
scope_25.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((*var_26).into()),
);
}
Ok(())
}
#[allow(clippy::needless_question_mark)]
pub fn de_ebs_block_device(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::EbsBlockDevice, ::aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::types::EbsBlockDevice::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("deleteOnTermination") => {
let var_27 =
Some(
{
<bool 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 (boolean: `com.amazonaws.ec2#Boolean`)"))
}
?
)
;
builder = builder.set_delete_on_termination(var_27);
}
,
s if s.matches("iops") => {
let var_28 =
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.ec2#Integer`)"))
}
?
)
;
builder = builder.set_iops(var_28);
}
,
s if s.matches("snapshotId") => {
let var_29 =
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_snapshot_id(var_29);
}
,
s if s.matches("volumeSize") => {
let var_30 =
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.ec2#Integer`)"))
}
?
)
;
builder = builder.set_volume_size(var_30);
}
,
s if s.matches("volumeType") => {
let var_31 =
Some(
Result::<crate::types::VolumeType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::types::VolumeType::from(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_volume_type(var_31);
}
,
s if s.matches("kmsKeyId") => {
let var_32 =
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_kms_key_id(var_32);
}
,
s if s.matches("throughput") => {
let var_33 =
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.ec2#Integer`)"))
}
?
)
;
builder = builder.set_throughput(var_33);
}
,
s if s.matches("outpostArn") => {
let var_34 =
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_outpost_arn(var_34);
}
,
s if s.matches("availabilityZone") => {
let var_35 =
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_availability_zone(var_35);
}
,
s if s.matches("encrypted") => {
let var_36 =
Some(
{
<bool 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 (boolean: `com.amazonaws.ec2#Boolean`)"))
}
?
)
;
builder = builder.set_encrypted(var_36);
}
,
s if s.matches("VolumeInitializationRate") => {
let var_37 =
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.ec2#Integer`)"))
}
?
)
;
builder = builder.set_volume_initialization_rate(var_37);
}
,
s if s.matches("AvailabilityZoneId") => {
let var_38 =
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_availability_zone_id(var_38);
}
,
s if s.matches("EbsCardIndex") => {
let var_39 =
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.ec2#Integer`)"))
}
?
)
;
builder = builder.set_ebs_card_index(var_39);
}
,
_ => {}
}
}
Ok(builder.build())
}