Implement pagination on Organization Outside Collaborators Client GetAll() method (#1650)

* Reimplement ApiOptions overloads

* Unskip pagination tests and set page sizes correctly
This commit is contained in:
Ryan Gribble
2017-08-10 06:07:18 +10:00
committed by GitHub
parent 635b42d735
commit b0ff506ab3
8 changed files with 535 additions and 10 deletions
@@ -36,7 +36,26 @@ namespace Octokit
{
Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
return ApiConnection.GetAll<User>(ApiUrls.OutsideCollaborators(org), null, AcceptHeaders.OrganizationMembershipPreview);
return GetAll(org, ApiOptions.None);
}
/// <summary>
/// List all users who are outside collaborators of an organization. An outside collaborator is a user that
/// is not a member of the organization.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/outside_collaborators/#list-outside-collaborators">API documentation</a>
/// for more information.
/// </remarks>
/// <param name="org">The login for the organization</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The users</returns>
public Task<IReadOnlyList<User>> GetAll(string org, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
Ensure.ArgumentNotNull(options, nameof(options));
return ApiConnection.GetAll<User>(ApiUrls.OutsideCollaborators(org), null, AcceptHeaders.OrganizationMembershipPreview, options);
}
/// <summary>
@@ -54,7 +73,27 @@ namespace Octokit
{
Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
return ApiConnection.GetAll<User>(ApiUrls.OutsideCollaborators(org, filter), null, AcceptHeaders.OrganizationMembershipPreview);
return GetAll(org, filter, ApiOptions.None);
}
/// <summary>
/// List all users who are outside collaborators of an organization. An outside collaborator is a user that
/// is not a member of the organization.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/outside_collaborators/#list-outside-collaborators">API documentation</a>
/// for more information.
/// </remarks>
/// <param name="org">The login for the organization</param>
/// <param name="filter">The filter to use when getting the users, <see cref="OrganizationMembersFilter"/></param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The users</returns>
public Task<IReadOnlyList<User>> GetAll(string org, OrganizationMembersFilter filter, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
Ensure.ArgumentNotNull(options, nameof(options));
return ApiConnection.GetAll<User>(ApiUrls.OutsideCollaborators(org, filter), null, AcceptHeaders.OrganizationMembershipPreview, options);
}
/// <summary>