using System.Threading;
using System.Threading.Tasks;
namespace SpotifyAPI.Web
{
///
/// An OAuth Client, which allows to get inital and updated tokens from the Spotify Service
///
public interface IOAuthClient
{
///
/// Requests a new token using client_ids and client_secrets.
/// If the token is expired, simply call the funtion again to get a new token
///
/// The request-model which contains required and optional parameters.
/// The cancellation-token to allow to cancel the request.
///
/// https://developer.spotify.com/documentation/general/guides/authorization-guide/#client-credentials-flow
///
///
Task RequestToken(ClientCredentialsRequest request, CancellationToken cancel = default);
///
/// Refresh an already received token via Authorization Code Auth
///
/// The request-model which contains required and optional parameters.
/// The cancellation-token to allow to cancel the request.
///
/// https://developer.spotify.com/documentation/general/guides/authorization-guide/#authorization-code-flow
///
///
Task RequestToken(AuthorizationCodeRefreshRequest request, CancellationToken cancel = default);
///
/// Reequest an initial token via Authorization Code Auth
///
/// The request-model which contains required and optional parameters.
/// The cancellation-token to allow to cancel the request.
///
/// https://developer.spotify.com/documentation/general/guides/authorization-guide/#authorization-code-flow
///
///
Task RequestToken(AuthorizationCodeTokenRequest request, CancellationToken cancel = default);
///
/// Swaps out a received code with a access token using a remote server
///
/// The request-model which contains required and optional parameters.
/// The cancellation-token to allow to cancel the request.
///
/// https://developer.spotify.com/documentation/ios/guides/token-swap-and-refresh/
///
///
Task RequestToken(TokenSwapTokenRequest request, CancellationToken cancel = default);
///
/// Gets a refreshed access token using an already received refresh token using a remote server
///
///
/// The cancellation-token to allow to cancel the request.
///
/// https://developer.spotify.com/documentation/ios/guides/token-swap-and-refresh/
///
///
Task RequestToken(TokenSwapRefreshRequest request, CancellationToken cancel = default);
}
}