2020-05-03 07:10:41 +01:00
|
|
|
|
using System.Collections.Generic;
|
2020-05-02 21:48:21 +01:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace SpotifyAPI.Web
|
|
|
|
|
{
|
2020-05-31 15:57:58 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Endpoints for retrieving information about a user’s playlists and for managing a user’s playlists.
|
|
|
|
|
/// </summary>
|
2020-05-02 21:48:21 +01:00
|
|
|
|
public interface IPlaylistsClient
|
|
|
|
|
{
|
2020-05-30 23:11:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Remove one or more items from a user’s playlist.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="playlistId">The Spotify ID for the playlist.</param>
|
|
|
|
|
/// <param name="request">The request-model which contains required and optional parameters.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-remove-tracks-playlist
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-02 21:48:21 +01:00
|
|
|
|
Task<SnapshotResponse> RemoveItems(string playlistId, PlaylistRemoveItemsRequest request);
|
2020-05-03 00:00:35 +01:00
|
|
|
|
|
2020-05-30 23:11:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Add one or more items to a user’s playlist.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="playlistId">The Spotify ID for the playlist.</param>
|
|
|
|
|
/// <param name="request">The request-model which contains required and optional parameters.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-add-tracks-to-playlist
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-03 00:00:35 +01:00
|
|
|
|
Task<SnapshotResponse> AddItems(string playlistId, PlaylistAddItemsRequest request);
|
|
|
|
|
|
2020-05-30 23:11:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get full details of the items of a playlist owned by a Spotify user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="playlistId">The Spotify ID for the playlist.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-playlists-tracks
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-07 17:03:20 +01:00
|
|
|
|
Task<Paging<PlaylistTrack<IPlayableItem>>> GetItems(string playlistId);
|
2020-05-30 23:11:05 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get full details of the items of a playlist owned by a Spotify user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="playlistId">The Spotify ID for the playlist.</param>
|
|
|
|
|
/// <param name="request">The request-model which contains required and optional parameters.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-playlists-tracks
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-07 17:03:20 +01:00
|
|
|
|
Task<Paging<PlaylistTrack<IPlayableItem>>> GetItems(string playlistId, PlaylistGetItemsRequest request);
|
2020-05-03 00:00:35 +01:00
|
|
|
|
|
2020-05-30 23:11:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Create a playlist for a Spotify user. (The playlist will be empty until you add tracks.)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId">The user’s Spotify user ID.</param>
|
|
|
|
|
/// <param name="request">The request-model which contains required and optional parameters.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-create-playlist
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-03 00:00:35 +01:00
|
|
|
|
Task<FullPlaylist> Create(string userId, PlaylistCreateRequest request);
|
2020-05-03 07:10:41 +01:00
|
|
|
|
|
2020-05-30 23:11:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Replace the image used to represent a specific playlist.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="playlistId">The Spotify ID for the playlist.</param>
|
|
|
|
|
/// <param name="base64JpgData">Base64 encoded JPEG image data, maximum payload size is 256 KB.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-upload-custom-playlist-cover
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-03 07:10:41 +01:00
|
|
|
|
Task<bool> UploadCover(string playlistId, string base64JpgData);
|
2020-05-30 23:11:05 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get the current image associated with a specific playlist.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="playlistId">The Spotify ID for the playlist.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-playlist-cover
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-03 07:10:41 +01:00
|
|
|
|
Task<List<Image>> GetCovers(string playlistId);
|
2020-05-03 08:06:28 +01:00
|
|
|
|
|
2020-05-30 23:11:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get a list of the playlists owned or followed by a Spotify user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId">The user’s Spotify user ID.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-list-users-playlists
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-03 08:06:28 +01:00
|
|
|
|
Task<Paging<SimplePlaylist>> GetUsers(string userId);
|
2020-05-30 23:11:05 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get a list of the playlists owned or followed by a Spotify user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId">The user’s Spotify user ID.</param>
|
|
|
|
|
/// <param name="request">The request-model which contains required and optional parameters.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-list-users-playlists
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-03 08:06:28 +01:00
|
|
|
|
Task<Paging<SimplePlaylist>> GetUsers(string userId, PlaylistGetUsersRequest request);
|
|
|
|
|
|
2020-05-30 23:11:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get a playlist owned by a Spotify user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="playlistId">The Spotify ID for the playlist.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-playlist
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-05 14:30:00 +01:00
|
|
|
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716")]
|
2020-05-03 08:06:28 +01:00
|
|
|
|
Task<FullPlaylist> Get(string playlistId);
|
2020-05-30 23:11:05 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get a playlist owned by a Spotify user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="playlistId">The Spotify ID for the playlist.</param>
|
|
|
|
|
/// <param name="request">The request-model which contains required and optional parameters.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-playlist
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-05 14:30:00 +01:00
|
|
|
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716")]
|
2020-05-03 08:06:28 +01:00
|
|
|
|
Task<FullPlaylist> Get(string playlistId, PlaylistGetRequest request);
|
|
|
|
|
|
2020-05-30 23:11:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Replace all the items in a playlist, overwriting its existing items.
|
|
|
|
|
/// This powerful request can be useful for replacing items, re-ordering existing items, or clearing the playlist.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="playlistId">The Spotify ID for the playlist.</param>
|
|
|
|
|
/// <param name="request">The request-model which contains required and optional parameters.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-replace-playlists-tracks
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-03 08:06:28 +01:00
|
|
|
|
Task<bool> ReplaceItems(string playlistId, PlaylistReplaceItemsRequest request);
|
|
|
|
|
|
2020-05-30 23:11:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get a list of the playlists owned or followed by the current Spotify user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-a-list-of-current-users-playlists
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-03 08:06:28 +01:00
|
|
|
|
Task<Paging<SimplePlaylist>> CurrentUsers();
|
2020-05-30 23:11:05 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get a list of the playlists owned or followed by the current Spotify user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request">The request-model which contains required and optional parameters.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-a-list-of-current-users-playlists
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-03 08:06:28 +01:00
|
|
|
|
Task<Paging<SimplePlaylist>> CurrentUsers(PlaylistCurrentUsersRequest request);
|
2020-05-03 12:11:53 +01:00
|
|
|
|
|
2020-05-30 23:11:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Change a playlist’s name and public/private state. (The user must, of course, own the playlist.)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="playlistId">The Spotify ID for the playlist.</param>
|
|
|
|
|
/// <param name="request">The request-model which contains required and optional parameters.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-change-playlist-details
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-03 12:11:53 +01:00
|
|
|
|
Task<bool> ChangeDetails(string playlistId, PlaylistChangeDetailsRequest request);
|
2020-05-03 21:34:03 +01:00
|
|
|
|
|
2020-05-30 23:11:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Reorder an item or a group of items in a playlist.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="playlistId">The Spotify ID for the playlist.</param>
|
|
|
|
|
/// <param name="request">The request-model which contains required and optional parameters.</param>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-reorder-playlists-tracks
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <returns></returns>
|
2020-05-03 21:34:03 +01:00
|
|
|
|
Task<SnapshotResponse> ReorderItems(string playlistId, PlaylistReorderItemsRequest request);
|
2020-05-02 21:48:21 +01:00
|
|
|
|
}
|
|
|
|
|
}
|