Spotify.NET/SpotifyAPI.Web/Clients/UserProfileClient.cs

25 lines
659 B
C#
Raw Normal View History

2020-05-01 19:05:28 +01:00
using System;
using System.Threading;
2020-05-01 19:05:28 +01:00
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)
2020-05-01 19:05:28 +01:00
{
return API.Get<PrivateUser>(SpotifyUrls.Me(), cancel);
2020-05-01 19:05:28 +01:00
}
public Task<PublicUser> Get(string userId, CancellationToken cancel = default)
2020-05-01 19:05:28 +01:00
{
Ensure.ArgumentNotNullOrEmptyString(userId, nameof(userId));
return API.Get<PublicUser>(SpotifyUrls.User(userId), cancel);
2020-05-01 19:05:28 +01:00
}
}
}