Files
octokit.net/Octokit/Helpers/ApiUrls.Authorizations.cs
Nick Floyd 6565a07974 [BREAKING CHANGES]: int to long Ids for PreReceiveHook, Deployment Environments, Repository, Org Team, Repo Invitations, Public Key, Project Cards, Organization Invitation, Migrations, GpgKey, Deployment, Authorizations, Accounts / Profiles, Codespace / Workspaces (#2941)
* Fixes ids for Releases, Collaborators, and Contributors

* updates the interface for releases

* update the obverable release client

* updates ids from int to long based on GH database schema

* converts a test condition to use the proper type

* updates generated paging and observable classes
2024-06-26 10:57:30 -05:00

43 lines
1.4 KiB
C#

using System;
namespace Octokit
{
public static partial class ApiUrls
{
static readonly Uri _currentUserAuthorizationsEndpoint = new Uri("authorizations", UriKind.Relative);
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the authorizations for the currently logged in user.
/// </summary>
public static Uri Authorizations()
{
return _currentUserAuthorizationsEndpoint;
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all authorizations for a given user
/// </summary>
/// <param name="id">The user Id to search for</param>
public static Uri Authorizations(long id)
{
return "authorizations/{0}".FormatUri(id);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all authorizations for a given client
/// </summary>
/// <param name="clientId">
/// The 20 character OAuth app client key for which to create the token.
/// </param>
public static Uri AuthorizationsForClient(string clientId)
{
return "authorizations/clients/{0}".FormatUri(clientId);
}
public static Uri ApplicationAuthorization(string clientId)
{
return "applications/{0}/token".FormatUri(clientId);
}
}
}