/// <summary>
        /// Initializes a new instance based on the specified <code>refreshToken</code>.
        /// </summary>
        /// <param name="clientId">The client ID.</param>
        /// <param name="clientSecret">The client secret.</param>
        /// <param name="refreshToken">The refresh token of the user.</param>
        public static SpotifyService CreateFromRefreshToken(string clientId, string clientSecret, string refreshToken) {

            // Initialize a new OAuth client
            SpotifyOAuthClient client = new SpotifyOAuthClient(clientId, clientSecret);

            // Get an access token from the refresh token.
            SpotifyTokenResponse response = client.GetAccessTokenFromRefreshToken(refreshToken);

            // Update the OAuth client with the access token
            client.AccessToken = response.Body.AccessToken;

            // Initialize a new service instance
            return new SpotifyService(client);

        }
 private SpotifyService(SpotifyOAuthClient client) {
     Client = client;
     Artists = new SpotifyArtistsEndpoint(this);
 }
 /// <summary>
 /// Initialize a new service instance from the specified OAuth client.
 /// </summary>
 /// <param name="client">The OAuth client.</param>
 public static SpotifyService CreateFromOAuthClient(SpotifyOAuthClient client) {
     if (client == null) throw new ArgumentNullException("client");
     return new SpotifyService(client);
 }
 internal SpotifyArtistsRawEndpoint(SpotifyOAuthClient client) {
     Client = client;
 }