using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Reactive; namespace Octokit.Reactive { public interface IObservableAuthorizationsClient { [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "It's an API call, so it's not a property.")] IObservable> GetAll(); [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. /// /// 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, AuthorizationUpdate authorization); /// /// 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. /// /// 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 two-factor code is not /// valid. /// IObservable GetOrCreateApplicationAuthentication( string clientId, string clientSecret, AuthorizationUpdate authorization, string twoFactorAuthenticationCode); IObservable Update(int id, AuthorizationUpdate authorization); IObservable Create(AuthorizationUpdate authorization); IObservable Delete(int id); } }