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

Add extension method to fetch all the results #91

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

GerardSmit
Copy link
Contributor

Depends on #89. See 00b4f0d for only the changes of this PR.

client.Zones.GetAsync currently only gets the first page. If you want to get all the pages, you'll have to make your own implementation. This PR adds an extension method to fetch all pages of the results.

It has been implemented in:

  1. IZones
  2. IMembers
  3. ICertificates (added in Add support for Origin CA certificates #89)
  4. IAccounts

Example:

CloudFlareResult<IReadOnlyList<Zone>> zones = await client.Zones.GetAllAsync(zoneFilter);

// zones.Result contains the results of all the pages

using CloudFlare.Client.Api.Result;
using CloudFlare.Client.Client;

namespace CloudFlare.Client.Extensions;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if the namespace should be CloudFlare.Client instead of CloudFlare.Client.Extensions.

Repository owner deleted a comment from sonarqubecloud bot Jan 9, 2025
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.

1 participant