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

33 lines
864 B
C#
Raw Normal View History

2020-05-01 19:05:28 +01:00
using SpotifyAPI.Web.Http;
namespace SpotifyAPI.Web
{
public class SpotifyClient : ISpotifyClient
{
private readonly IAPIConnector _apiConnector;
2020-05-01 19:05:28 +01:00
public SpotifyClient(string token, string tokenType = "Bearer") :
this(SpotifyClientConfig.CreateDefault(token, tokenType))
2020-05-01 19:05:28 +01:00
{ }
public SpotifyClient(SpotifyClientConfig config)
2020-05-01 19:05:28 +01:00
{
Ensure.ArgumentNotNull(config, nameof(config));
2020-05-01 19:05:28 +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
}
}