use of com.amazonaws.services.cognitoidentityprovider.model.AttributeType in project aws-sdk-android by aws-amplify.
the class AuthenticationDetails method setValidationData.
/**
* Set the name of the authentication challenge.
*
* @param validationData
*/
private void setValidationData(Map<String, String> validationData) {
if (validationData != null) {
this.validationData = new ArrayList<AttributeType>();
for (final Map.Entry<String, String> data : validationData.entrySet()) {
final AttributeType validation = new AttributeType();
validation.setName(data.getKey());
validation.setValue(data.getValue());
this.validationData.add(validation);
}
} else {
this.validationData = null;
}
}
use of com.amazonaws.services.cognitoidentityprovider.model.AttributeType in project aws-sdk-android by aws-amplify.
the class AWSMobileClientTest method checkDeviceAttribute.
/**
* Utility function that calls admin API to check the certain device attribute values.
*
* @param deviceKey the device that holds the attributes to be checked
* @param username the user that has the device
* @param attributeName the name of the attribute that will be checked
* @param attributeValue the value the named attribute should be set to when checked
*/
private void checkDeviceAttribute(final String deviceKey, final String username, final String attributeName, final String attributeValue) {
final AdminGetDeviceRequest adminGetDeviceRequest = new AdminGetDeviceRequest().withDeviceKey(deviceKey).withUsername(username).withUserPoolId(userPoolId);
final AdminGetDeviceResult adminGetDeviceResult = getUserpoolLL().adminGetDevice(adminGetDeviceRequest);
final List<AttributeType> deviceAttributes = adminGetDeviceResult.getDevice().getDeviceAttributes();
for (AttributeType attributeType : deviceAttributes) {
if (attributeType.getName().equals(attributeName)) {
assertEquals(attributeValue, attributeType.getValue());
return;
}
}
}
use of com.amazonaws.services.cognitoidentityprovider.model.AttributeType in project aws-sdk-android by aws-amplify.
the class AWSMobileClientTest method createUserViaAdminAPI.
private static void createUserViaAdminAPI(final String userpoolId, final String username, final String email) {
AdminCreateUserRequest request = new AdminCreateUserRequest().withUsername(username).withTemporaryPassword(TEMP_PASSWORD).withUserPoolId(userpoolId).withMessageAction(MessageActionType.SUPPRESS).withForceAliasCreation(true).withUserAttributes(new AttributeType().withName("email").withValue(email), new AttributeType().withName("email_verified").withValue("true"));
getUserpoolLL().adminCreateUser(request);
}
Aggregations