Add marker based pagination for get users methods - #759
Merged
Conversation
|
Verified that @sujaygarlanka has signed the CLA. Thanks for the pull request! |
… into users-marker-pagination merging changelog
PJSimon
reviewed
Dec 13, 2019
| [`getAllEnterpriseUsers(BoxAPIConnection api, boolean usemarker, String marker)`][get-all-enterprise-users], | ||
| [`getAllEnterpriseUsers(BoxAPIConnection api, String filterTerm, boolean usemarker, String marker, String... fields)`][get-all-enterprise-users-2], or | ||
| [`getAllEnterpriseOrExternalUsers(BoxAPIConnection api, String filterTerm, boolean usemarker, String marker, String... fields)`][get-all-enterprise-users-3] method. | ||
| To do marker pagination without passing in a marker, set the marker as `null`. In order to get the next marker, you must cast the iterable to `BoxResourseIterable<BoxUser.info>` |
Contributor
There was a problem hiding this comment.
Suggested change
| To do marker pagination without passing in a marker, set the marker as `null`. In order to get the next marker, you must cast the iterable to `BoxResourseIterable<BoxUser.info>` | |
| To get the first page of results, set the `String marker` parameter to `null`. In order to get the next page of results, you must first cast the returned object to `BoxResourseIterable<BoxUser.info>` |
| [`getAllEnterpriseUsers(BoxAPIConnection api, String filterTerm, boolean usemarker, String marker, String... fields)`][get-all-enterprise-users-2], or | ||
| [`getAllEnterpriseOrExternalUsers(BoxAPIConnection api, String filterTerm, boolean usemarker, String marker, String... fields)`][get-all-enterprise-users-3] method. | ||
| To do marker pagination without passing in a marker, set the marker as `null`. In order to get the next marker, you must cast the iterable to `BoxResourseIterable<BoxUser.info>` | ||
| and call `getNextMarker()` on that iterable. |
Contributor
There was a problem hiding this comment.
Suggested change
| and call `getNextMarker()` on that iterable. | |
| and call `getNextMarker()` on that object to get the next page's marker. Then, this marker can be set to the `String marker` parameter to get the next page of results, if there are any. If the marker returned from `getNextMarker()` is null, then there are no more pages of results. |
| Iterable<BoxUser.Info> users = BoxUser.getAllEnterpriseUsers(api, true, null); | ||
|
|
||
| // Get marker | ||
| ((BoxResourceIterable<BoxUser.Info>) users).getNextMarker(); |
Contributor
There was a problem hiding this comment.
Suggested change
| ((BoxResourceIterable<BoxUser.Info>) users).getNextMarker(); | |
| String marker = ((BoxResourceIterable<BoxUser.Info>) users).getNextMarker(); | |
| // Get next page | |
| users = BoxUser.getAllEnterpriseUsers(api, true, marker); |
| To get app user using external app user ID, call the | ||
| [`getAppUsersByExternalAppUserID(BoxAPIConnection api, String externalID, boolean usemarker, String marker, String... fields)`][get-app-users-by-external-app-user-id]. | ||
| This method allows you to easily associate Box app users with your application's | ||
| identifiers for those users. To do marker pagination without passing in a marker, set the marker as `null`. In order to get the next marker, you must cast the iterable to `BoxResourseIterable<BoxUser.info>` |
Contributor
There was a problem hiding this comment.
Suggested change
| identifiers for those users. To do marker pagination without passing in a marker, set the marker as `null`. In order to get the next marker, you must cast the iterable to `BoxResourseIterable<BoxUser.info>` | |
| identifiers for those users. To get the first page of results, set the `String marker` parameter to `null`. In order to get the next page of results, you must first cast the returned object to `BoxResourseIterable<BoxUser.info>` |
| [`getAppUsersByExternalAppUserID(BoxAPIConnection api, String externalID, boolean usemarker, String marker, String... fields)`][get-app-users-by-external-app-user-id]. | ||
| This method allows you to easily associate Box app users with your application's | ||
| identifiers for those users. To do marker pagination without passing in a marker, set the marker as `null`. In order to get the next marker, you must cast the iterable to `BoxResourseIterable<BoxUser.info>` | ||
| and call `getNextMarker()` on that iterable. |
Contributor
There was a problem hiding this comment.
Suggested change
| and call `getNextMarker()` on that iterable. | |
| and call `getNextMarker()` on that object to get the next page's marker. Then, this marker can be set to the `String marker` parameter to get the next page of results, if there are any. If the marker returned from `getNextMarker()` is null, then there are no more pages of results. |
Co-Authored-By: Patrick Simon <patrick@box.com>
PJSimon
approved these changes
Dec 14, 2019
PJSimon
reviewed
Dec 14, 2019
PJSimon
reviewed
Dec 14, 2019
PJSimon
reviewed
Dec 14, 2019
PJSimon
left a comment
Contributor
There was a problem hiding this comment.
Two small edits, other wise, APPROVED!
Co-Authored-By: Patrick Simon <patrick@box.com>
Co-Authored-By: Patrick Simon <patrick@box.com>
Pull Request Test Coverage Report for Build 2019
💛 - Coveralls |
PJSimon
approved these changes
Dec 14, 2019
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Link 🔗
Goals ⚽
Implementation Details 🚧
Testing Details 🔍