mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-01 18:35:35 +00:00
feat: Adds cancel invitation
* Added api request to cancel an organization invitation * Added tests --------- Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>
This commit is contained in:
@@ -363,7 +363,19 @@ namespace Octokit.Reactive
|
||||
/// <param name="options">Options to change API behaviour</param>
|
||||
/// <returns></returns>
|
||||
IObservable<OrganizationMembershipInvitation> GetAllFailedInvitations(string org, ApiOptions options);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://docs.github.com/en/rest/orgs/members#cancel-an-organization-invitation">API Documentation</a>
|
||||
/// for more information.
|
||||
/// </remarks>
|
||||
/// <param name="org">The login for the organization</param>
|
||||
/// <param name="invitationId">The unique identifier of the invitation</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> CancelOrganizationInvitation(string org, int invitationId);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="OrganizationMembership" />s for the current user.
|
||||
/// </summary>
|
||||
|
||||
@@ -507,6 +507,25 @@ namespace Octokit.Reactive
|
||||
return _connection.GetAndFlattenAllPages<OrganizationMembershipInvitation>(ApiUrls.OrganizationFailedInvitations(org), null, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://docs.github.com/en/rest/orgs/members#cancel-an-organization-invitation">API Documentation</a>
|
||||
/// for more information.
|
||||
/// </remarks>
|
||||
/// <param name="org">The login for the organization</param>
|
||||
/// <param name="invitationId">The unique identifier of the invitation</param>
|
||||
/// <returns></returns>
|
||||
[ManualRoute("DELETE", "/orgs/{org}/invitations/{invitation_id}")]
|
||||
public IObservable<Unit> CancelOrganizationInvitation(string org, int invitationId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
|
||||
Ensure.ArgumentNotNullOrDefault(invitationId, nameof(invitationId));
|
||||
|
||||
return _client.CancelOrganizationInvitation(org, invitationId).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="OrganizationMembership" />s for the current user.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user