mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
* 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
43 lines
1.4 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|