Comments (3)
I've implemented a quick and easy solution to bring back pagination in v11:
clementdenis@6879127?w=1
The idea is to wrap List<> responses with pagination info (self / next link headers) in a PagedList instance (I just brought back the class from v10, but made it extend ArrayList).
Paginating is done this way:
UserApi userApi = new UserApi(client);
int limit = 2;
List<User> pagedUserList = null;
do {
pagedUserList = userApi.listUsers(null, PagedList.getAfter(pagedUserList), limit, null, null, null, null);
//pagedUserList can also be casted to a PagedList instance
// loop through all of them
for (User tmpUser : pagedUserList.getItems()) {
log.info("User: {}", tmpUser.getProfile().getEmail());
}
} while (PagedList.hasMoreResults(pagedUserList));
Feel free to use this code, or I can create a PR if you prefer.
PS: I took the liberty of reformating ApiClient.mustache properly, it's much easier to add changes that way.
from okta-sdk-java.
@clementdenis Thanks, I'll create a PR for Pagination shortly.
from okta-sdk-java.
PR merged to master, will cut a new major release in a week.
from okta-sdk-java.
Related Issues (20)
- Several outdated dependencies
- OpenAPI spec missing some default role type HOT 3
- Invalid session HOT 3
- IdpPolicyRuleActionProvider needs the ability to set the provider id to be useful for creating IDP Routing Rules HOT 4
- Private Key is interpreted as PEMKeyPair instead of PrivateKeyInfo HOT 3
- Consistently thrown NoHttpResponseException's in 13.0.3 HOT 6
- UserApi#listUserGroups() doesn't support pagination HOT 4
- UserApi: listUserGroups() does not return more than 200 groups for a user HOT 1
- Question about thread safety of `PaginationUtil` HOT 3
- Support Apple as an IdentityProviderType HOT 4
- Update Application User returns E0000009 with no message HOT 1
- Jar for package in Maven corrupted
- JsonWebKey does not provide public accessor for x5c list in 18.0.0 HOT 1
- Missing JsonWebKey.setX5c() method in 18.0.0 HOT 4
- Okta List factor discrepancy between API and Admin console HOT 4
- Provide a way to get a User resource from a UserGetSingleton resource now returned by UserAPI.getUser(id, expand) in 18.0.0 HOT 6
- listGroupUsers() ignores the search option. HOT 2
- Default configurations are not loaded from okta.properties resource file HOT 1
- Unable to specify FEDERATION AuthenticationProvider HOT 1
- Unable to renew access token for API client
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from okta-sdk-java.