mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-05 23:06:10 +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:
@@ -370,6 +370,18 @@ namespace Octokit
|
||||
/// <returns></returns>
|
||||
Task<IReadOnlyList<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>
|
||||
Task CancelOrganizationInvitation(string org, int invitationId);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="OrganizationMembership" />s for the current user.
|
||||
/// </summary>
|
||||
|
||||
@@ -604,6 +604,25 @@ namespace Octokit
|
||||
return ApiConnection.GetAll<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 Task CancelOrganizationInvitation(string org, int invitationId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
|
||||
Ensure.ArgumentNotNullOrDefault(invitationId, nameof(invitationId));
|
||||
|
||||
return ApiConnection.Delete(ApiUrls.CancelOrganizationInvitation(org, invitationId));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="OrganizationMembership" />s for the current user.
|
||||
/// </summary>
|
||||
|
||||
@@ -943,6 +943,17 @@ namespace Octokit
|
||||
return "orgs/{0}/failed_invitations".FormatUri(org);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> to cancel an organization invitation
|
||||
/// </summary>
|
||||
/// <param name="org">The name of the organization</param>
|
||||
/// <param name="invitationId">The unique identifier of the invitation</param>
|
||||
/// <returns></returns>
|
||||
public static Uri CancelOrganizationInvitation(string org, int invitationId)
|
||||
{
|
||||
return "orgs/{0}/invitations/{1}".FormatUri(org, invitationId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> that returns all of the outside collaborators of the organization
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user