Spotify.NET/SpotifyAPI.Web/Clients/MarketsClient.cs
Sascha Kiefer b8a2190168
feat: allow to pass cancellation token to requests (#813)
* 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>
2022-11-18 12:30:09 +01:00

18 lines
475 B
C#

using System.Threading;
using System.Threading.Tasks;
using SpotifyAPI.Web.Http;
using URLs = SpotifyAPI.Web.SpotifyUrls;
namespace SpotifyAPI.Web
{
public class MarketsClient : APIClient, IMarketsClient
{
public MarketsClient(IAPIConnector apiConnector) : base(apiConnector) { }
public Task<AvailableMarketsResponse> AvailableMarkets(CancellationToken cancel = default)
{
return API.Get<AvailableMarketsResponse>(URLs.Markets(), cancel);
}
}
}