com.amazonaws.services.amplifybackend.model.CreateBackendAuthUserPoolConfig Maven / Gradle / Ivy
Show all versions of aws-java-sdk-amplifybackend 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.amplifybackend.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes the Amazon Cognito user pool configuration for the auth resource to be configured for your Amplify project.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateBackendAuthUserPoolConfig implements Serializable, Cloneable, StructuredPojo {
/**
*
* (DEPRECATED) Describes the forgotten password policy for your Amazon Cognito user pool, configured as a
* part of your Amplify project.
*
*/
private CreateBackendAuthForgotPasswordConfig forgotPassword;
/**
*
* Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool configured as a
* part of your Amplify project.
*
*/
private CreateBackendAuthMFAConfig mfa;
/**
*
* Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your Amplify
* project.
*
*/
private CreateBackendAuthOAuthConfig oAuth;
/**
*
* Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.
*
*/
private CreateBackendAuthPasswordPolicyConfig passwordPolicy;
/**
*
* The required attributes to sign up new users in the user pool.
*
*/
private java.util.List requiredSignUpAttributes;
/**
*
* Describes the sign-in methods that your Amplify app users use to log in using the Amazon Cognito user pool,
* configured as a part of your Amplify project.
*
*/
private String signInMethod;
/**
*
* The Amazon Cognito user pool name.
*
*/
private String userPoolName;
/**
*
* Describes the email or SMS verification message for your Amazon Cognito user pool, configured as a part of your
* Amplify project.
*
*/
private CreateBackendAuthVerificationMessageConfig verificationMessage;
/**
*
* (DEPRECATED) Describes the forgotten password policy for your Amazon Cognito user pool, configured as a
* part of your Amplify project.
*
*
* @param forgotPassword
* (DEPRECATED)
*/
public void setForgotPassword(CreateBackendAuthForgotPasswordConfig forgotPassword) {
this.forgotPassword = forgotPassword;
}
/**
*
* (DEPRECATED) Describes the forgotten password policy for your Amazon Cognito user pool, configured as a
* part of your Amplify project.
*
*
* @return (DEPRECATED)
*/
public CreateBackendAuthForgotPasswordConfig getForgotPassword() {
return this.forgotPassword;
}
/**
*
* (DEPRECATED) Describes the forgotten password policy for your Amazon Cognito user pool, configured as a
* part of your Amplify project.
*
*
* @param forgotPassword
* (DEPRECATED)
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateBackendAuthUserPoolConfig withForgotPassword(CreateBackendAuthForgotPasswordConfig forgotPassword) {
setForgotPassword(forgotPassword);
return this;
}
/**
*
* Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool configured as a
* part of your Amplify project.
*
*
* @param mfa
* Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool
* configured as a part of your Amplify project.
*/
public void setMfa(CreateBackendAuthMFAConfig mfa) {
this.mfa = mfa;
}
/**
*
* Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool configured as a
* part of your Amplify project.
*
*
* @return Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool
* configured as a part of your Amplify project.
*/
public CreateBackendAuthMFAConfig getMfa() {
return this.mfa;
}
/**
*
* Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool configured as a
* part of your Amplify project.
*
*
* @param mfa
* Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool
* configured as a part of your Amplify project.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateBackendAuthUserPoolConfig withMfa(CreateBackendAuthMFAConfig mfa) {
setMfa(mfa);
return this;
}
/**
*
* Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your Amplify
* project.
*
*
* @param oAuth
* Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your
* Amplify project.
*/
public void setOAuth(CreateBackendAuthOAuthConfig oAuth) {
this.oAuth = oAuth;
}
/**
*
* Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your Amplify
* project.
*
*
* @return Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your
* Amplify project.
*/
public CreateBackendAuthOAuthConfig getOAuth() {
return this.oAuth;
}
/**
*
* Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your Amplify
* project.
*
*
* @param oAuth
* Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your
* Amplify project.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateBackendAuthUserPoolConfig withOAuth(CreateBackendAuthOAuthConfig oAuth) {
setOAuth(oAuth);
return this;
}
/**
*
* Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.
*
*
* @param passwordPolicy
* Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify
* project.
*/
public void setPasswordPolicy(CreateBackendAuthPasswordPolicyConfig passwordPolicy) {
this.passwordPolicy = passwordPolicy;
}
/**
*
* Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.
*
*
* @return Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify
* project.
*/
public CreateBackendAuthPasswordPolicyConfig getPasswordPolicy() {
return this.passwordPolicy;
}
/**
*
* Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.
*
*
* @param passwordPolicy
* Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify
* project.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateBackendAuthUserPoolConfig withPasswordPolicy(CreateBackendAuthPasswordPolicyConfig passwordPolicy) {
setPasswordPolicy(passwordPolicy);
return this;
}
/**
*
* The required attributes to sign up new users in the user pool.
*
*
* @return The required attributes to sign up new users in the user pool.
* @see RequiredSignUpAttributesElement
*/
public java.util.List getRequiredSignUpAttributes() {
return requiredSignUpAttributes;
}
/**
*
* The required attributes to sign up new users in the user pool.
*
*
* @param requiredSignUpAttributes
* The required attributes to sign up new users in the user pool.
* @see RequiredSignUpAttributesElement
*/
public void setRequiredSignUpAttributes(java.util.Collection requiredSignUpAttributes) {
if (requiredSignUpAttributes == null) {
this.requiredSignUpAttributes = null;
return;
}
this.requiredSignUpAttributes = new java.util.ArrayList(requiredSignUpAttributes);
}
/**
*
* The required attributes to sign up new users in the user pool.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRequiredSignUpAttributes(java.util.Collection)} or
* {@link #withRequiredSignUpAttributes(java.util.Collection)} if you want to override the existing values.
*
*
* @param requiredSignUpAttributes
* The required attributes to sign up new users in the user pool.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RequiredSignUpAttributesElement
*/
public CreateBackendAuthUserPoolConfig withRequiredSignUpAttributes(String... requiredSignUpAttributes) {
if (this.requiredSignUpAttributes == null) {
setRequiredSignUpAttributes(new java.util.ArrayList(requiredSignUpAttributes.length));
}
for (String ele : requiredSignUpAttributes) {
this.requiredSignUpAttributes.add(ele);
}
return this;
}
/**
*
* The required attributes to sign up new users in the user pool.
*
*
* @param requiredSignUpAttributes
* The required attributes to sign up new users in the user pool.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RequiredSignUpAttributesElement
*/
public CreateBackendAuthUserPoolConfig withRequiredSignUpAttributes(java.util.Collection requiredSignUpAttributes) {
setRequiredSignUpAttributes(requiredSignUpAttributes);
return this;
}
/**
*
* The required attributes to sign up new users in the user pool.
*
*
* @param requiredSignUpAttributes
* The required attributes to sign up new users in the user pool.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RequiredSignUpAttributesElement
*/
public CreateBackendAuthUserPoolConfig withRequiredSignUpAttributes(RequiredSignUpAttributesElement... requiredSignUpAttributes) {
java.util.ArrayList requiredSignUpAttributesCopy = new java.util.ArrayList(requiredSignUpAttributes.length);
for (RequiredSignUpAttributesElement value : requiredSignUpAttributes) {
requiredSignUpAttributesCopy.add(value.toString());
}
if (getRequiredSignUpAttributes() == null) {
setRequiredSignUpAttributes(requiredSignUpAttributesCopy);
} else {
getRequiredSignUpAttributes().addAll(requiredSignUpAttributesCopy);
}
return this;
}
/**
*
* Describes the sign-in methods that your Amplify app users use to log in using the Amazon Cognito user pool,
* configured as a part of your Amplify project.
*
*
* @param signInMethod
* Describes the sign-in methods that your Amplify app users use to log in using the Amazon Cognito user
* pool, configured as a part of your Amplify project.
* @see SignInMethod
*/
public void setSignInMethod(String signInMethod) {
this.signInMethod = signInMethod;
}
/**
*
* Describes the sign-in methods that your Amplify app users use to log in using the Amazon Cognito user pool,
* configured as a part of your Amplify project.
*
*
* @return Describes the sign-in methods that your Amplify app users use to log in using the Amazon Cognito user
* pool, configured as a part of your Amplify project.
* @see SignInMethod
*/
public String getSignInMethod() {
return this.signInMethod;
}
/**
*
* Describes the sign-in methods that your Amplify app users use to log in using the Amazon Cognito user pool,
* configured as a part of your Amplify project.
*
*
* @param signInMethod
* Describes the sign-in methods that your Amplify app users use to log in using the Amazon Cognito user
* pool, configured as a part of your Amplify project.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SignInMethod
*/
public CreateBackendAuthUserPoolConfig withSignInMethod(String signInMethod) {
setSignInMethod(signInMethod);
return this;
}
/**
*
* Describes the sign-in methods that your Amplify app users use to log in using the Amazon Cognito user pool,
* configured as a part of your Amplify project.
*
*
* @param signInMethod
* Describes the sign-in methods that your Amplify app users use to log in using the Amazon Cognito user
* pool, configured as a part of your Amplify project.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SignInMethod
*/
public CreateBackendAuthUserPoolConfig withSignInMethod(SignInMethod signInMethod) {
this.signInMethod = signInMethod.toString();
return this;
}
/**
*
* The Amazon Cognito user pool name.
*
*
* @param userPoolName
* The Amazon Cognito user pool name.
*/
public void setUserPoolName(String userPoolName) {
this.userPoolName = userPoolName;
}
/**
*
* The Amazon Cognito user pool name.
*
*
* @return The Amazon Cognito user pool name.
*/
public String getUserPoolName() {
return this.userPoolName;
}
/**
*
* The Amazon Cognito user pool name.
*
*
* @param userPoolName
* The Amazon Cognito user pool name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateBackendAuthUserPoolConfig withUserPoolName(String userPoolName) {
setUserPoolName(userPoolName);
return this;
}
/**
*
* Describes the email or SMS verification message for your Amazon Cognito user pool, configured as a part of your
* Amplify project.
*
*
* @param verificationMessage
* Describes the email or SMS verification message for your Amazon Cognito user pool, configured as a part of
* your Amplify project.
*/
public void setVerificationMessage(CreateBackendAuthVerificationMessageConfig verificationMessage) {
this.verificationMessage = verificationMessage;
}
/**
*
* Describes the email or SMS verification message for your Amazon Cognito user pool, configured as a part of your
* Amplify project.
*
*
* @return Describes the email or SMS verification message for your Amazon Cognito user pool, configured as a part
* of your Amplify project.
*/
public CreateBackendAuthVerificationMessageConfig getVerificationMessage() {
return this.verificationMessage;
}
/**
*
* Describes the email or SMS verification message for your Amazon Cognito user pool, configured as a part of your
* Amplify project.
*
*
* @param verificationMessage
* Describes the email or SMS verification message for your Amazon Cognito user pool, configured as a part of
* your Amplify project.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateBackendAuthUserPoolConfig withVerificationMessage(CreateBackendAuthVerificationMessageConfig verificationMessage) {
setVerificationMessage(verificationMessage);
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 (getForgotPassword() != null)
sb.append("ForgotPassword: ").append(getForgotPassword()).append(",");
if (getMfa() != null)
sb.append("Mfa: ").append(getMfa()).append(",");
if (getOAuth() != null)
sb.append("OAuth: ").append(getOAuth()).append(",");
if (getPasswordPolicy() != null)
sb.append("PasswordPolicy: ").append(getPasswordPolicy()).append(",");
if (getRequiredSignUpAttributes() != null)
sb.append("RequiredSignUpAttributes: ").append(getRequiredSignUpAttributes()).append(",");
if (getSignInMethod() != null)
sb.append("SignInMethod: ").append(getSignInMethod()).append(",");
if (getUserPoolName() != null)
sb.append("UserPoolName: ").append(getUserPoolName()).append(",");
if (getVerificationMessage() != null)
sb.append("VerificationMessage: ").append(getVerificationMessage());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateBackendAuthUserPoolConfig == false)
return false;
CreateBackendAuthUserPoolConfig other = (CreateBackendAuthUserPoolConfig) obj;
if (other.getForgotPassword() == null ^ this.getForgotPassword() == null)
return false;
if (other.getForgotPassword() != null && other.getForgotPassword().equals(this.getForgotPassword()) == false)
return false;
if (other.getMfa() == null ^ this.getMfa() == null)
return false;
if (other.getMfa() != null && other.getMfa().equals(this.getMfa()) == false)
return false;
if (other.getOAuth() == null ^ this.getOAuth() == null)
return false;
if (other.getOAuth() != null && other.getOAuth().equals(this.getOAuth()) == false)
return false;
if (other.getPasswordPolicy() == null ^ this.getPasswordPolicy() == null)
return false;
if (other.getPasswordPolicy() != null && other.getPasswordPolicy().equals(this.getPasswordPolicy()) == false)
return false;
if (other.getRequiredSignUpAttributes() == null ^ this.getRequiredSignUpAttributes() == null)
return false;
if (other.getRequiredSignUpAttributes() != null && other.getRequiredSignUpAttributes().equals(this.getRequiredSignUpAttributes()) == false)
return false;
if (other.getSignInMethod() == null ^ this.getSignInMethod() == null)
return false;
if (other.getSignInMethod() != null && other.getSignInMethod().equals(this.getSignInMethod()) == false)
return false;
if (other.getUserPoolName() == null ^ this.getUserPoolName() == null)
return false;
if (other.getUserPoolName() != null && other.getUserPoolName().equals(this.getUserPoolName()) == false)
return false;
if (other.getVerificationMessage() == null ^ this.getVerificationMessage() == null)
return false;
if (other.getVerificationMessage() != null && other.getVerificationMessage().equals(this.getVerificationMessage()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getForgotPassword() == null) ? 0 : getForgotPassword().hashCode());
hashCode = prime * hashCode + ((getMfa() == null) ? 0 : getMfa().hashCode());
hashCode = prime * hashCode + ((getOAuth() == null) ? 0 : getOAuth().hashCode());
hashCode = prime * hashCode + ((getPasswordPolicy() == null) ? 0 : getPasswordPolicy().hashCode());
hashCode = prime * hashCode + ((getRequiredSignUpAttributes() == null) ? 0 : getRequiredSignUpAttributes().hashCode());
hashCode = prime * hashCode + ((getSignInMethod() == null) ? 0 : getSignInMethod().hashCode());
hashCode = prime * hashCode + ((getUserPoolName() == null) ? 0 : getUserPoolName().hashCode());
hashCode = prime * hashCode + ((getVerificationMessage() == null) ? 0 : getVerificationMessage().hashCode());
return hashCode;
}
@Override
public CreateBackendAuthUserPoolConfig clone() {
try {
return (CreateBackendAuthUserPoolConfig) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.amplifybackend.model.transform.CreateBackendAuthUserPoolConfigMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}