Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List team members, single page or all (with helper for auto-pagination) #192

Merged
merged 5 commits into from
Feb 12, 2020

Conversation

mwhite-ibm
Copy link
Contributor

What?

This PR adds:

  • ListMembers: Method to get a single page from the members endpoint (/teams/<ID>/members).
  • pagedGet: Helper for stepping through all available pages of a base endpoint GET request.
  • ListAllMembers: Uses pagedGet to get all members.

Why?

Re. ListMembers: The /teams/<ID>/members endpoint is not currently accessible via the client package.

  • This is helpful for retrieving team role information.

Re. pagedGet + ListAllMembers: All List* methods only return a single page of data.

  • pagedGet allows one to make a single method call to get all members.
  • This can be extended to the other List* methods to create ListAll*.

@mwhite-ibm
Copy link
Contributor Author

@stmcallister : I've merged with master and modified my tests to use setup and teardown.

Please let me know what other changes you would like, thanks!

Copy link
Contributor

@stmcallister stmcallister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for this feature! I think we'll be able to use the getPaged function on other objects!

@stmcallister stmcallister merged commit 5fd6151 into PagerDuty:master Feb 12, 2020
@mwhite-ibm
Copy link
Contributor Author

@stmcallister Great, happy to contribute it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants