aws-sdk-ec2 1.222.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_history_record(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::HistoryRecord, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::HistoryRecord::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("eventInformation") /* EventInformation com.amazonaws.ec2#HistoryRecord$EventInformation */ =>  {
                let var_1 =
                    Some(
                        crate::protocol_serde::shape_event_information::de_event_information(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_event_information(var_1);
            }
            ,
            s if s.matches("eventType") /* EventType com.amazonaws.ec2#HistoryRecord$EventType */ =>  {
                let var_2 =
                    Some(
                        Result::<crate::types::EventType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::EventType::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_event_type(var_2);
            }
            ,
            s if s.matches("timestamp") /* Timestamp com.amazonaws.ec2#HistoryRecord$Timestamp */ =>  {
                let var_3 =
                    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_timestamp(var_3);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}