mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-24 15:06:26 +00:00
b8a2190168
* feat: implements markets API * fix: use correct constructor name * feat: allow to pass a cancellation token * pass cancellation token * pass cancellation token only >NETSTANDARD2_1 Co-authored-by: Jonas Dellinger <jonas@dellinger.dev>
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using SpotifyAPI.Web.Http;
|
|
using URLs = SpotifyAPI.Web.SpotifyUrls;
|
|
|
|
namespace SpotifyAPI.Web
|
|
{
|
|
public class EpisodesClient : APIClient, IEpisodesClient
|
|
{
|
|
public EpisodesClient(IAPIConnector apiConnector) : base(apiConnector) { }
|
|
|
|
public Task<FullEpisode> Get(string episodeId, CancellationToken cancel = default)
|
|
{
|
|
Ensure.ArgumentNotNullOrEmptyString(episodeId, nameof(episodeId));
|
|
|
|
return API.Get<FullEpisode>(URLs.Episode(episodeId), cancel);
|
|
}
|
|
|
|
public Task<FullEpisode> Get(string episodeId, EpisodeRequest request, CancellationToken cancel = default)
|
|
{
|
|
Ensure.ArgumentNotNullOrEmptyString(episodeId, nameof(episodeId));
|
|
Ensure.ArgumentNotNull(request, nameof(request));
|
|
|
|
return API.Get<FullEpisode>(URLs.Episode(episodeId), request.BuildQueryParams(), cancel);
|
|
}
|
|
|
|
public Task<EpisodesResponse> GetSeveral(EpisodesRequest request, CancellationToken cancel = default)
|
|
{
|
|
Ensure.ArgumentNotNull(request, nameof(request));
|
|
|
|
return API.Get<EpisodesResponse>(URLs.Episodes(), request.BuildQueryParams(), cancel);
|
|
}
|
|
}
|
|
}
|