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
48 lines (37 loc) · 1.45 KB
/
ShowsClient.cs
File metadata and controls
48 lines (37 loc) · 1.45 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
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)
{
Ensure.ArgumentNotNullOrEmptyString(showId, nameof(showId));
return API.Get<FullShow>(URLs.Show(showId));
}
public Task<FullShow> Get(string showId, ShowRequest request)
{
Ensure.ArgumentNotNullOrEmptyString(showId, nameof(showId));
Ensure.ArgumentNotNull(request, nameof(request));
return API.Get<FullShow>(URLs.Show(showId), request.BuildQueryParams());
}
public Task<ShowsResponse> GetSeveral(ShowsRequest request)
{
Ensure.ArgumentNotNull(request, nameof(request));
return API.Get<ShowsResponse>(URLs.Shows(), request.BuildQueryParams());
}
public Task<Paging<SimpleEpisode>> GetEpisodes(string showId)
{
Ensure.ArgumentNotNullOrEmptyString(showId, nameof(showId));
return API.Get<Paging<SimpleEpisode>>(URLs.ShowEpisodes(showId));
}
public Task<Paging<SimpleEpisode>> GetEpisodes(string showId, ShowEpisodesRequest request)
{
Ensure.ArgumentNotNullOrEmptyString(showId, nameof(showId));
Ensure.ArgumentNotNull(request, nameof(request));
return API.Get<Paging<SimpleEpisode>>(URLs.ShowEpisodes(showId), request.BuildQueryParams());
}
}
}