Search in sources :

Example 1 with UpdateUserRequest

use of com.amazonaws.services.identitymanagement.model.UpdateUserRequest in project aws-doc-sdk-examples by awsdocs.

the class UpdateUser method main.

public static void main(String[] args) {
    final String USAGE = "To run this example, supply the current username and a new\n" + "username. Ex:\n\n" + "UpdateUser <current-name> <new-name>\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String cur_name = args[0];
    String new_name = args[1];
    final AmazonIdentityManagement iam = AmazonIdentityManagementClientBuilder.defaultClient();
    UpdateUserRequest request = new UpdateUserRequest().withUserName(cur_name).withNewUserName(new_name);
    UpdateUserResult response = iam.updateUser(request);
    System.out.printf("Successfully updated user to username %s", new_name);
}
Also used : UpdateUserRequest(com.amazonaws.services.identitymanagement.model.UpdateUserRequest) AmazonIdentityManagement(com.amazonaws.services.identitymanagement.AmazonIdentityManagement) UpdateUserResult(com.amazonaws.services.identitymanagement.model.UpdateUserResult)

Aggregations

AmazonIdentityManagement (com.amazonaws.services.identitymanagement.AmazonIdentityManagement)1 UpdateUserRequest (com.amazonaws.services.identitymanagement.model.UpdateUserRequest)1 UpdateUserResult (com.amazonaws.services.identitymanagement.model.UpdateUserResult)1