Class RemoveItemsFromPlaylistRequest.Builder
- java.lang.Object
-
- se.michaelthelin.spotify.requests.AbstractRequest.Builder<T,BT>
-
- se.michaelthelin.spotify.requests.data.AbstractDataRequest.Builder<SnapshotResult,RemoveItemsFromPlaylistRequest.Builder>
-
- se.michaelthelin.spotify.requests.data.playlists.RemoveItemsFromPlaylistRequest.Builder
-
- All Implemented Interfaces:
IRequest.Builder<SnapshotResult,RemoveItemsFromPlaylistRequest.Builder>
- Enclosing class:
- RemoveItemsFromPlaylistRequest
public static final class RemoveItemsFromPlaylistRequest.Builder extends AbstractDataRequest.Builder<SnapshotResult,RemoveItemsFromPlaylistRequest.Builder>
Builder class for building aRemoveItemsFromPlaylistRequest.
-
-
Constructor Summary
Constructors Constructor Description Builder(String accessToken)Create a newRemoveItemsFromPlaylistRequest.Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RemoveItemsFromPlaylistRequestbuild()The request build method.RemoveItemsFromPlaylistRequest.Builderplaylist_id(String playlist_id)The playlist ID setter.protected RemoveItemsFromPlaylistRequest.Builderself()Return this instance to simulate a self-type.RemoveItemsFromPlaylistRequest.BuildersnapshotId(String snapshotId)The playlist snapshot ID setter.RemoveItemsFromPlaylistRequest.Buildertracks(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 Detail
-
Builder
public Builder(String accessToken)
Create a newRemoveItemsFromPlaylistRequest.Builder.Removing items from an user's public playlists requires authorization of the
playlist-modify-publicscope; removing items from an user's private playlist (including collaborative playlists) requires theplaylist-modify-privatescope.- Parameters:
accessToken- Required. A valid access token from the Spotify Accounts service.- See Also:
- Spotify: Using Scopes
-
-
Method Detail
-
playlist_id
public RemoveItemsFromPlaylistRequest.Builder playlist_id(String playlist_id)
The playlist ID setter.- Parameters:
playlist_id- The Spotify ID for the playlist.- Returns:
- An
RemoveItemsFromPlaylistRequest.Builder. - See Also:
- Spotify: URIs & IDs
-
tracks
public RemoveItemsFromPlaylistRequest.Builder tracks(com.google.gson.JsonArray 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:
- Spotify: URIs & IDs
-
snapshotId
public RemoveItemsFromPlaylistRequest.Builder snapshotId(String 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:
- Spotify: Version Control and Snapshots
-
build
public RemoveItemsFromPlaylistRequest build()
The request build method.- Returns:
- A custom
RemoveItemsFromPlaylistRequest.
-
self
protected RemoveItemsFromPlaylistRequest.Builder self()
Description copied from class:AbstractRequest.BuilderReturn this instance to simulate a self-type.- Specified by:
selfin classAbstractRequest.Builder<SnapshotResult,RemoveItemsFromPlaylistRequest.Builder>- Returns:
- This instance.
-
-