Class RemoveItemsFromPlaylistRequest.Builder
- All Implemented Interfaces:
IRequest.Builder<SnapshotResult,
RemoveItemsFromPlaylistRequest.Builder>
- Enclosing class:
RemoveItemsFromPlaylistRequest
RemoveItemsFromPlaylistRequest
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
The request build method.playlist_id
(String playlist_id) The playlist ID setter.protected RemoveItemsFromPlaylistRequest.Builder
self()
Return this instance to simulate a self-type.snapshotId
(String snapshotId) The playlist snapshot ID setter.tracks
(com.google.gson.JsonArray tracks) The item URIs setter.Methods inherited from class se.michaelthelin.spotify.requests.AbstractRequest.Builder
setBody, setBodyParameter, setContentType, setDefaults, setHeader, setHost, setHttpManager, setPath, setPathParameter, setPort, setQueryParameter, setScheme
-
Constructor Details
-
Builder
Create a newRemoveItemsFromPlaylistRequest.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 theplaylist-modify-private
scope.- Parameters:
accessToken
- Required. A valid access token from the Spotify Accounts service.- See Also:
-
-
Method Details
-
playlist_id
The playlist ID setter.- Parameters:
playlist_id
- The Spotify ID for the playlist.- Returns:
- An
RemoveItemsFromPlaylistRequest.Builder
. - See Also:
-
tracks
The item URIs setter.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] }]
- Parameters:
tracks
- Required. An array of objects containing Spotify URIs of the items to remove. A maximum of 100 objects can be sent at once- Returns:
- A
RemoveItemsFromPlaylistRequest.Builder
. - See Also:
-
snapshotId
The playlist snapshot ID setter.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.
- Parameters:
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.- Returns:
- A
RemoveItemsFromPlaylistRequest.Builder
. - See Also:
-
build
The request build method.- Returns:
- A custom
RemoveItemsFromPlaylistRequest
.
-
self
Description copied from class:AbstractRequest.Builder
Return this instance to simulate a self-type.- Specified by:
self
in classAbstractRequest.Builder<SnapshotResult,
RemoveItemsFromPlaylistRequest.Builder> - Returns:
- This instance.
-