using System;
using System.Diagnostics.CodeAnalysis;
using System.Reactive;
namespace Octokit.Reactive
{
public interface IObservableAuthorizationsClient
{
///
/// Get all s for the authenticated user. This method requires basic auth.
///
///
/// See API documentation for more
/// details.
///
/// An
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate",
Justification = "It's an API call, so it's not a property.")]
IObservable GetAll();
///
/// Get a specific for the authenticated user. This method requires basic auth.
///
///
/// See API documentation for
/// more details.
///
/// The id of the
/// An
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "It's fiiiine. It's fine. Trust us.")]
IObservable Get(int id);
///
/// This method will create a new authorization for the specified OAuth application, only if an authorization
/// for that application doesn’t already exist for the user. It returns the user’s token for the application
/// if one exists. Otherwise, it creates one.
///
///
/// See API
/// documentation for more details.
///
/// Client ID for the OAuth application that is requesting the token
/// The client secret
/// Defines the scopes and metadata for the token
/// Thrown when the user does not have permission to make
/// this request. Check
/// Thrown when the current account has two-factor
/// authentication enabled.
///
IObservable GetOrCreateApplicationAuthentication(
string clientId,
string clientSecret,
NewAuthorization newAuthorization);
///
/// This method will create a new authorization for the specified OAuth application, only if an authorization
/// for that application doesn’t already exist for the user. It returns the user’s token for the application
/// if one exists. Otherwise, it creates one.
///
///
/// See API
/// documentation for more details.
///
/// Client ID for the OAuth application that is requesting the token
/// The client secret
/// Defines the scopes and metadata for the token
/// The two-factor authentication code provided by the user
/// Thrown when the user does not have permission to make
/// this request. Check
/// Thrown when the two-factor code is not
/// valid.
///
IObservable GetOrCreateApplicationAuthentication(
string clientId,
string clientSecret,
NewAuthorization newAuthorization,
string twoFactorAuthenticationCode);
///
/// Checks the validity of an OAuth token without running afoul of normal rate limits for failed login attempts.
///
///
/// This method requires authentication.
/// See the API documentation for more information.
///
/// Client ID of the OAuth application for the token
/// The OAuth token to check
/// The valid .
IObservable CheckApplicationAuthentication(string clientId, string accessToken);
///
/// Resets a valid OAuth token for an OAuth application without end user involvment.
///
///
/// This method requires authentication.
/// See the API documentation for more information.
///
/// ClientID of the OAuth application for the token
/// The OAuth token to reset
/// The valid with a new OAuth token
IObservable ResetApplicationAuthentication(string clientId, string accessToken);
///
/// Revokes a single OAuth token for an OAuth application.
///
///
/// This method requires authentication.
/// See the API documentation for more information.
///
/// ClientID of the OAuth application for the token
/// The OAuth token to revoke
///
IObservable RevokeApplicationAuthentication(string clientId, string accessToken);
///
/// Revokes every OAuth token for an OAuth application.
///
///
/// This method requires authentication.
/// See the API documentation for more information.
///
/// ClientID of the OAuth application for the token
///
IObservable RevokeAllApplicationAuthentications(string clientId);
///
/// Update the specified by the id.
///
/// The id of the
/// The changes to make to the authorization
///
IObservable Update(int id, AuthorizationUpdate authorizationUpdate);
///
/// Deletes an .
///
/// The systemwide id of the authorization
///
IObservable Delete(int id);
}
}