All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.amplifybackend.model.CreateBackendAuthUserPoolConfig Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amplify Backend module holds the client classes that are used for communicating with Amplify Backend.

The newest version!
/*
 * Copyright 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 software.amazon.awssdk.services.amplifybackend.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes the Amazon Cognito user pool configuration for the auth resource to be configured for your Amplify project. *

*/ @Generated("software.amazon.awssdk:codegen") public final class CreateBackendAuthUserPoolConfig implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField FORGOT_PASSWORD_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ForgotPassword") .getter(getter(CreateBackendAuthUserPoolConfig::forgotPassword)).setter(setter(Builder::forgotPassword)) .constructor(CreateBackendAuthForgotPasswordConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("forgotPassword").build()).build(); private static final SdkField MFA_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("Mfa") .getter(getter(CreateBackendAuthUserPoolConfig::mfa)).setter(setter(Builder::mfa)) .constructor(CreateBackendAuthMFAConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("mfa").build()).build(); private static final SdkField O_AUTH_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("OAuth") .getter(getter(CreateBackendAuthUserPoolConfig::oAuth)).setter(setter(Builder::oAuth)) .constructor(CreateBackendAuthOAuthConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("oAuth").build()).build(); private static final SdkField PASSWORD_POLICY_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("PasswordPolicy") .getter(getter(CreateBackendAuthUserPoolConfig::passwordPolicy)).setter(setter(Builder::passwordPolicy)) .constructor(CreateBackendAuthPasswordPolicyConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("passwordPolicy").build()).build(); private static final SdkField> REQUIRED_SIGN_UP_ATTRIBUTES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("RequiredSignUpAttributes") .getter(getter(CreateBackendAuthUserPoolConfig::requiredSignUpAttributesAsStrings)) .setter(setter(Builder::requiredSignUpAttributesWithStrings)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("requiredSignUpAttributes").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField SIGN_IN_METHOD_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SignInMethod").getter(getter(CreateBackendAuthUserPoolConfig::signInMethodAsString)) .setter(setter(Builder::signInMethod)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("signInMethod").build()).build(); private static final SdkField USER_POOL_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("UserPoolName").getter(getter(CreateBackendAuthUserPoolConfig::userPoolName)) .setter(setter(Builder::userPoolName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("userPoolName").build()).build(); private static final SdkField VERIFICATION_MESSAGE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("VerificationMessage") .getter(getter(CreateBackendAuthUserPoolConfig::verificationMessage)).setter(setter(Builder::verificationMessage)) .constructor(CreateBackendAuthVerificationMessageConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("verificationMessage").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FORGOT_PASSWORD_FIELD, MFA_FIELD, O_AUTH_FIELD, PASSWORD_POLICY_FIELD, REQUIRED_SIGN_UP_ATTRIBUTES_FIELD, SIGN_IN_METHOD_FIELD, USER_POOL_NAME_FIELD, VERIFICATION_MESSAGE_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("forgotPassword", FORGOT_PASSWORD_FIELD); put("mfa", MFA_FIELD); put("oAuth", O_AUTH_FIELD); put("passwordPolicy", PASSWORD_POLICY_FIELD); put("requiredSignUpAttributes", REQUIRED_SIGN_UP_ATTRIBUTES_FIELD); put("signInMethod", SIGN_IN_METHOD_FIELD); put("userPoolName", USER_POOL_NAME_FIELD); put("verificationMessage", VERIFICATION_MESSAGE_FIELD); } }); private static final long serialVersionUID = 1L; private final CreateBackendAuthForgotPasswordConfig forgotPassword; private final CreateBackendAuthMFAConfig mfa; private final CreateBackendAuthOAuthConfig oAuth; private final CreateBackendAuthPasswordPolicyConfig passwordPolicy; private final List requiredSignUpAttributes; private final String signInMethod; private final String userPoolName; private final CreateBackendAuthVerificationMessageConfig verificationMessage; private CreateBackendAuthUserPoolConfig(BuilderImpl builder) { this.forgotPassword = builder.forgotPassword; this.mfa = builder.mfa; this.oAuth = builder.oAuth; this.passwordPolicy = builder.passwordPolicy; this.requiredSignUpAttributes = builder.requiredSignUpAttributes; this.signInMethod = builder.signInMethod; this.userPoolName = builder.userPoolName; this.verificationMessage = builder.verificationMessage; } /** *

* (DEPRECATED) Describes the forgotten password policy for your Amazon Cognito user pool, configured as a * part of your Amplify project. *

* * @return (DEPRECATED) */ public final CreateBackendAuthForgotPasswordConfig forgotPassword() { return forgotPassword; } /** *

* 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 final CreateBackendAuthMFAConfig mfa() { return mfa; } /** *

* 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 final CreateBackendAuthOAuthConfig oAuth() { return oAuth; } /** *

* 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 final CreateBackendAuthPasswordPolicyConfig passwordPolicy() { return passwordPolicy; } /** *

* The required attributes to sign up new users in the user pool. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasRequiredSignUpAttributes} method. *

* * @return The required attributes to sign up new users in the user pool. */ public final List requiredSignUpAttributes() { return ListOfRequiredSignUpAttributesElementCopier.copyStringToEnum(requiredSignUpAttributes); } /** * For responses, this returns true if the service returned a value for the RequiredSignUpAttributes property. This * DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasRequiredSignUpAttributes() { return requiredSignUpAttributes != null && !(requiredSignUpAttributes instanceof SdkAutoConstructList); } /** *

* The required attributes to sign up new users in the user pool. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasRequiredSignUpAttributes} method. *

* * @return The required attributes to sign up new users in the user pool. */ public final List requiredSignUpAttributesAsStrings() { return 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. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #signInMethod} will * return {@link SignInMethod#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #signInMethodAsString}. *

* * @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 final SignInMethod signInMethod() { return SignInMethod.fromValue(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. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #signInMethod} will * return {@link SignInMethod#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #signInMethodAsString}. *

* * @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 final String signInMethodAsString() { return signInMethod; } /** *

* The Amazon Cognito user pool name. *

* * @return The Amazon Cognito user pool name. */ public final String userPoolName() { return userPoolName; } /** *

* 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 final CreateBackendAuthVerificationMessageConfig verificationMessage() { return verificationMessage; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(forgotPassword()); hashCode = 31 * hashCode + Objects.hashCode(mfa()); hashCode = 31 * hashCode + Objects.hashCode(oAuth()); hashCode = 31 * hashCode + Objects.hashCode(passwordPolicy()); hashCode = 31 * hashCode + Objects.hashCode(hasRequiredSignUpAttributes() ? requiredSignUpAttributesAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(signInMethodAsString()); hashCode = 31 * hashCode + Objects.hashCode(userPoolName()); hashCode = 31 * hashCode + Objects.hashCode(verificationMessage()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateBackendAuthUserPoolConfig)) { return false; } CreateBackendAuthUserPoolConfig other = (CreateBackendAuthUserPoolConfig) obj; return Objects.equals(forgotPassword(), other.forgotPassword()) && Objects.equals(mfa(), other.mfa()) && Objects.equals(oAuth(), other.oAuth()) && Objects.equals(passwordPolicy(), other.passwordPolicy()) && hasRequiredSignUpAttributes() == other.hasRequiredSignUpAttributes() && Objects.equals(requiredSignUpAttributesAsStrings(), other.requiredSignUpAttributesAsStrings()) && Objects.equals(signInMethodAsString(), other.signInMethodAsString()) && Objects.equals(userPoolName(), other.userPoolName()) && Objects.equals(verificationMessage(), other.verificationMessage()); } /** * 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. */ @Override public final String toString() { return ToString.builder("CreateBackendAuthUserPoolConfig").add("ForgotPassword", forgotPassword()).add("Mfa", mfa()) .add("OAuth", oAuth()).add("PasswordPolicy", passwordPolicy()) .add("RequiredSignUpAttributes", hasRequiredSignUpAttributes() ? requiredSignUpAttributesAsStrings() : null) .add("SignInMethod", signInMethodAsString()).add("UserPoolName", userPoolName()) .add("VerificationMessage", verificationMessage()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ForgotPassword": return Optional.ofNullable(clazz.cast(forgotPassword())); case "Mfa": return Optional.ofNullable(clazz.cast(mfa())); case "OAuth": return Optional.ofNullable(clazz.cast(oAuth())); case "PasswordPolicy": return Optional.ofNullable(clazz.cast(passwordPolicy())); case "RequiredSignUpAttributes": return Optional.ofNullable(clazz.cast(requiredSignUpAttributesAsStrings())); case "SignInMethod": return Optional.ofNullable(clazz.cast(signInMethodAsString())); case "UserPoolName": return Optional.ofNullable(clazz.cast(userPoolName())); case "VerificationMessage": return Optional.ofNullable(clazz.cast(verificationMessage())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((CreateBackendAuthUserPoolConfig) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* (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. */ Builder forgotPassword(CreateBackendAuthForgotPasswordConfig forgotPassword); /** *

* (DEPRECATED) Describes the forgotten password policy for your Amazon Cognito user pool, configured as * a part of your Amplify project. *

* This is a convenience method that creates an instance of the * {@link CreateBackendAuthForgotPasswordConfig.Builder} avoiding the need to create one manually via * {@link CreateBackendAuthForgotPasswordConfig#builder()}. * *

* When the {@link Consumer} completes, {@link CreateBackendAuthForgotPasswordConfig.Builder#build()} is called * immediately and its result is passed to {@link #forgotPassword(CreateBackendAuthForgotPasswordConfig)}. * * @param forgotPassword * a consumer that will call methods on {@link CreateBackendAuthForgotPasswordConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #forgotPassword(CreateBackendAuthForgotPasswordConfig) */ default Builder forgotPassword(Consumer forgotPassword) { return forgotPassword(CreateBackendAuthForgotPasswordConfig.builder().applyMutation(forgotPassword).build()); } /** *

* 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. */ Builder mfa(CreateBackendAuthMFAConfig mfa); /** *

* Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool configured * as a part of your Amplify project. *

* This is a convenience method that creates an instance of the {@link CreateBackendAuthMFAConfig.Builder} * avoiding the need to create one manually via {@link CreateBackendAuthMFAConfig#builder()}. * *

* When the {@link Consumer} completes, {@link CreateBackendAuthMFAConfig.Builder#build()} is called immediately * and its result is passed to {@link #mfa(CreateBackendAuthMFAConfig)}. * * @param mfa * a consumer that will call methods on {@link CreateBackendAuthMFAConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #mfa(CreateBackendAuthMFAConfig) */ default Builder mfa(Consumer mfa) { return mfa(CreateBackendAuthMFAConfig.builder().applyMutation(mfa).build()); } /** *

* 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. */ Builder oAuth(CreateBackendAuthOAuthConfig oAuth); /** *

* Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your Amplify * project. *

* This is a convenience method that creates an instance of the {@link CreateBackendAuthOAuthConfig.Builder} * avoiding the need to create one manually via {@link CreateBackendAuthOAuthConfig#builder()}. * *

* When the {@link Consumer} completes, {@link CreateBackendAuthOAuthConfig.Builder#build()} is called * immediately and its result is passed to {@link #oAuth(CreateBackendAuthOAuthConfig)}. * * @param oAuth * a consumer that will call methods on {@link CreateBackendAuthOAuthConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #oAuth(CreateBackendAuthOAuthConfig) */ default Builder oAuth(Consumer oAuth) { return oAuth(CreateBackendAuthOAuthConfig.builder().applyMutation(oAuth).build()); } /** *

* 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. */ Builder passwordPolicy(CreateBackendAuthPasswordPolicyConfig passwordPolicy); /** *

* Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify * project. *

* This is a convenience method that creates an instance of the * {@link CreateBackendAuthPasswordPolicyConfig.Builder} avoiding the need to create one manually via * {@link CreateBackendAuthPasswordPolicyConfig#builder()}. * *

* When the {@link Consumer} completes, {@link CreateBackendAuthPasswordPolicyConfig.Builder#build()} is called * immediately and its result is passed to {@link #passwordPolicy(CreateBackendAuthPasswordPolicyConfig)}. * * @param passwordPolicy * a consumer that will call methods on {@link CreateBackendAuthPasswordPolicyConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #passwordPolicy(CreateBackendAuthPasswordPolicyConfig) */ default Builder passwordPolicy(Consumer passwordPolicy) { return passwordPolicy(CreateBackendAuthPasswordPolicyConfig.builder().applyMutation(passwordPolicy).build()); } /** *

* 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. */ Builder requiredSignUpAttributesWithStrings(Collection 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder requiredSignUpAttributesWithStrings(String... 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder requiredSignUpAttributes(Collection 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder requiredSignUpAttributes(RequiredSignUpAttributesElement... 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. *

* * @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 * @return Returns a reference to this object so that method calls can be chained together. * @see SignInMethod */ Builder signInMethod(String 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. * @see SignInMethod * @return Returns a reference to this object so that method calls can be chained together. * @see SignInMethod */ Builder signInMethod(SignInMethod signInMethod); /** *

* 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. */ Builder userPoolName(String userPoolName); /** *

* 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. */ Builder verificationMessage(CreateBackendAuthVerificationMessageConfig verificationMessage); /** *

* Describes the email or SMS verification message for your Amazon Cognito user pool, configured as a part of * your Amplify project. *

* This is a convenience method that creates an instance of the * {@link CreateBackendAuthVerificationMessageConfig.Builder} avoiding the need to create one manually via * {@link CreateBackendAuthVerificationMessageConfig#builder()}. * *

* When the {@link Consumer} completes, {@link CreateBackendAuthVerificationMessageConfig.Builder#build()} is * called immediately and its result is passed to * {@link #verificationMessage(CreateBackendAuthVerificationMessageConfig)}. * * @param verificationMessage * a consumer that will call methods on {@link CreateBackendAuthVerificationMessageConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #verificationMessage(CreateBackendAuthVerificationMessageConfig) */ default Builder verificationMessage(Consumer verificationMessage) { return verificationMessage(CreateBackendAuthVerificationMessageConfig.builder().applyMutation(verificationMessage) .build()); } } static final class BuilderImpl implements Builder { private CreateBackendAuthForgotPasswordConfig forgotPassword; private CreateBackendAuthMFAConfig mfa; private CreateBackendAuthOAuthConfig oAuth; private CreateBackendAuthPasswordPolicyConfig passwordPolicy; private List requiredSignUpAttributes = DefaultSdkAutoConstructList.getInstance(); private String signInMethod; private String userPoolName; private CreateBackendAuthVerificationMessageConfig verificationMessage; private BuilderImpl() { } private BuilderImpl(CreateBackendAuthUserPoolConfig model) { forgotPassword(model.forgotPassword); mfa(model.mfa); oAuth(model.oAuth); passwordPolicy(model.passwordPolicy); requiredSignUpAttributesWithStrings(model.requiredSignUpAttributes); signInMethod(model.signInMethod); userPoolName(model.userPoolName); verificationMessage(model.verificationMessage); } public final CreateBackendAuthForgotPasswordConfig.Builder getForgotPassword() { return forgotPassword != null ? forgotPassword.toBuilder() : null; } public final void setForgotPassword(CreateBackendAuthForgotPasswordConfig.BuilderImpl forgotPassword) { this.forgotPassword = forgotPassword != null ? forgotPassword.build() : null; } @Override public final Builder forgotPassword(CreateBackendAuthForgotPasswordConfig forgotPassword) { this.forgotPassword = forgotPassword; return this; } public final CreateBackendAuthMFAConfig.Builder getMfa() { return mfa != null ? mfa.toBuilder() : null; } public final void setMfa(CreateBackendAuthMFAConfig.BuilderImpl mfa) { this.mfa = mfa != null ? mfa.build() : null; } @Override public final Builder mfa(CreateBackendAuthMFAConfig mfa) { this.mfa = mfa; return this; } public final CreateBackendAuthOAuthConfig.Builder getOAuth() { return oAuth != null ? oAuth.toBuilder() : null; } public final void setOAuth(CreateBackendAuthOAuthConfig.BuilderImpl oAuth) { this.oAuth = oAuth != null ? oAuth.build() : null; } @Override public final Builder oAuth(CreateBackendAuthOAuthConfig oAuth) { this.oAuth = oAuth; return this; } public final CreateBackendAuthPasswordPolicyConfig.Builder getPasswordPolicy() { return passwordPolicy != null ? passwordPolicy.toBuilder() : null; } public final void setPasswordPolicy(CreateBackendAuthPasswordPolicyConfig.BuilderImpl passwordPolicy) { this.passwordPolicy = passwordPolicy != null ? passwordPolicy.build() : null; } @Override public final Builder passwordPolicy(CreateBackendAuthPasswordPolicyConfig passwordPolicy) { this.passwordPolicy = passwordPolicy; return this; } public final Collection getRequiredSignUpAttributes() { if (requiredSignUpAttributes instanceof SdkAutoConstructList) { return null; } return requiredSignUpAttributes; } public final void setRequiredSignUpAttributes(Collection requiredSignUpAttributes) { this.requiredSignUpAttributes = ListOfRequiredSignUpAttributesElementCopier.copy(requiredSignUpAttributes); } @Override public final Builder requiredSignUpAttributesWithStrings(Collection requiredSignUpAttributes) { this.requiredSignUpAttributes = ListOfRequiredSignUpAttributesElementCopier.copy(requiredSignUpAttributes); return this; } @Override @SafeVarargs public final Builder requiredSignUpAttributesWithStrings(String... requiredSignUpAttributes) { requiredSignUpAttributesWithStrings(Arrays.asList(requiredSignUpAttributes)); return this; } @Override public final Builder requiredSignUpAttributes(Collection requiredSignUpAttributes) { this.requiredSignUpAttributes = ListOfRequiredSignUpAttributesElementCopier .copyEnumToString(requiredSignUpAttributes); return this; } @Override @SafeVarargs public final Builder requiredSignUpAttributes(RequiredSignUpAttributesElement... requiredSignUpAttributes) { requiredSignUpAttributes(Arrays.asList(requiredSignUpAttributes)); return this; } public final String getSignInMethod() { return signInMethod; } public final void setSignInMethod(String signInMethod) { this.signInMethod = signInMethod; } @Override public final Builder signInMethod(String signInMethod) { this.signInMethod = signInMethod; return this; } @Override public final Builder signInMethod(SignInMethod signInMethod) { this.signInMethod(signInMethod == null ? null : signInMethod.toString()); return this; } public final String getUserPoolName() { return userPoolName; } public final void setUserPoolName(String userPoolName) { this.userPoolName = userPoolName; } @Override public final Builder userPoolName(String userPoolName) { this.userPoolName = userPoolName; return this; } public final CreateBackendAuthVerificationMessageConfig.Builder getVerificationMessage() { return verificationMessage != null ? verificationMessage.toBuilder() : null; } public final void setVerificationMessage(CreateBackendAuthVerificationMessageConfig.BuilderImpl verificationMessage) { this.verificationMessage = verificationMessage != null ? verificationMessage.build() : null; } @Override public final Builder verificationMessage(CreateBackendAuthVerificationMessageConfig verificationMessage) { this.verificationMessage = verificationMessage; return this; } @Override public CreateBackendAuthUserPoolConfig build() { return new CreateBackendAuthUserPoolConfig(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy