aws-sdk-ec2 1.223.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_volume_modification(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::VolumeModification, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::VolumeModification::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("volumeId") /* VolumeId com.amazonaws.ec2#VolumeModification$VolumeId */ =>  {
                let var_1 =
                    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_id(var_1);
            }
            ,
            s if s.matches("modificationState") /* ModificationState com.amazonaws.ec2#VolumeModification$ModificationState */ =>  {
                let var_2 =
                    Some(
                        Result::<crate::types::VolumeModificationState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::VolumeModificationState::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_modification_state(var_2);
            }
            ,
            s if s.matches("statusMessage") /* StatusMessage com.amazonaws.ec2#VolumeModification$StatusMessage */ =>  {
                let var_3 =
                    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_status_message(var_3);
            }
            ,
            s if s.matches("targetSize") /* TargetSize com.amazonaws.ec2#VolumeModification$TargetSize */ =>  {
                let var_4 =
                    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_target_size(var_4);
            }
            ,
            s if s.matches("targetIops") /* TargetIops com.amazonaws.ec2#VolumeModification$TargetIops */ =>  {
                let var_5 =
                    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_target_iops(var_5);
            }
            ,
            s if s.matches("targetVolumeType") /* TargetVolumeType com.amazonaws.ec2#VolumeModification$TargetVolumeType */ =>  {
                let var_6 =
                    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_target_volume_type(var_6);
            }
            ,
            s if s.matches("targetThroughput") /* TargetThroughput com.amazonaws.ec2#VolumeModification$TargetThroughput */ =>  {
                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.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_target_throughput(var_7);
            }
            ,
            s if s.matches("targetMultiAttachEnabled") /* TargetMultiAttachEnabled com.amazonaws.ec2#VolumeModification$TargetMultiAttachEnabled */ =>  {
                let var_8 =
                    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_target_multi_attach_enabled(var_8);
            }
            ,
            s if s.matches("originalSize") /* OriginalSize com.amazonaws.ec2#VolumeModification$OriginalSize */ =>  {
                let var_9 =
                    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_original_size(var_9);
            }
            ,
            s if s.matches("originalIops") /* OriginalIops com.amazonaws.ec2#VolumeModification$OriginalIops */ =>  {
                let var_10 =
                    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_original_iops(var_10);
            }
            ,
            s if s.matches("originalVolumeType") /* OriginalVolumeType com.amazonaws.ec2#VolumeModification$OriginalVolumeType */ =>  {
                let var_11 =
                    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_original_volume_type(var_11);
            }
            ,
            s if s.matches("originalThroughput") /* OriginalThroughput com.amazonaws.ec2#VolumeModification$OriginalThroughput */ =>  {
                let var_12 =
                    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_original_throughput(var_12);
            }
            ,
            s if s.matches("originalMultiAttachEnabled") /* OriginalMultiAttachEnabled com.amazonaws.ec2#VolumeModification$OriginalMultiAttachEnabled */ =>  {
                let var_13 =
                    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_original_multi_attach_enabled(var_13);
            }
            ,
            s if s.matches("progress") /* Progress com.amazonaws.ec2#VolumeModification$Progress */ =>  {
                let var_14 =
                    Some(
                         {
                            <i64 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 (long: `com.amazonaws.ec2#Long`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_progress(var_14);
            }
            ,
            s if s.matches("startTime") /* StartTime com.amazonaws.ec2#VolumeModification$StartTime */ =>  {
                let var_15 =
                    Some(
                        ::aws_smithy_types::DateTime::from_str(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
                        )
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_start_time(var_15);
            }
            ,
            s if s.matches("endTime") /* EndTime com.amazonaws.ec2#VolumeModification$EndTime */ =>  {
                let var_16 =
                    Some(
                        ::aws_smithy_types::DateTime::from_str(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
                        )
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_end_time(var_16);
            }
            ,
            s if s.matches("operator") /* Operator com.amazonaws.ec2#VolumeModification$Operator */ =>  {
                let var_17 =
                    Some(
                        crate::protocol_serde::shape_operator_response::de_operator_response(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_operator(var_17);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}