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

Added Cursor Based Pagination support for get tickets #285

Merged

Conversation

JinHuangAtZen
Copy link
Contributor

@JinHuangAtZen JinHuangAtZen commented Sep 20, 2023

  1. Added Cursor Based Pagination support for get tickets method
  2. Added Iterator for get tickets, by default, the iterator will use CBP to retrieve tickets.

Example to use the Iterator:

    ops := zendesk.NewPaginationOptions()
it := client.GetTicketsEx(context.Background(), ops)

for it.HasMore() {
	tickets, err := it.GetNext()
	if err == nil {
		for _, ticket := range tickets {
			println(ticket.Subject)
		}
	}
}

@nukosuke nukosuke merged commit 1684b1d into nukosuke:master Sep 20, 2023
@nukosuke
Copy link
Owner

Thank you!
v0.17.0 has been released.

@cryptomail
Copy link

More to come....we will need to iterate across all objects!

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.

3 participants