public static void main(String[] args) { final String USAGE = "To run this example, supply an IAM username\n" + "Ex: ListAccessKeys <username>\n"; if (args.length != 1) { System.out.println(USAGE); System.exit(1); } String username = args[0]; final AmazonIdentityManagement iam = AmazonIdentityManagementClientBuilder.defaultClient(); boolean done = false; ListAccessKeysRequest request = new ListAccessKeysRequest() .withUserName(username); while (!done) { ListAccessKeysResult response = iam.listAccessKeys(request); for (AccessKeyMetadata metadata : response.getAccessKeyMetadata()) { System.out.format("Retrieved access key %s", metadata.getAccessKeyId()); } request.setMarker(response.getMarker()); if (!response.getIsTruncated()) { done = true; } } }
@Override public AccessKeyCollection getAccessKeys(ListAccessKeysRequest request) { ResourceCollectionImpl result = resource.getCollection("AccessKeys", request); if (result == null) return null; return new AccessKeyCollectionImpl(result); }
/** * Retrieves the AccessKeys collection referenced by this resource. */ AccessKeyCollection getAccessKeys(ListAccessKeysRequest request);