mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-08 12:42:32 +00:00
List pending organization / team invitations (#1640)
* Add methods for listing pending organization invites * Add unit/integration tests * Add methods for getting all pending invites for a team * Add unit/integration tests * 🔥 whitespace 🔥 * Move new enum to it's own correct file and location * Invite(s) -> Invitation(s) * Add helper functions for adding invitations and cleaning the invitations up at the end of the test * Add methods with ApiOptions * Fix helper methods for adding/removing invitations * Forgot to actually pass in the ApiOptions to the API call * Add tests for new ApiOptions methods * tweak integration tests * Update outside collaborator tests to use [OrganizationTest] attribute for consistency * Update test accounts used * use octokitnet-test2 account now it has 2FA turned on
This commit is contained in:
committed by
Ryan Gribble
parent
b0ff506ab3
commit
7c170213fd
@@ -375,5 +375,39 @@ namespace Octokit.Reactive
|
||||
|
||||
return _client.Conceal(org, user).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List all pending invitations for the organization.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/orgs/members/#list-pending-organization-invitations">API Documentation</a>
|
||||
/// for more information.
|
||||
/// </remarks>
|
||||
/// <param name="org">The login for the organization</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<OrganizationMembershipInvitation> GetAllPendingInvitations(string org)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
|
||||
|
||||
return GetAllPendingInvitations(org, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List all pending invitations for the organization.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/orgs/members/#list-pending-organization-invitations">API Documentation</a>
|
||||
/// for more information.
|
||||
/// </remarks>
|
||||
/// <param name="org">The login for the organization</param>
|
||||
/// <param name="options">Options to change API behaviour</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<OrganizationMembershipInvitation> GetAllPendingInvitations(string org, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return _connection.GetAndFlattenAllPages<OrganizationMembershipInvitation>(ApiUrls.OrganizationPendingInvititations(org), null, AcceptHeaders.OrganizationMembershipPreview, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user