using System.Threading; using System; using System.Collections.Generic; 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(Paging firstPage, IPaginator? paginator = default!); /// /// 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. /// /// A function to retrive 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(Func>> getFirstPage, IPaginator? paginator = default!); /// /// 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. /// /// A task to retrive 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(Task> firstPageTask, 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( Paging firstPage, Func> mapper, 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 function to retrive the 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 /// Task> PaginateAll( Func>> getFirstPage, Func> mapper, 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 Task to retrive the 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 /// Task> PaginateAll( Task> firstPageTask, Func> mapper, IPaginator? paginator = default! ); #if NETSTANDARD2_1 /// /// 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( Paging firstPage, IPaginator? paginator = default!, CancellationToken cancellationToken = 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 Function to retrive the 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( Func>> getFirstPage, IPaginator? paginator = default!, CancellationToken cancellationToken = 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 Task to retrive the 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( Task> firstPageTask, IPaginator? paginator = default!, CancellationToken cancellationToken = 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( Paging firstPage, Func> mapper, IPaginator? paginator = default!, CancellationToken cancellationToken = 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 Function to retrive the 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( Func>> getFirstPage, Func> mapper, IPaginator? paginator = default!, CancellationToken cancellationToken = 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 Task to retrive the 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( Task> firstPageTask, Func> mapper, IPaginator? paginator = default!, CancellationToken cancellationToken = default! ); #endif } }