mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 22:56:25 +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>
25 lines
659 B
C#
25 lines
659 B
C#
using System;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using SpotifyAPI.Web.Http;
|
|
|
|
namespace SpotifyAPI.Web
|
|
{
|
|
public class UserProfileClient : APIClient, IUserProfileClient
|
|
{
|
|
public UserProfileClient(IAPIConnector apiConnector) : base(apiConnector) { }
|
|
|
|
public Task<PrivateUser> Current(CancellationToken cancel = default)
|
|
{
|
|
return API.Get<PrivateUser>(SpotifyUrls.Me(), cancel);
|
|
}
|
|
|
|
public Task<PublicUser> Get(string userId, CancellationToken cancel = default)
|
|
{
|
|
Ensure.ArgumentNotNullOrEmptyString(userId, nameof(userId));
|
|
|
|
return API.Get<PublicUser>(SpotifyUrls.User(userId), cancel);
|
|
}
|
|
}
|
|
}
|