Class PasswordPolicy.Builder
java.lang.Object
software.amazon.awscdk.services.cognito.PasswordPolicy.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<PasswordPolicy>
- Enclosing interface:
- PasswordPolicy
@Stability(Stable)
public static final class PasswordPolicy.Builder
extends Object
implements software.amazon.jsii.Builder<PasswordPolicy>
A builder for
PasswordPolicy
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofPasswordPolicy.getMinLength()
requireDigits
(Boolean requireDigits) Sets the value ofPasswordPolicy.getRequireDigits()
requireLowercase
(Boolean requireLowercase) Sets the value ofPasswordPolicy.getRequireLowercase()
requireSymbols
(Boolean requireSymbols) Sets the value ofPasswordPolicy.getRequireSymbols()
requireUppercase
(Boolean requireUppercase) Sets the value ofPasswordPolicy.getRequireUppercase()
tempPasswordValidity
(Duration tempPasswordValidity) Sets the value ofPasswordPolicy.getTempPasswordValidity()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
minLength
Sets the value ofPasswordPolicy.getMinLength()
- Parameters:
minLength
- Minimum length required for a user's password.- Returns:
this
-
requireDigits
Sets the value ofPasswordPolicy.getRequireDigits()
- Parameters:
requireDigits
- Whether the user is required to have digits in their password.- Returns:
this
-
requireLowercase
Sets the value ofPasswordPolicy.getRequireLowercase()
- Parameters:
requireLowercase
- Whether the user is required to have lowercase characters in their password.- Returns:
this
-
requireSymbols
Sets the value ofPasswordPolicy.getRequireSymbols()
- Parameters:
requireSymbols
- Whether the user is required to have symbols in their password.- Returns:
this
-
requireUppercase
Sets the value ofPasswordPolicy.getRequireUppercase()
- Parameters:
requireUppercase
- Whether the user is required to have uppercase characters in their password.- Returns:
this
-
tempPasswordValidity
@Stability(Stable) public PasswordPolicy.Builder tempPasswordValidity(Duration tempPasswordValidity) Sets the value ofPasswordPolicy.getTempPasswordValidity()
- Parameters:
tempPasswordValidity
- The length of time the temporary password generated by an admin is valid. This must be provided as whole days, like Duration.days(3) or Duration.hours(48). Fractional days, such as Duration.hours(20), will generate an error.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<PasswordPolicy>
- Returns:
- a new instance of
PasswordPolicy
- Throws:
NullPointerException
- if any required attribute was not provided
-