forked from JohnnyCrazy/SpotifyAPI-NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShowsClient.cs
More file actions
49 lines (38 loc) · 1.69 KB
/
ShowsClient.cs
File metadata and controls
49 lines (38 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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<FullShow> Get(string showId, CancellationToken cancel = default)
{
Ensure.ArgumentNotNullOrEmptyString(showId, nameof(showId));
return API.Get<FullShow>(URLs.Show(showId), cancel);
}
public Task<FullShow> Get(string showId, ShowRequest request, CancellationToken cancel = default)
{
Ensure.ArgumentNotNullOrEmptyString(showId, nameof(showId));
Ensure.ArgumentNotNull(request, nameof(request));
return API.Get<FullShow>(URLs.Show(showId), request.BuildQueryParams(), cancel);
}
public Task<ShowsResponse> GetSeveral(ShowsRequest request, CancellationToken cancel = default)
{
Ensure.ArgumentNotNull(request, nameof(request));
return API.Get<ShowsResponse>(URLs.Shows(), request.BuildQueryParams(), cancel);
}
public Task<Paging<SimpleEpisode>> GetEpisodes(string showId, CancellationToken cancel = default)
{
Ensure.ArgumentNotNullOrEmptyString(showId, nameof(showId));
return API.Get<Paging<SimpleEpisode>>(URLs.ShowEpisodes(showId), cancel);
}
public Task<Paging<SimpleEpisode>> GetEpisodes(string showId, ShowEpisodesRequest request, CancellationToken cancel = default)
{
Ensure.ArgumentNotNullOrEmptyString(showId, nameof(showId));
Ensure.ArgumentNotNull(request, nameof(request));
return API.Get<Paging<SimpleEpisode>>(URLs.ShowEpisodes(showId), request.BuildQueryParams(), cancel);
}
}
}