Spotify.NET/SpotifyAPI.Web/Clients/SpotifyClient.cs
2020-05-02 22:48:21 +02:00

33 lines
864 B
C#

using SpotifyAPI.Web.Http;
namespace SpotifyAPI.Web
{
public class SpotifyClient : ISpotifyClient
{
private readonly IAPIConnector _apiConnector;
public SpotifyClient(string token, string tokenType = "Bearer") :
this(SpotifyClientConfig.CreateDefault(token, tokenType))
{ }
public SpotifyClient(SpotifyClientConfig config)
{
Ensure.ArgumentNotNull(config, nameof(config));
_apiConnector = config.CreateAPIConnector();
UserProfile = new UserProfileClient(_apiConnector);
Browse = new BrowseClient(_apiConnector);
Shows = new ShowsClient(_apiConnector);
Playlists = new PlaylistsClient(_apiConnector);
}
public IUserProfileClient UserProfile { get; }
public IBrowseClient Browse { get; }
public IShowsClient Shows { get; }
public IPlaylistsClient Playlists { get; }
}
}