Issue #309: Added user listing

This commit is contained in:
Kohsuke Kawaguchi
2016-11-16 18:26:43 -08:00
parent 1c162c6390
commit 818f6dc045
2 changed files with 28 additions and 0 deletions

View File

@@ -392,6 +392,23 @@ public class GitHub {
};
}
/**
* Returns a list of all users.
*/
public PagedIterable<GHUser> listUsers() throws IOException {
return new PagedIterable<GHUser>() {
public PagedIterator<GHUser> _iterator(int pageSize) {
return new PagedIterator<GHUser>(retrieve().asIterator("/users", GHUser[].class, pageSize)) {
@Override
protected void wrapUp(GHUser[] page) {
for (GHUser u : page)
u.wrapUp(GitHub.this);
}
};
}
};
}
/**
* Returns the full details for a license
*