using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using SpotifyAPI.Web.Http;
namespace SpotifyAPI.Web
{
public interface ISpotifyClient
{
///
/// The default paginator used by the Paginator methods
///
///
IPaginator DefaultPaginator { get; }
///
/// Operations related to Spotify User Profiles
///
///
IUserProfileClient UserProfile { get; }
///
/// Operations related to Spotify Browse Endpoints
///
///
IBrowseClient Browse { get; }
///
/// Operations related to Spotify Shows
///
///
IShowsClient Shows { get; }
///
/// Operations related to Spotify Playlists
///
///
IPlaylistsClient Playlists { get; }
///
/// Operations related to Spotify Search
///
///
ISearchClient Search { get; }
///
/// Operations related to Spotify Follows
///
///
IFollowClient Follow { get; }
///
/// Operations related to Spotify Tracks
///
///
ITracksClient Tracks { get; }
///
/// Operations related to Spotify Player Endpoints
///
///
IPlayerClient Player { get; }
///
/// Operations related to Spotify Albums
///
///
IAlbumsClient Albums { get; }
///
/// Operations related to Spotify Artists
///
///
IArtistsClient Artists { get; }
///
/// Operations related to Spotify Personalization Endpoints
///
///
IPersonalizationClient Personalization { get; }
///
/// Operations related to Spotify Podcast Episodes
///
///
IEpisodesClient Episodes { get; }
///
/// Operations related to Spotify User Library
///
///
ILibraryClient Library { get; }
///
/// Returns the last response received by an API call.
///
///
IResponse? LastResponse { get; }
///
/// Fetches all pages and returns them grouped in a list.
/// The default paginator will fetch all available resources without a delay between requests.
/// This can drain your request limit quite fast, so consider using a custom paginator with delays.
///
/// The first page, will be included in the output list!
/// Optional. If not supplied, DefaultPaginator will be used
/// The Paging-Type
/// A list containing all fetched pages
Task> PaginateAll(IPaginatable firstPage, IPaginator? paginator = default!);
///
/// Fetches all pages and returns them grouped in a list.
/// Some responses (e.g search response) have the pagination nested in a JSON Property.
/// To workaround this limitation, the mapper is required and needs to point to the correct next pagination.
/// The default paginator will fetch all available resources without a delay between requests.
/// This can drain your request limit quite fast, so consider using a custom paginator with delays.
///
/// A first page, will be included in the output list!
/// A function which maps response objects to the next paging object
/// Optional. If not supplied, DefaultPaginator will be used
/// The Paging-Type
/// The Response-Type
/// A list containing all fetched pages
Task> PaginateAll(
IPaginatable firstPage,
Func> mapper,
IPaginator? paginator = default!
);
///
/// Paginate through pages by using IAsyncEnumerable, introduced in C# 8
/// The default paginator will fetch all available resources without a delay between requests.
/// This can drain your request limit quite fast, so consider using a custom paginator with delays.
///
/// A first page, will be included in the output list!
/// Optional. If not supplied, DefaultPaginator will be used
/// An optional Cancellation Token
/// The Paging-Type
/// An iterable IAsyncEnumerable
IAsyncEnumerable Paginate(
IPaginatable firstPage,
IPaginator? paginator = default!,
CancellationToken cancel = default!
);
///
/// Paginate through pages by using IAsyncEnumerable, introduced in C# 8
/// Some responses (e.g search response) have the pagination nested in a JSON Property.
/// To workaround this limitation, the mapper is required and needs to point to the correct next pagination.
/// The default paginator will fetch all available resources without a delay between requests.
/// This can drain your request limit quite fast, so consider using a custom paginator with delays.
///
/// A first page, will be included in the output list!
/// A function which maps response objects to the next paging object
/// Optional. If not supplied, DefaultPaginator will be used
/// An optional Cancellation Token
/// The Paging-Type
/// The Response-Type
///
IAsyncEnumerable Paginate(
IPaginatable firstPage,
Func> mapper,
IPaginator? paginator = default!,
CancellationToken cancel = default!
);
public Task> NextPage(Paging paging);
public Task> NextPage(CursorPaging cursorPaging);
public Task NextPage(IPaginatable paginatable);
public Task> PreviousPage(Paging paging);
public Task PreviousPage(Paging paging);
}
}