Search in sources :

Example 6 with InternalCallback

use of com.amazonaws.mobile.client.internal.InternalCallback in project aws-sdk-android by aws-amplify.

the class OAuth2Utils method confirmUpdateUserAttribute.

/**
 * Confirm the attribute with the code provided by user.
 * @param attributeName i.e. email
 * @param updateUserAttributeChallengeResponse i.e. 123456
 * @param callback callback
 */
@AnyThread
public void confirmUpdateUserAttribute(final String attributeName, final String updateUserAttributeChallengeResponse, final Callback<Void> callback) {
    InternalCallback internalCallback = new InternalCallback(callback);
    internalCallback.async(_confirmUserAttribute(attributeName, updateUserAttributeChallengeResponse, internalCallback));
}
Also used : InternalCallback(com.amazonaws.mobile.client.internal.InternalCallback) AnyThread(androidx.annotation.AnyThread)

Example 7 with InternalCallback

use of com.amazonaws.mobile.client.internal.InternalCallback in project aws-sdk-android by aws-amplify.

the class OAuth2Utils method updateUserAttributes.

/**
 * Sends a map of user attributes to update. If an attribute needs to
 * be verified, then the verification delivery information is returned.
 * @param userAttributes the attributes i.e. email
 * @param clientMetadata A map of custom key-value pairs that is passed to the lambda function for
 *                       custom workflow.
 * @param callback verification delivery information
 */
@AnyThread
public void updateUserAttributes(final Map<String, String> userAttributes, final Map<String, String> clientMetadata, final Callback<List<UserCodeDeliveryDetails>> callback) {
    InternalCallback internalCallback = new InternalCallback<List<UserCodeDeliveryDetails>>(callback);
    internalCallback.async(_updateUserAttributes(userAttributes, clientMetadata, internalCallback));
}
Also used : InternalCallback(com.amazonaws.mobile.client.internal.InternalCallback) CognitoUserCodeDeliveryDetails(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserCodeDeliveryDetails) UserCodeDeliveryDetails(com.amazonaws.mobile.client.results.UserCodeDeliveryDetails) AnyThread(androidx.annotation.AnyThread)

Example 8 with InternalCallback

use of com.amazonaws.mobile.client.internal.InternalCallback in project aws-sdk-android by aws-amplify.

the class OAuth2Utils method resendSignUp.

/**
 * Used when a user has attempted sign-up previously and wants to continue the process.
 * Note: If the user tries through the normal process with the same username, then it will
 * fail and this method is required.
 *
 * @param clientMetadata A map of custom key-value pairs that is passed to the lambda function for
 *                       custom workflow.
 * @param username
 * @param callback
 */
@AnyThread
public void resendSignUp(final String username, final Map<String, String> clientMetadata, final Callback<SignUpResult> callback) {
    final InternalCallback internalCallback = new InternalCallback<SignUpResult>(callback);
    internalCallback.async(_resendSignUp(username, clientMetadata, internalCallback));
}
Also used : InternalCallback(com.amazonaws.mobile.client.internal.InternalCallback) AnyThread(androidx.annotation.AnyThread)

Example 9 with InternalCallback

use of com.amazonaws.mobile.client.internal.InternalCallback in project aws-sdk-android by aws-amplify.

the class OAuth2Utils method confirmSignUp.

/**
 * Confirm the sign-up request with follow-up information
 *
 * @param username username/email address/handle of the user who is signing up
 * @param signUpChallengeResponse response to the signUp challenge posted
 * @param callback the callback will be invoked to notify the success or
 *                 failure of the confirmSignUp operation
 */
@AnyThread
public void confirmSignUp(final String username, final String signUpChallengeResponse, final Callback<SignUpResult> callback) {
    final InternalCallback internalCallback = new InternalCallback<SignUpResult>(callback);
    internalCallback.async(_confirmSignUp(username, signUpChallengeResponse, Collections.<String, String>emptyMap(), internalCallback));
}
Also used : InternalCallback(com.amazonaws.mobile.client.internal.InternalCallback) AnyThread(androidx.annotation.AnyThread)

Example 10 with InternalCallback

use of com.amazonaws.mobile.client.internal.InternalCallback in project aws-sdk-android by aws-amplify.

the class OAuth2Utils method changePassword.

@WorkerThread
public void changePassword(final String oldPassword, final String newPassword) throws Exception {
    final InternalCallback internalCallback = new InternalCallback<Void>();
    internalCallback.await(_changePassword(oldPassword, newPassword, internalCallback));
}
Also used : InternalCallback(com.amazonaws.mobile.client.internal.InternalCallback) WorkerThread(androidx.annotation.WorkerThread)

Aggregations

InternalCallback (com.amazonaws.mobile.client.internal.InternalCallback)19 AnyThread (androidx.annotation.AnyThread)18 WorkerThread (androidx.annotation.WorkerThread)1 UserCodeDeliveryDetails (com.amazonaws.mobile.client.results.UserCodeDeliveryDetails)1 CognitoUserCodeDeliveryDetails (com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserCodeDeliveryDetails)1