-
Notifications
You must be signed in to change notification settings - Fork 315
Expand file tree
/
Copy pathChaptersClient.cs
More file actions
35 lines (28 loc) · 1.24 KB
/
ChaptersClient.cs
File metadata and controls
35 lines (28 loc) · 1.24 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
using System.Threading;
using System.Threading.Tasks;
using SpotifyAPI.Web.Http;
using URLs = SpotifyAPI.Web.SpotifyUrls;
namespace SpotifyAPI.Web
{
public class ChaptersClient : APIClient, IChaptersClient
{
public ChaptersClient(IAPIConnector apiConnector) : base(apiConnector) { }
public Task<FullAudiobookChapter> Get(string chapterId, CancellationToken cancel = default)
{
Ensure.ArgumentNotNullOrEmptyString(chapterId, nameof(chapterId));
return API.Get<FullAudiobookChapter>(URLs.Chapter(chapterId), cancel);
}
public Task<FullAudiobookChapter> Get(string chapterId, ChapterRequest request, CancellationToken cancel = default)
{
Ensure.ArgumentNotNullOrEmptyString(chapterId, nameof(chapterId));
Ensure.ArgumentNotNull(request, nameof(request));
return API.Get<FullAudiobookChapter>(URLs.Chapter(chapterId), request.BuildQueryParams(), cancel);
}
[System.Obsolete("This endpoint (GET /chapters) has been removed.")]
public Task<ChaptersResponse> GetSeveral(ChaptersRequest request, CancellationToken cancel = default)
{
Ensure.ArgumentNotNull(request, nameof(request));
return API.Get<ChaptersResponse>(URLs.Chapters(), request.BuildQueryParams(), cancel);
}
}
}