public static final class RemoveItemsFromPlaylistRequest.Builder extends AbstractDataRequest.Builder<SnapshotResult,RemoveItemsFromPlaylistRequest.Builder>
RemoveItemsFromPlaylistRequest.| Constructor and Description |
|---|
Builder(String accessToken)
Create a new
RemoveItemsFromPlaylistRequest.Builder. |
| Modifier and Type | Method and Description |
|---|---|
RemoveItemsFromPlaylistRequest |
build()
The request build method.
|
RemoveItemsFromPlaylistRequest.Builder |
playlist_id(String playlist_id)
The playlist ID setter.
|
protected RemoveItemsFromPlaylistRequest.Builder |
self()
Return this instance to simulate a self-type.
|
RemoveItemsFromPlaylistRequest.Builder |
snapshotId(String snapshotId)
The playlist snapshot ID setter.
|
RemoveItemsFromPlaylistRequest.Builder |
tracks(com.google.gson.JsonArray tracks)
The item URIs setter.
|
RemoveItemsFromPlaylistRequest.Builder |
user_id(String user_id)
Deprecated.
Playlist IDs are unique for themselves. This parameter is thus no longer used.
(https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)
|
setBody, setBodyParameter, setContentType, setDefaults, setHeader, setHost, setHttpManager, setPath, setPathParameter, setPort, setQueryParameter, setSchemepublic Builder(String accessToken)
RemoveItemsFromPlaylistRequest.Builder.
Removing items from an user's public playlists requires authorization of the playlist-modify-public
scope; removing items from an user's private playlist (including collaborative playlists) requires the
playlist-modify-private scope.
accessToken - Required. A valid access token from the Spotify Accounts service.@Deprecated public RemoveItemsFromPlaylistRequest.Builder user_id(String user_id)
user_id - The user's Spotify user ID.RemoveItemsFromPlaylistRequest.Builder.public RemoveItemsFromPlaylistRequest.Builder playlist_id(String playlist_id)
playlist_id - The Spotify ID for the playlist.RemoveItemsFromPlaylistRequest.Builder.public RemoveItemsFromPlaylistRequest.Builder tracks(com.google.gson.JsonArray tracks)
There are several ways to specify which tracks or episodes to remove, determined by the request parameters.
Removing all occurrences of specific items:
[{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" },
{"uri": "spotify:episode:512ojhOuo1ktJprKbVcKyQ" }]
Removing a specific occurrence of an item:
[{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "positions": [0,3] },
{ "uri": "spotify:track:1301WleyT98MSxVHPZCA6M", "positions": [7] }]
tracks - Required. An array of objects containing Spotify URIs of the items to remove. A maximum of
100 objects can be sent at onceRemoveItemsFromPlaylistRequest.Builder.public RemoveItemsFromPlaylistRequest.Builder snapshotId(String snapshotId)
To guard against errors when concurrent edits happen to the same playlist, we recommend specifying a snapshot ID. The snapshot ID lets us know which version of the playlist you are trying to edit. Concurrent edits by another user will be automatically resolved. If a given item in a given position is not found in the specified snapshot, the entire request will fail an no edits will take place.
snapshotId - Optional. The playlist's 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.RemoveItemsFromPlaylistRequest.Builder.public RemoveItemsFromPlaylistRequest build()
RemoveItemsFromPlaylistRequest.protected RemoveItemsFromPlaylistRequest.Builder self()
AbstractRequest.Builderself in class AbstractRequest.Builder<SnapshotResult,RemoveItemsFromPlaylistRequest.Builder>Copyright © 2020. All rights reserved.