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_key_pair_info(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::KeyPairInfo, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::KeyPairInfo::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("keyPairId") /* KeyPairId com.amazonaws.ec2#KeyPairInfo$KeyPairId */ =>  {
                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_key_pair_id(var_1);
            }
            ,
            s if s.matches("keyType") /* KeyType com.amazonaws.ec2#KeyPairInfo$KeyType */ =>  {
                let var_2 =
                    Some(
                        Result::<crate::types::KeyType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::KeyType::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_key_type(var_2);
            }
            ,
            s if s.matches("tagSet") /* Tags com.amazonaws.ec2#KeyPairInfo$Tags */ =>  {
                let var_3 =
                    Some(
                        crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_tags(var_3);
            }
            ,
            s if s.matches("publicKey") /* PublicKey com.amazonaws.ec2#KeyPairInfo$PublicKey */ =>  {
                let var_4 =
                    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_public_key(var_4);
            }
            ,
            s if s.matches("createTime") /* CreateTime com.amazonaws.ec2#KeyPairInfo$CreateTime */ =>  {
                let var_5 =
                    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#MillisecondDateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_create_time(var_5);
            }
            ,
            s if s.matches("keyName") /* KeyName com.amazonaws.ec2#KeyPairInfo$KeyName */ =>  {
                let var_6 =
                    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_key_name(var_6);
            }
            ,
            s if s.matches("keyFingerprint") /* KeyFingerprint com.amazonaws.ec2#KeyPairInfo$KeyFingerprint */ =>  {
                let var_7 =
                    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_key_fingerprint(var_7);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}