Spotify.NET/SpotifyAPI.Web/Models/Request/PlaylistRemoveItemsRequest.cs
Jonas Dellinger 7445d3ca0e 📘 More docs! #451
2020-05-31 00:11:05 +02:00

56 lines
1.9 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.Collections.Generic;
using Newtonsoft.Json;
namespace SpotifyAPI.Web
{
public class PlaylistRemoveItemsRequest : RequestParams
{
/// <summary>
///
/// </summary>
/// <param name="tracks">
/// An array of objects containing Spotify URIs of the tracks or episodes to remove.
/// For example: { "tracks": [{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" },
/// { "uri": "spotify:track:1301WleyT98MSxVHPZCA6M" }] }.
/// A maximum of 100 objects can be sent at once.
/// </param>
public PlaylistRemoveItemsRequest(IList<Item> tracks)
{
Ensure.ArgumentNotNullOrEmptyList(tracks, nameof(tracks));
Tracks = tracks;
}
/// <summary>
/// An array of objects containing Spotify URIs of the tracks or episodes to remove.
/// For example: { "tracks": [{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" },
/// { "uri": "spotify:track:1301WleyT98MSxVHPZCA6M" }] }.
/// A maximum of 100 objects can be sent at once.
/// </summary>
/// <value></value>
[BodyParam("tracks")]
public IList<Item> Tracks { get; }
/// <summary>
/// The playlists snapshot ID against which you want to make the changes.
/// The API will validate that the specified items exist and in the specified positions and make the changes,
/// even if more recent changes have been made to the playlist.
/// </summary>
/// <value></value>
[BodyParam("snapshot_id")]
public string? SnapshotId { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034")]
public class Item
{
[JsonProperty("uri", NullValueHandling = NullValueHandling.Ignore)]
public string? Uri { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227")]
[JsonProperty("positions", NullValueHandling = NullValueHandling.Ignore)]
public List<int>? Positions { get; set; }
}
}
}