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

25 lines
578 B
C#
Raw Normal View History

2020-05-01 19:05:28 +01:00
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));
}
}
}