using System.Threading; using System.Threading.Tasks; using SpotifyAPI.Web.Http; using URLs = SpotifyAPI.Web.SpotifyUrls; namespace SpotifyAPI.Web { public class ShowsClient : APIClient, IShowsClient { public ShowsClient(IAPIConnector connector) : base(connector) { } public Task Get(string showId, CancellationToken cancel = default) { Ensure.ArgumentNotNullOrEmptyString(showId, nameof(showId)); return API.Get(URLs.Show(showId), cancel); } public Task Get(string showId, ShowRequest request, CancellationToken cancel = default) { Ensure.ArgumentNotNullOrEmptyString(showId, nameof(showId)); Ensure.ArgumentNotNull(request, nameof(request)); return API.Get(URLs.Show(showId), request.BuildQueryParams(), cancel); } public Task GetSeveral(ShowsRequest request, CancellationToken cancel = default) { Ensure.ArgumentNotNull(request, nameof(request)); return API.Get(URLs.Shows(), request.BuildQueryParams(), cancel); } public Task> GetEpisodes(string showId, CancellationToken cancel = default) { Ensure.ArgumentNotNullOrEmptyString(showId, nameof(showId)); return API.Get>(URLs.ShowEpisodes(showId), cancel); } public Task> GetEpisodes(string showId, ShowEpisodesRequest request, CancellationToken cancel = default) { Ensure.ArgumentNotNullOrEmptyString(showId, nameof(showId)); Ensure.ArgumentNotNull(request, nameof(request)); return API.Get>(URLs.ShowEpisodes(showId), request.BuildQueryParams(), cancel); } } }