Skip to content

Commit

Permalink
feature: updates built-in pagination support doc section (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
phpinhei-te authored Oct 10, 2024
1 parent f8d870e commit e9ea1d5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,10 @@ The `Paginator` class will automatically handle API errors and stop iterating if
## Built-in Pagination Support
Some APIs have built-in support for pagination, the API class exposes a method that will return the `Paginator` object for you. For example, the `EndpointAgentsApi` class has a `getEndpointAgentsPaginated` method that returns a `Paginator` object for fetching paginated endpoint agents.


### Example
```java
public Paginator<EndpointAgent, ListEndpointAgentsResponse> getEndpointAgentsPaginated(Integer max, String aid, List<ExpandEndpointAgentOptions> expand, Boolean includeDeleted, Boolean useAllPermittedAids, String agentName, String computerName) {
return new Paginator<>(cursor -> getEndpointAgents(max, cursor, aid, expand, includeDeleted, useAllPermittedAids, agentName, computerName),
ListEndpointAgentsResponse::getAgents);
}
```

0 comments on commit e9ea1d5

Please sign in to comment.