Class AddItemsToPlaylistRequest.Builder
java.lang.Object
se.michaelthelin.spotify.requests.AbstractRequest.Builder<SnapshotResult,AddItemsToPlaylistRequest.Builder>
se.michaelthelin.spotify.requests.data.AbstractDataRequest.Builder<SnapshotResult,AddItemsToPlaylistRequest.Builder>
se.michaelthelin.spotify.requests.data.playlists.AddItemsToPlaylistRequest.Builder
- All Implemented Interfaces:
IRequest.Builder<SnapshotResult,
AddItemsToPlaylistRequest.Builder>
- Enclosing class:
AddItemsToPlaylistRequest
public static final class AddItemsToPlaylistRequest.Builder
extends AbstractDataRequest.Builder<SnapshotResult,AddItemsToPlaylistRequest.Builder>
Builder class for building an
AddItemsToPlaylistRequest
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
The request build method.playlist_id
(String playlist_id) The playlist ID setter.The position setter.The position setter.protected AddItemsToPlaylistRequest.Builder
self()
Return this instance to simulate a self-type.uris
(com.google.gson.JsonArray uris) The item URIs setter.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 newAddItemsToPlaylistRequest.Builder
.Adding items to the current user's public playlists requires authorization of the
playlist-modify-public
scope; adding items to the current 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
AddItemsToPlaylistRequest.Builder
. - See Also:
-
uris
The item URIs setter.Note: It is likely that passing a large number of item URIs as a query parameter will exceed the maximum length of the request URI. When adding a large number of items it is recommended to pass them with
uris(JsonArray)
.- Parameters:
uris
- Optional. A comma-separated list of Spotify track or episode URIs to add. Maximum: 100 item URIs.- Returns:
- An
AddItemsToPlaylistRequest.Builder
. - See Also:
-
position
The position setter.- Parameters:
position
- Optional. The position to insert the items, a zero-based index. If omitted, the items will be appended to the playlist. Items are added in the order they are listed in the query string or request body.- Returns:
- An
AddItemsToPlaylistRequest.Builder
.
-
uris
The item URIs setter.Note: If the URIs already have been set with
uris(String)
, any URIs listed here will be ignored.- Parameters:
uris
- Optional. A JSON array of the Spotify track or episode URIs to add. maximum: 100 item URIs.- Returns:
- An
AddItemsToPlaylistRequest.Builder
. - See Also:
-
position
The position setter. You can set it in the request query string or request body, depending on theuse_body
parameter.- Parameters:
position
- Optional. The position to insert the items, a zero-based index. If omitted, the items will be appended to the playlist. Items are added in the order they are listed in the query string or request body.use_body
- Whether to include the position in the request query string or body.- Returns:
- An
AddItemsToPlaylistRequest.Builder
.
-
build
The request build method.- Returns:
- A custom
AddItemsToPlaylistRequest
.
-
self
Description copied from class:AbstractRequest.Builder
Return this instance to simulate a self-type.- Specified by:
self
in classAbstractRequest.Builder<SnapshotResult,
AddItemsToPlaylistRequest.Builder> - Returns:
- This instance.
-