Last active
July 26, 2016 21:56
-
-
Save joshuacalloway/32cca4b85e63582740fd043247177694 to your computer and use it in GitHub Desktop.
aws identitymanagement paginate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ListUsersRequest request = new ListUsersRequest() | |
request.setMaxItems(20) | |
boolean moreUsers = true | |
List<User> users = new ArrayList<>() | |
while (moreUsers) { | |
ListUsersResult result = client.listUsers(request) | |
request.setMarker(result.getMarker()) | |
users.addAll(result.getUsers()) | |
moreUsers = result.isTruncated() | |
} | |
println users.size() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment