/* * Copyright 2018-2018 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. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License 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.mobile.client.results; /** * The result of a sign up action. Check the confirmation state and delivery details to proceed. */ public final class SignUpResult { private final boolean signUpConfirmationState; private final UserCodeDeliveryDetails cognitoUserCodeDeliveryDetails; private final String userSub; public SignUpResult(boolean signUpConfirmationState, UserCodeDeliveryDetails cognitoUserCodeDeliveryDetails, String userSub) { this.signUpConfirmationState = signUpConfirmationState; this.cognitoUserCodeDeliveryDetails = cognitoUserCodeDeliveryDetails; this.userSub = userSub; } public String getUserSub() { return this.userSub; } /** * if true, no further action is necessary * @return true - user is confirmed, no further action is necessary * false - check delivery details and call confirmSignUp */ public boolean getConfirmationState() { return this.signUpConfirmationState; } /** * Determine where the confirmation code was sent * @return details of confirmation code delivery */ public UserCodeDeliveryDetails getUserCodeDeliveryDetails() { return this.cognitoUserCodeDeliveryDetails; } }