aws-sdk-iam 1.109.0

AWS SDK for AWS Identity and Access Management
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_password_policy(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::PasswordPolicy, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::PasswordPolicy::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("MinimumPasswordLength") /* MinimumPasswordLength com.amazonaws.iam#PasswordPolicy$MinimumPasswordLength */ =>  {
                let var_1 =
                    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.iam#minimumPasswordLengthType`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_minimum_password_length(var_1);
            }
            ,
            s if s.matches("RequireSymbols") /* RequireSymbols com.amazonaws.iam#PasswordPolicy$RequireSymbols */ =>  {
                let var_2 =
                    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.iam#booleanType`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_require_symbols(var_2);
            }
            ,
            s if s.matches("RequireNumbers") /* RequireNumbers com.amazonaws.iam#PasswordPolicy$RequireNumbers */ =>  {
                let var_3 =
                    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.iam#booleanType`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_require_numbers(var_3);
            }
            ,
            s if s.matches("RequireUppercaseCharacters") /* RequireUppercaseCharacters com.amazonaws.iam#PasswordPolicy$RequireUppercaseCharacters */ =>  {
                let var_4 =
                    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.iam#booleanType`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_require_uppercase_characters(var_4);
            }
            ,
            s if s.matches("RequireLowercaseCharacters") /* RequireLowercaseCharacters com.amazonaws.iam#PasswordPolicy$RequireLowercaseCharacters */ =>  {
                let var_5 =
                    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.iam#booleanType`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_require_lowercase_characters(var_5);
            }
            ,
            s if s.matches("AllowUsersToChangePassword") /* AllowUsersToChangePassword com.amazonaws.iam#PasswordPolicy$AllowUsersToChangePassword */ =>  {
                let var_6 =
                    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.iam#booleanType`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_allow_users_to_change_password(var_6);
            }
            ,
            s if s.matches("ExpirePasswords") /* ExpirePasswords com.amazonaws.iam#PasswordPolicy$ExpirePasswords */ =>  {
                let var_7 =
                    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.iam#booleanType`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_expire_passwords(var_7);
            }
            ,
            s if s.matches("MaxPasswordAge") /* MaxPasswordAge com.amazonaws.iam#PasswordPolicy$MaxPasswordAge */ =>  {
                let var_8 =
                    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.iam#maxPasswordAgeType`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_max_password_age(var_8);
            }
            ,
            s if s.matches("PasswordReusePrevention") /* PasswordReusePrevention com.amazonaws.iam#PasswordPolicy$PasswordReusePrevention */ =>  {
                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.iam#passwordReusePreventionType`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_password_reuse_prevention(var_9);
            }
            ,
            s if s.matches("HardExpiry") /* HardExpiry com.amazonaws.iam#PasswordPolicy$HardExpiry */ =>  {
                let var_10 =
                    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.iam#booleanObjectType`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_hard_expiry(var_10);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}