using System; using System.Collections.Generic; using Octokit.Models.Request.Enterprise; namespace Octokit.AsyncPaginationExtension { /// /// Provides all extensions for pagination. /// /// /// The pageSize parameter at the end of all methods allows for specifying the amount of elements to be fetched per page. /// Only useful to optimize the amount of API calls made. /// public static class Extensions { private const int DEFAULT_PAGE_SIZE = 30; /// public static IPaginatedList GetAllAsync(this IApiConnection t, Uri uri, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(uri, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IApiConnection t, Uri uri, IDictionary parameters, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(uri, parameters, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IApiConnection t, Uri uri, IDictionary parameters, string accepts, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(uri, parameters, accepts, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IIssueCommentsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IIssueCommentsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IIssueCommentsClient t, string owner, string name, IssueCommentRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IIssueCommentsClient t, long repositoryId, IssueCommentRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForIssueAsync(this IIssueCommentsClient t, string owner, string name, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForIssue(owner, name, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForIssueAsync(this IIssueCommentsClient t, long repositoryId, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForIssue(repositoryId, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForIssueAsync(this IIssueCommentsClient t, string owner, string name, int issueNumber, IssueCommentRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForIssue(owner, name, issueNumber, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForIssueAsync(this IIssueCommentsClient t, long repositoryId, int issueNumber, IssueCommentRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForIssue(repositoryId, issueNumber, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IRepositoryPagesClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IRepositoryPagesClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllWatchersAsync(this IWatchedClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllWatchers(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllWatchersAsync(this IWatchedClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllWatchers(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForCurrentAsync(this IWatchedClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForUserAsync(this IWatchedClient t, string user, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForUser(user, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForCurrentAsync(this INotificationsClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForCurrentAsync(this INotificationsClient t, NotificationsRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForCurrent(request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this INotificationsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this INotificationsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this INotificationsClient t, string owner, string name, NotificationsRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this INotificationsClient t, long repositoryId, NotificationsRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForIssueAsync(this IIssueTimelineClient t, string owner, string repo, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForIssue(owner, repo, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForIssueAsync(this IIssueTimelineClient t, long repositoryId, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForIssue(repositoryId, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllLicensesAsync(this IMiscellaneousClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAllLicenses, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IIssueReactionsClient t, string owner, string name, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IIssueReactionsClient t, long repositoryId, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IRepositoryDeployKeysClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IRepositoryDeployKeysClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IEventsClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAll, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IEventsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IEventsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllIssuesForRepositoryAsync(this IEventsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllIssuesForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllIssuesForRepositoryAsync(this IEventsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllIssuesForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryNetworkAsync(this IEventsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepositoryNetwork(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForOrganizationAsync(this IEventsClient t, string organization, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForOrganization(organization, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllUserReceivedAsync(this IEventsClient t, string user, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllUserReceived(user, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllUserReceivedPublicAsync(this IEventsClient t, string user, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllUserReceivedPublic(user, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllUserPerformedAsync(this IEventsClient t, string user, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllUserPerformed(user, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllUserPerformedPublicAsync(this IEventsClient t, string user, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllUserPerformedPublic(user, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForAnOrganizationAsync(this IEventsClient t, string user, string organization, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForAnOrganization(user, organization, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList ListAllRunnerApplicationsForEnterpriseAsync(this IActionsSelfHostedRunnersClient t, string enterprise, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.ListAllRunnerApplicationsForEnterprise(enterprise, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList ListAllRunnerApplicationsForOrganizationAsync(this IActionsSelfHostedRunnersClient t, string organization, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.ListAllRunnerApplicationsForOrganization(organization, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList ListAllRunnerApplicationsForRepositoryAsync(this IActionsSelfHostedRunnersClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.ListAllRunnerApplicationsForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IMilestonesClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IMilestonesClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IMilestonesClient t, string owner, string name, MilestoneRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IMilestonesClient t, long repositoryId, MilestoneRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForCurrentAsync(this IUserGpgKeysClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IUserEmailsClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAll, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IRepoCollaboratorsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IRepoCollaboratorsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IRepoCollaboratorsClient t, string owner, string name, RepositoryCollaboratorListRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IRepoCollaboratorsClient t, long repositoryId, RepositoryCollaboratorListRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IProjectColumnsClient t, int projectId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(projectId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IAuthorizationsClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAll, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IAssigneesClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IAssigneesClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IOrganizationCustomPropertyValuesClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IDeploymentStatusClient t, string owner, string name, long deploymentId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, deploymentId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IDeploymentStatusClient t, long repositoryId, long deploymentId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, deploymentId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForCurrentAsync(this IFollowersClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IFollowersClient t, string login, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(login, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllFollowingForCurrentAsync(this IFollowersClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAllFollowingForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllFollowingAsync(this IFollowersClient t, string login, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllFollowing(login, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this ITeamsClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForCurrentAsync(this ITeamsClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllChildTeamsAsync(this ITeamsClient t, long id, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllChildTeams(id, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllMembersAsync(this ITeamsClient t, long id, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllMembers(id, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllMembersAsync(this ITeamsClient t, long id, TeamMembersRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllMembers(id, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllRepositoriesAsync(this ITeamsClient t, long id, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllRepositories(id, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllPendingInvitationsAsync(this ITeamsClient t, long id, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllPendingInvitations(id, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllInstallationsForCurrentAsync(this IGitHubAppsClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAllInstallationsForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForOrgAsync(this IPackagesClient t, string org, PackageType packageType, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForOrg(org, packageType, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForOrgAsync(this IPackagesClient t, string org, PackageType packageType, PackageVisibility? packageVisibility, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForOrg(org, packageType, packageVisibility, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForActiveUserAsync(this IPackagesClient t, PackageType packageType, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForActiveUser(packageType, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForActiveUserAsync(this IPackagesClient t, PackageType packageType, PackageVisibility? packageVisibility, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForActiveUser(packageType, packageVisibility, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForUserAsync(this IPackagesClient t, string username, PackageType packageType, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForUser(username, packageType, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForUserAsync(this IPackagesClient t, string username, PackageType packageType, PackageVisibility? packageVisibility, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForUser(username, packageType, packageVisibility, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllLicensesAsync(this ILicensesClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAllLicenses, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IOrganizationMembersClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IOrganizationMembersClient t, string org, OrganizationMembersFilter filter, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, filter, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IOrganizationMembersClient t, string org, OrganizationMembersRole role, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, role, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IOrganizationMembersClient t, string org, OrganizationMembersFilter filter, OrganizationMembersRole role, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, filter, role, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllPublicAsync(this IOrganizationMembersClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllPublic(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllPendingInvitationsAsync(this IOrganizationMembersClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllPendingInvitations(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllFailedInvitationsAsync(this IOrganizationMembersClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllFailedInvitations(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllOrganizationMembershipsForCurrentAsync(this IOrganizationMembersClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAllOrganizationMembershipsForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForCurrentAsync(this IOrganizationsClient t, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForUserAsync(this IOrganizationsClient t, string user, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForUser(user, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAuthorizationsAsync(this IOrganizationsClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllAuthorizations(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAuthorizationsAsync(this IOrganizationsClient t, string org, string login, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllAuthorizations(org, login, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAnnotationsAsync(this ICheckRunsClient t, string owner, string name, long checkRunId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllAnnotations(owner, name, checkRunId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAnnotationsAsync(this ICheckRunsClient t, long repositoryId, long checkRunId, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllAnnotations(repositoryId, checkRunId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList