using System; using System.Collections.Generic; 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 /// /// 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); /// /// Create a new . /// /// Information about the new authorization to create /// IObservable Create(NewAuthorization newAuthorization); /// /// 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); } }