Spotify.NET/SpotifyAPI.Web/Clients/UserProfileClient.cs
2020-05-01 20:05:28 +02:00

25 lines
578 B
C#

using System;
using System.Threading.Tasks;
using SpotifyAPI.Web.Http;
using SpotifyAPI.Web.Models;
namespace SpotifyAPI.Web
{
public class UserProfileClient : APIClient, IUserProfileClient
{
public UserProfileClient(IAPIConnector apiConnector) : base(apiConnector) { }
public Task<PrivateUser> Current()
{
return API.Get<PrivateUser>(SpotifyUrls.Me());
}
public Task<PublicUser> Get(string userId)
{
Ensure.ArgumentNotNullOrEmptyString(userId, nameof(userId));
return API.Get<PublicUser>(SpotifyUrls.User(userId));
}
}
}