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_iam_instance_profile_association(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::IamInstanceProfileAssociation, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::IamInstanceProfileAssociation::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("associationId") /* AssociationId com.amazonaws.ec2#IamInstanceProfileAssociation$AssociationId */ =>  {
                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_association_id(var_1);
            }
            ,
            s if s.matches("instanceId") /* InstanceId com.amazonaws.ec2#IamInstanceProfileAssociation$InstanceId */ =>  {
                let var_2 =
                    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_instance_id(var_2);
            }
            ,
            s if s.matches("iamInstanceProfile") /* IamInstanceProfile com.amazonaws.ec2#IamInstanceProfileAssociation$IamInstanceProfile */ =>  {
                let var_3 =
                    Some(
                        crate::protocol_serde::shape_iam_instance_profile::de_iam_instance_profile(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_iam_instance_profile(var_3);
            }
            ,
            s if s.matches("state") /* State com.amazonaws.ec2#IamInstanceProfileAssociation$State */ =>  {
                let var_4 =
                    Some(
                        Result::<crate::types::IamInstanceProfileAssociationState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::IamInstanceProfileAssociationState::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_state(var_4);
            }
            ,
            s if s.matches("timestamp") /* Timestamp com.amazonaws.ec2#IamInstanceProfileAssociation$Timestamp */ =>  {
                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#DateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_timestamp(var_5);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}