Class TransferUsersPlaybackRequest.Builder
java.lang.Object
se.michaelthelin.spotify.requests.AbstractRequest.Builder<String,TransferUsersPlaybackRequest.Builder>
se.michaelthelin.spotify.requests.data.AbstractDataRequest.Builder<String,TransferUsersPlaybackRequest.Builder>
se.michaelthelin.spotify.requests.data.player.TransferUsersPlaybackRequest.Builder
- All Implemented Interfaces:
IRequest.Builder<String,
TransferUsersPlaybackRequest.Builder>
- Enclosing class:
TransferUsersPlaybackRequest
public static final class TransferUsersPlaybackRequest.Builder
extends AbstractDataRequest.Builder<String,TransferUsersPlaybackRequest.Builder>
Builder class for building a
TransferUsersPlaybackRequest
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
The request build method.device_ids
(com.google.gson.JsonArray device_ids) The device ID setter.The playing state setter.protected TransferUsersPlaybackRequest.Builder
self()
Return this instance to simulate a self-type.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 newTransferUsersPlaybackRequest.Builder
.Your access token must have the
user-modify-playback-state
scope authorized in order to control playback.- Parameters:
accessToken
- Required. A valid access token from the Spotify Accounts service.- See Also:
-
-
Method Details
-
device_ids
The device ID setter.- Parameters:
device_ids
- Required. A JSON array containing the ID of the device on which playback should be started/transferred. Note: Although an array is accepted, only a singledevice_id
is currently supported.- Returns:
- A
TransferUsersPlaybackRequest.Builder
. - See Also:
-
play
The playing state setter.- Parameters:
play
- Optional.true
: ensure playback happens on new device.false
or not provided: keep the current playback state.- Returns:
- A
TransferUsersPlaybackRequest.Builder
.
-
build
The request build method.- Returns:
- A custom
TransferUsersPlaybackRequest
.
-
self
Description copied from class:AbstractRequest.Builder
Return this instance to simulate a self-type.- Specified by:
self
in classAbstractRequest.Builder<String,
TransferUsersPlaybackRequest.Builder> - Returns:
- This instance.
-