2020-05-01 19:05:28 +01:00
|
|
|
using SpotifyAPI.Web.Http;
|
|
|
|
|
|
|
|
namespace SpotifyAPI.Web
|
|
|
|
{
|
|
|
|
public class SpotifyClient : ISpotifyClient
|
|
|
|
{
|
2020-05-02 12:04:26 +01:00
|
|
|
private readonly IAPIConnector _apiConnector;
|
2020-05-01 19:05:28 +01:00
|
|
|
|
|
|
|
public SpotifyClient(string token, string tokenType = "Bearer") :
|
2020-05-02 12:04:26 +01:00
|
|
|
this(SpotifyClientConfig.CreateDefault(token, tokenType))
|
2020-05-01 19:05:28 +01:00
|
|
|
{ }
|
|
|
|
|
2020-05-02 12:04:26 +01:00
|
|
|
public SpotifyClient(SpotifyClientConfig config)
|
2020-05-01 19:05:28 +01:00
|
|
|
{
|
2020-05-02 12:04:26 +01:00
|
|
|
Ensure.ArgumentNotNull(config, nameof(config));
|
2020-05-01 19:05:28 +01:00
|
|
|
|
2020-05-02 12:04:26 +01:00
|
|
|
_apiConnector = config.CreateAPIConnector();
|
2020-05-01 19:05:28 +01:00
|
|
|
UserProfile = new UserProfileClient(_apiConnector);
|
|
|
|
Browse = new BrowseClient(_apiConnector);
|
2020-05-02 21:48:21 +01:00
|
|
|
Shows = new ShowsClient(_apiConnector);
|
|
|
|
Playlists = new PlaylistsClient(_apiConnector);
|
2020-05-01 19:05:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public IUserProfileClient UserProfile { get; }
|
|
|
|
|
|
|
|
public IBrowseClient Browse { get; }
|
2020-05-02 21:48:21 +01:00
|
|
|
|
|
|
|
public IShowsClient Shows { get; }
|
|
|
|
|
|
|
|
public IPlaylistsClient Playlists { get; }
|
2020-05-01 19:05:28 +01:00
|
|
|
}
|
|
|
|
}
|