Skip to content

Instantly share code, notes, and snippets.

@joshuacalloway
Last active July 26, 2016 21:56
Show Gist options
  • Save joshuacalloway/32cca4b85e63582740fd043247177694 to your computer and use it in GitHub Desktop.
Save joshuacalloway/32cca4b85e63582740fd043247177694 to your computer and use it in GitHub Desktop.
aws identitymanagement paginate
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