using System.Threading; using System.Threading.Tasks; using SpotifyAPI.Web.Http; using URLs = SpotifyAPI.Web.SpotifyUrls; namespace SpotifyAPI.Web { public class AlbumsClient : APIClient, IAlbumsClient { public AlbumsClient(IAPIConnector apiConnector) : base(apiConnector) { } public Task Get(string albumId, CancellationToken cancel = default) { Ensure.ArgumentNotNullOrEmptyString(albumId, nameof(albumId)); return API.Get(URLs.Album(albumId),cancel); } public Task Get(string albumId, AlbumRequest request, CancellationToken cancel = default) { Ensure.ArgumentNotNullOrEmptyString(albumId, nameof(albumId)); Ensure.ArgumentNotNull(request, nameof(request)); return API.Get(URLs.Album(albumId), request.BuildQueryParams(), cancel); } public Task GetSeveral(AlbumsRequest request, CancellationToken cancel = default) { Ensure.ArgumentNotNull(request, nameof(request)); return API.Get(URLs.Albums(), request.BuildQueryParams(), cancel); } public Task> GetTracks(string albumId, CancellationToken cancel = default) { Ensure.ArgumentNotNullOrEmptyString(albumId, nameof(albumId)); return API.Get>(URLs.AlbumTracks(albumId), cancel); } public Task> GetTracks(string albumId, AlbumTracksRequest request, CancellationToken cancel = default) { Ensure.ArgumentNotNullOrEmptyString(albumId, nameof(albumId)); Ensure.ArgumentNotNull(request, nameof(request)); return API.Get>(URLs.AlbumTracks(albumId), request.BuildQueryParams(), cancel); } } }