mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-08 12:42:32 +00:00
Add pagination support to repository invitation. (#1692)
* Add ApiOptions overloads to repository invitations. * Remove ExcludeFromPaginationApiOptionsConvention for RepositoryInvitationsClient * Adjust tests to new call form. * Add null check and null check test for RepositoryInvitations. * Add integration tests draft. * Remove redundant using. * Replace Octocat with dual account test second user. * Fix mass repository creation by making it synchronous and fix last RepositoryInvitationsClient test utilizing Octokit user. * Refactor async hack. * Reduce number of created test repos.
This commit is contained in:
committed by
Ryan Gribble
parent
e1b6434832
commit
01d16b7c12
@@ -80,7 +80,20 @@ namespace Octokit.Reactive
|
||||
/// </remarks>
|
||||
public IObservable<RepositoryInvitation> GetAllForCurrent()
|
||||
{
|
||||
return _connection.GetAndFlattenAllPages<RepositoryInvitation>(ApiUrls.UserInvitations(), null, AcceptHeaders.InvitationsApiPreview, ApiOptions.None);
|
||||
return GetAllForCurrent(ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all invitations for the current user.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/invitations/#list-a-users-repository-invitations">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
public IObservable<RepositoryInvitation> GetAllForCurrent(ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
return _connection.GetAndFlattenAllPages<RepositoryInvitation>(ApiUrls.UserInvitations(), null, AcceptHeaders.InvitationsApiPreview, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -92,7 +105,21 @@ namespace Octokit.Reactive
|
||||
/// <param name="repositoryId">The id of the repository</param>
|
||||
public IObservable<RepositoryInvitation> GetAllForRepository(long repositoryId)
|
||||
{
|
||||
return _connection.GetAndFlattenAllPages<RepositoryInvitation>(ApiUrls.RepositoryInvitations(repositoryId), null, AcceptHeaders.InvitationsApiPreview, ApiOptions.None);
|
||||
return GetAllForRepository(repositoryId, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all the invitations on a repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/invitations/#list-invitations-for-a-repository">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The id of the repository</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
public IObservable<RepositoryInvitation> GetAllForRepository(long repositoryId, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
return _connection.GetAndFlattenAllPages<RepositoryInvitation>(ApiUrls.RepositoryInvitations(repositoryId), null, AcceptHeaders.InvitationsApiPreview, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user