/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace IAM { namespace Model { /** *

Contains information about the account password policy.

This data * type is used as a response element in the GetAccountPasswordPolicy * operation.

See Also:

AWS * API Reference

*/ class PasswordPolicy { public: AWS_IAM_API PasswordPolicy(); AWS_IAM_API PasswordPolicy(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_IAM_API PasswordPolicy& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_IAM_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; AWS_IAM_API void OutputToStream(Aws::OStream& oStream, const char* location) const; /** *

Minimum length to require for IAM user passwords.

*/ inline int GetMinimumPasswordLength() const{ return m_minimumPasswordLength; } /** *

Minimum length to require for IAM user passwords.

*/ inline bool MinimumPasswordLengthHasBeenSet() const { return m_minimumPasswordLengthHasBeenSet; } /** *

Minimum length to require for IAM user passwords.

*/ inline void SetMinimumPasswordLength(int value) { m_minimumPasswordLengthHasBeenSet = true; m_minimumPasswordLength = value; } /** *

Minimum length to require for IAM user passwords.

*/ inline PasswordPolicy& WithMinimumPasswordLength(int value) { SetMinimumPasswordLength(value); return *this;} /** *

Specifies whether IAM user passwords must contain at least one of the * following symbols:

! @ # $ % ^ & * ( ) _ + - = [ ] { } | '

*/ inline bool GetRequireSymbols() const{ return m_requireSymbols; } /** *

Specifies whether IAM user passwords must contain at least one of the * following symbols:

! @ # $ % ^ & * ( ) _ + - = [ ] { } | '

*/ inline bool RequireSymbolsHasBeenSet() const { return m_requireSymbolsHasBeenSet; } /** *

Specifies whether IAM user passwords must contain at least one of the * following symbols:

! @ # $ % ^ & * ( ) _ + - = [ ] { } | '

*/ inline void SetRequireSymbols(bool value) { m_requireSymbolsHasBeenSet = true; m_requireSymbols = value; } /** *

Specifies whether IAM user passwords must contain at least one of the * following symbols:

! @ # $ % ^ & * ( ) _ + - = [ ] { } | '

*/ inline PasswordPolicy& WithRequireSymbols(bool value) { SetRequireSymbols(value); return *this;} /** *

Specifies whether IAM user passwords must contain at least one numeric * character (0 to 9).

*/ inline bool GetRequireNumbers() const{ return m_requireNumbers; } /** *

Specifies whether IAM user passwords must contain at least one numeric * character (0 to 9).

*/ inline bool RequireNumbersHasBeenSet() const { return m_requireNumbersHasBeenSet; } /** *

Specifies whether IAM user passwords must contain at least one numeric * character (0 to 9).

*/ inline void SetRequireNumbers(bool value) { m_requireNumbersHasBeenSet = true; m_requireNumbers = value; } /** *

Specifies whether IAM user passwords must contain at least one numeric * character (0 to 9).

*/ inline PasswordPolicy& WithRequireNumbers(bool value) { SetRequireNumbers(value); return *this;} /** *

Specifies whether IAM user passwords must contain at least one uppercase * character (A to Z).

*/ inline bool GetRequireUppercaseCharacters() const{ return m_requireUppercaseCharacters; } /** *

Specifies whether IAM user passwords must contain at least one uppercase * character (A to Z).

*/ inline bool RequireUppercaseCharactersHasBeenSet() const { return m_requireUppercaseCharactersHasBeenSet; } /** *

Specifies whether IAM user passwords must contain at least one uppercase * character (A to Z).

*/ inline void SetRequireUppercaseCharacters(bool value) { m_requireUppercaseCharactersHasBeenSet = true; m_requireUppercaseCharacters = value; } /** *

Specifies whether IAM user passwords must contain at least one uppercase * character (A to Z).

*/ inline PasswordPolicy& WithRequireUppercaseCharacters(bool value) { SetRequireUppercaseCharacters(value); return *this;} /** *

Specifies whether IAM user passwords must contain at least one lowercase * character (a to z).

*/ inline bool GetRequireLowercaseCharacters() const{ return m_requireLowercaseCharacters; } /** *

Specifies whether IAM user passwords must contain at least one lowercase * character (a to z).

*/ inline bool RequireLowercaseCharactersHasBeenSet() const { return m_requireLowercaseCharactersHasBeenSet; } /** *

Specifies whether IAM user passwords must contain at least one lowercase * character (a to z).

*/ inline void SetRequireLowercaseCharacters(bool value) { m_requireLowercaseCharactersHasBeenSet = true; m_requireLowercaseCharacters = value; } /** *

Specifies whether IAM user passwords must contain at least one lowercase * character (a to z).

*/ inline PasswordPolicy& WithRequireLowercaseCharacters(bool value) { SetRequireLowercaseCharacters(value); return *this;} /** *

Specifies whether IAM users are allowed to change their own password. Gives * IAM users permissions to iam:ChangePassword for only their user and * to the iam:GetAccountPasswordPolicy action. This option does not * attach a permissions policy to each user, rather the permissions are applied at * the account-level for all users by IAM.

*/ inline bool GetAllowUsersToChangePassword() const{ return m_allowUsersToChangePassword; } /** *

Specifies whether IAM users are allowed to change their own password. Gives * IAM users permissions to iam:ChangePassword for only their user and * to the iam:GetAccountPasswordPolicy action. This option does not * attach a permissions policy to each user, rather the permissions are applied at * the account-level for all users by IAM.

*/ inline bool AllowUsersToChangePasswordHasBeenSet() const { return m_allowUsersToChangePasswordHasBeenSet; } /** *

Specifies whether IAM users are allowed to change their own password. Gives * IAM users permissions to iam:ChangePassword for only their user and * to the iam:GetAccountPasswordPolicy action. This option does not * attach a permissions policy to each user, rather the permissions are applied at * the account-level for all users by IAM.

*/ inline void SetAllowUsersToChangePassword(bool value) { m_allowUsersToChangePasswordHasBeenSet = true; m_allowUsersToChangePassword = value; } /** *

Specifies whether IAM users are allowed to change their own password. Gives * IAM users permissions to iam:ChangePassword for only their user and * to the iam:GetAccountPasswordPolicy action. This option does not * attach a permissions policy to each user, rather the permissions are applied at * the account-level for all users by IAM.

*/ inline PasswordPolicy& WithAllowUsersToChangePassword(bool value) { SetAllowUsersToChangePassword(value); return *this;} /** *

Indicates whether passwords in the account expire. Returns true if * MaxPasswordAge contains a value greater than 0. Returns false if * MaxPasswordAge is 0 or not present.

*/ inline bool GetExpirePasswords() const{ return m_expirePasswords; } /** *

Indicates whether passwords in the account expire. Returns true if * MaxPasswordAge contains a value greater than 0. Returns false if * MaxPasswordAge is 0 or not present.

*/ inline bool ExpirePasswordsHasBeenSet() const { return m_expirePasswordsHasBeenSet; } /** *

Indicates whether passwords in the account expire. Returns true if * MaxPasswordAge contains a value greater than 0. Returns false if * MaxPasswordAge is 0 or not present.

*/ inline void SetExpirePasswords(bool value) { m_expirePasswordsHasBeenSet = true; m_expirePasswords = value; } /** *

Indicates whether passwords in the account expire. Returns true if * MaxPasswordAge contains a value greater than 0. Returns false if * MaxPasswordAge is 0 or not present.

*/ inline PasswordPolicy& WithExpirePasswords(bool value) { SetExpirePasswords(value); return *this;} /** *

The number of days that an IAM user password is valid.

*/ inline int GetMaxPasswordAge() const{ return m_maxPasswordAge; } /** *

The number of days that an IAM user password is valid.

*/ inline bool MaxPasswordAgeHasBeenSet() const { return m_maxPasswordAgeHasBeenSet; } /** *

The number of days that an IAM user password is valid.

*/ inline void SetMaxPasswordAge(int value) { m_maxPasswordAgeHasBeenSet = true; m_maxPasswordAge = value; } /** *

The number of days that an IAM user password is valid.

*/ inline PasswordPolicy& WithMaxPasswordAge(int value) { SetMaxPasswordAge(value); return *this;} /** *

Specifies the number of previous passwords that IAM users are prevented from * reusing.

*/ inline int GetPasswordReusePrevention() const{ return m_passwordReusePrevention; } /** *

Specifies the number of previous passwords that IAM users are prevented from * reusing.

*/ inline bool PasswordReusePreventionHasBeenSet() const { return m_passwordReusePreventionHasBeenSet; } /** *

Specifies the number of previous passwords that IAM users are prevented from * reusing.

*/ inline void SetPasswordReusePrevention(int value) { m_passwordReusePreventionHasBeenSet = true; m_passwordReusePrevention = value; } /** *

Specifies the number of previous passwords that IAM users are prevented from * reusing.

*/ inline PasswordPolicy& WithPasswordReusePrevention(int value) { SetPasswordReusePrevention(value); return *this;} /** *

Specifies whether IAM users are prevented from setting a new password via the * Amazon Web Services Management Console after their password has expired. The IAM * user cannot access the console until an administrator resets the password. IAM * users with iam:ChangePassword permission and active access keys can * reset their own expired console password using the CLI or API.

*/ inline bool GetHardExpiry() const{ return m_hardExpiry; } /** *

Specifies whether IAM users are prevented from setting a new password via the * Amazon Web Services Management Console after their password has expired. The IAM * user cannot access the console until an administrator resets the password. IAM * users with iam:ChangePassword permission and active access keys can * reset their own expired console password using the CLI or API.

*/ inline bool HardExpiryHasBeenSet() const { return m_hardExpiryHasBeenSet; } /** *

Specifies whether IAM users are prevented from setting a new password via the * Amazon Web Services Management Console after their password has expired. The IAM * user cannot access the console until an administrator resets the password. IAM * users with iam:ChangePassword permission and active access keys can * reset their own expired console password using the CLI or API.

*/ inline void SetHardExpiry(bool value) { m_hardExpiryHasBeenSet = true; m_hardExpiry = value; } /** *

Specifies whether IAM users are prevented from setting a new password via the * Amazon Web Services Management Console after their password has expired. The IAM * user cannot access the console until an administrator resets the password. IAM * users with iam:ChangePassword permission and active access keys can * reset their own expired console password using the CLI or API.

*/ inline PasswordPolicy& WithHardExpiry(bool value) { SetHardExpiry(value); return *this;} private: int m_minimumPasswordLength; bool m_minimumPasswordLengthHasBeenSet = false; bool m_requireSymbols; bool m_requireSymbolsHasBeenSet = false; bool m_requireNumbers; bool m_requireNumbersHasBeenSet = false; bool m_requireUppercaseCharacters; bool m_requireUppercaseCharactersHasBeenSet = false; bool m_requireLowercaseCharacters; bool m_requireLowercaseCharactersHasBeenSet = false; bool m_allowUsersToChangePassword; bool m_allowUsersToChangePasswordHasBeenSet = false; bool m_expirePasswords; bool m_expirePasswordsHasBeenSet = false; int m_maxPasswordAge; bool m_maxPasswordAgeHasBeenSet = false; int m_passwordReusePrevention; bool m_passwordReusePreventionHasBeenSet = false; bool m_hardExpiry; bool m_hardExpiryHasBeenSet = false; }; } // namespace Model } // namespace IAM } // namespace Aws