Spotify.NET/SpotifyAPI.Web/Clients/Interfaces/IPersonalizationClient.cs
Sascha Kiefer b8a2190168
feat: allow to pass cancellation token to requests (#813)
* feat: implements markets API

* fix: use correct constructor name

* feat: allow to pass a cancellation token

* pass cancellation token

* pass cancellation token only >NETSTANDARD2_1

Co-authored-by: Jonas Dellinger <jonas@dellinger.dev>
2022-11-18 12:30:09 +01:00

54 lines
2.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Threading;
using System.Threading.Tasks;
namespace SpotifyAPI.Web
{
/// <summary>
/// Endpoints for retrieving information about the users listening habits.
/// </summary>
public interface IPersonalizationClient
{
/// <summary>
/// Get the current users top tracks based on calculated affinity.
/// </summary>
/// <param name="cancel">The cancellation-token to allow to cancel the request.</param>
/// <remarks>
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-users-top-artists-and-tracks
/// </remarks>
/// <returns></returns>
Task<Paging<FullTrack>> GetTopTracks(CancellationToken cancel = default);
/// <summary>
/// Get the current users top tracks based on calculated affinity.
/// </summary>
/// <param name="request">The request-model which contains required and optional parameters.</param>
/// <param name="cancel">The cancellation-token to allow to cancel the request.</param>
/// <remarks>
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-users-top-artists-and-tracks
/// </remarks>
/// <returns></returns>
Task<Paging<FullTrack>> GetTopTracks(PersonalizationTopRequest request, CancellationToken cancel = default);
/// <summary>
/// Get the current users top artists based on calculated affinity.
/// </summary>
/// <param name="cancel">The cancellation-token to allow to cancel the request.</param>
/// <remarks>
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-users-top-artists-and-tracks
/// </remarks>
/// <returns></returns>
Task<Paging<FullArtist>> GetTopArtists(CancellationToken cancel = default);
/// <summary>
/// Get the current users top artists based on calculated affinity.
/// </summary>
/// <param name="request">The request-model which contains required and optional parameters.</param>
/// <param name="cancel">The cancellation-token to allow to cancel the request.</param>
/// <remarks>
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-users-top-artists-and-tracks
/// </remarks>
/// <returns></returns>
Task<Paging<FullArtist>> GetTopArtists(PersonalizationTopRequest request, CancellationToken cancel = default);
}
}