aws-sdk-rds 1.132.0

AWS SDK for Amazon Relational Database Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[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") /* VolumeName com.amazonaws.rds#AdditionalStorageVolume$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") /* AllocatedStorage com.amazonaws.rds#AdditionalStorageVolume$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") /* IOPS com.amazonaws.rds#AdditionalStorageVolume$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") /* MaxAllocatedStorage com.amazonaws.rds#AdditionalStorageVolume$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") /* StorageThroughput com.amazonaws.rds#AdditionalStorageVolume$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") /* StorageType com.amazonaws.rds#AdditionalStorageVolume$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())
}