
com.amazonaws.services.cognitoidp.model.SetUserPoolMfaConfigRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cognitoidp Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.cognitoidp.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SetUserPoolMfaConfigRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The user pool ID.
*
*/
private String userPoolId;
/**
*
* The SMS text message MFA configuration.
*
*/
private SmsMfaConfigType smsMfaConfiguration;
/**
*
* The software token MFA configuration.
*
*/
private SoftwareTokenMfaConfigType softwareTokenMfaConfiguration;
/**
*
* The MFA configuration. If you set the MfaConfiguration value to ‘ON’, only users who have set up an MFA factor
* can sign in. To learn more, see Adding Multi-Factor
* Authentication (MFA) to a user pool. Valid values include:
*
*
* -
*
* OFF
MFA won't be used for any users.
*
*
* -
*
* ON
MFA is required for all users to sign in.
*
*
* -
*
* OPTIONAL
MFA will be required only for individual users who have an MFA factor activated.
*
*
*
*/
private String mfaConfiguration;
/**
*
* The user pool ID.
*
*
* @param userPoolId
* The user pool ID.
*/
public void setUserPoolId(String userPoolId) {
this.userPoolId = userPoolId;
}
/**
*
* The user pool ID.
*
*
* @return The user pool ID.
*/
public String getUserPoolId() {
return this.userPoolId;
}
/**
*
* The user pool ID.
*
*
* @param userPoolId
* The user pool ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SetUserPoolMfaConfigRequest withUserPoolId(String userPoolId) {
setUserPoolId(userPoolId);
return this;
}
/**
*
* The SMS text message MFA configuration.
*
*
* @param smsMfaConfiguration
* The SMS text message MFA configuration.
*/
public void setSmsMfaConfiguration(SmsMfaConfigType smsMfaConfiguration) {
this.smsMfaConfiguration = smsMfaConfiguration;
}
/**
*
* The SMS text message MFA configuration.
*
*
* @return The SMS text message MFA configuration.
*/
public SmsMfaConfigType getSmsMfaConfiguration() {
return this.smsMfaConfiguration;
}
/**
*
* The SMS text message MFA configuration.
*
*
* @param smsMfaConfiguration
* The SMS text message MFA configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SetUserPoolMfaConfigRequest withSmsMfaConfiguration(SmsMfaConfigType smsMfaConfiguration) {
setSmsMfaConfiguration(smsMfaConfiguration);
return this;
}
/**
*
* The software token MFA configuration.
*
*
* @param softwareTokenMfaConfiguration
* The software token MFA configuration.
*/
public void setSoftwareTokenMfaConfiguration(SoftwareTokenMfaConfigType softwareTokenMfaConfiguration) {
this.softwareTokenMfaConfiguration = softwareTokenMfaConfiguration;
}
/**
*
* The software token MFA configuration.
*
*
* @return The software token MFA configuration.
*/
public SoftwareTokenMfaConfigType getSoftwareTokenMfaConfiguration() {
return this.softwareTokenMfaConfiguration;
}
/**
*
* The software token MFA configuration.
*
*
* @param softwareTokenMfaConfiguration
* The software token MFA configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SetUserPoolMfaConfigRequest withSoftwareTokenMfaConfiguration(SoftwareTokenMfaConfigType softwareTokenMfaConfiguration) {
setSoftwareTokenMfaConfiguration(softwareTokenMfaConfiguration);
return this;
}
/**
*
* The MFA configuration. If you set the MfaConfiguration value to ‘ON’, only users who have set up an MFA factor
* can sign in. To learn more, see Adding Multi-Factor
* Authentication (MFA) to a user pool. Valid values include:
*
*
* -
*
* OFF
MFA won't be used for any users.
*
*
* -
*
* ON
MFA is required for all users to sign in.
*
*
* -
*
* OPTIONAL
MFA will be required only for individual users who have an MFA factor activated.
*
*
*
*
* @param mfaConfiguration
* The MFA configuration. If you set the MfaConfiguration value to ‘ON’, only users who have set up an MFA
* factor can sign in. To learn more, see Adding
* Multi-Factor Authentication (MFA) to a user pool. Valid values include:
*
* -
*
* OFF
MFA won't be used for any users.
*
*
* -
*
* ON
MFA is required for all users to sign in.
*
*
* -
*
* OPTIONAL
MFA will be required only for individual users who have an MFA factor activated.
*
*
* @see UserPoolMfaType
*/
public void setMfaConfiguration(String mfaConfiguration) {
this.mfaConfiguration = mfaConfiguration;
}
/**
*
* The MFA configuration. If you set the MfaConfiguration value to ‘ON’, only users who have set up an MFA factor
* can sign in. To learn more, see Adding Multi-Factor
* Authentication (MFA) to a user pool. Valid values include:
*
*
* -
*
* OFF
MFA won't be used for any users.
*
*
* -
*
* ON
MFA is required for all users to sign in.
*
*
* -
*
* OPTIONAL
MFA will be required only for individual users who have an MFA factor activated.
*
*
*
*
* @return The MFA configuration. If you set the MfaConfiguration value to ‘ON’, only users who have set up an MFA
* factor can sign in. To learn more, see Adding
* Multi-Factor Authentication (MFA) to a user pool. Valid values include:
*
* -
*
* OFF
MFA won't be used for any users.
*
*
* -
*
* ON
MFA is required for all users to sign in.
*
*
* -
*
* OPTIONAL
MFA will be required only for individual users who have an MFA factor activated.
*
*
* @see UserPoolMfaType
*/
public String getMfaConfiguration() {
return this.mfaConfiguration;
}
/**
*
* The MFA configuration. If you set the MfaConfiguration value to ‘ON’, only users who have set up an MFA factor
* can sign in. To learn more, see Adding Multi-Factor
* Authentication (MFA) to a user pool. Valid values include:
*
*
* -
*
* OFF
MFA won't be used for any users.
*
*
* -
*
* ON
MFA is required for all users to sign in.
*
*
* -
*
* OPTIONAL
MFA will be required only for individual users who have an MFA factor activated.
*
*
*
*
* @param mfaConfiguration
* The MFA configuration. If you set the MfaConfiguration value to ‘ON’, only users who have set up an MFA
* factor can sign in. To learn more, see Adding
* Multi-Factor Authentication (MFA) to a user pool. Valid values include:
*
* -
*
* OFF
MFA won't be used for any users.
*
*
* -
*
* ON
MFA is required for all users to sign in.
*
*
* -
*
* OPTIONAL
MFA will be required only for individual users who have an MFA factor activated.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see UserPoolMfaType
*/
public SetUserPoolMfaConfigRequest withMfaConfiguration(String mfaConfiguration) {
setMfaConfiguration(mfaConfiguration);
return this;
}
/**
*
* The MFA configuration. If you set the MfaConfiguration value to ‘ON’, only users who have set up an MFA factor
* can sign in. To learn more, see Adding Multi-Factor
* Authentication (MFA) to a user pool. Valid values include:
*
*
* -
*
* OFF
MFA won't be used for any users.
*
*
* -
*
* ON
MFA is required for all users to sign in.
*
*
* -
*
* OPTIONAL
MFA will be required only for individual users who have an MFA factor activated.
*
*
*
*
* @param mfaConfiguration
* The MFA configuration. If you set the MfaConfiguration value to ‘ON’, only users who have set up an MFA
* factor can sign in. To learn more, see Adding
* Multi-Factor Authentication (MFA) to a user pool. Valid values include:
*
* -
*
* OFF
MFA won't be used for any users.
*
*
* -
*
* ON
MFA is required for all users to sign in.
*
*
* -
*
* OPTIONAL
MFA will be required only for individual users who have an MFA factor activated.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see UserPoolMfaType
*/
public SetUserPoolMfaConfigRequest withMfaConfiguration(UserPoolMfaType mfaConfiguration) {
this.mfaConfiguration = mfaConfiguration.toString();
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getUserPoolId() != null)
sb.append("UserPoolId: ").append(getUserPoolId()).append(",");
if (getSmsMfaConfiguration() != null)
sb.append("SmsMfaConfiguration: ").append(getSmsMfaConfiguration()).append(",");
if (getSoftwareTokenMfaConfiguration() != null)
sb.append("SoftwareTokenMfaConfiguration: ").append(getSoftwareTokenMfaConfiguration()).append(",");
if (getMfaConfiguration() != null)
sb.append("MfaConfiguration: ").append(getMfaConfiguration());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SetUserPoolMfaConfigRequest == false)
return false;
SetUserPoolMfaConfigRequest other = (SetUserPoolMfaConfigRequest) obj;
if (other.getUserPoolId() == null ^ this.getUserPoolId() == null)
return false;
if (other.getUserPoolId() != null && other.getUserPoolId().equals(this.getUserPoolId()) == false)
return false;
if (other.getSmsMfaConfiguration() == null ^ this.getSmsMfaConfiguration() == null)
return false;
if (other.getSmsMfaConfiguration() != null && other.getSmsMfaConfiguration().equals(this.getSmsMfaConfiguration()) == false)
return false;
if (other.getSoftwareTokenMfaConfiguration() == null ^ this.getSoftwareTokenMfaConfiguration() == null)
return false;
if (other.getSoftwareTokenMfaConfiguration() != null
&& other.getSoftwareTokenMfaConfiguration().equals(this.getSoftwareTokenMfaConfiguration()) == false)
return false;
if (other.getMfaConfiguration() == null ^ this.getMfaConfiguration() == null)
return false;
if (other.getMfaConfiguration() != null && other.getMfaConfiguration().equals(this.getMfaConfiguration()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getUserPoolId() == null) ? 0 : getUserPoolId().hashCode());
hashCode = prime * hashCode + ((getSmsMfaConfiguration() == null) ? 0 : getSmsMfaConfiguration().hashCode());
hashCode = prime * hashCode + ((getSoftwareTokenMfaConfiguration() == null) ? 0 : getSoftwareTokenMfaConfiguration().hashCode());
hashCode = prime * hashCode + ((getMfaConfiguration() == null) ? 0 : getMfaConfiguration().hashCode());
return hashCode;
}
@Override
public SetUserPoolMfaConfigRequest clone() {
return (SetUserPoolMfaConfigRequest) super.clone();
}
}