Class StartResumeUsersPlaybackRequest.Builder
java.lang.Object
se.michaelthelin.spotify.requests.AbstractRequest.Builder<String,StartResumeUsersPlaybackRequest.Builder>
se.michaelthelin.spotify.requests.data.AbstractDataRequest.Builder<String,StartResumeUsersPlaybackRequest.Builder>
se.michaelthelin.spotify.requests.data.player.StartResumeUsersPlaybackRequest.Builder
- All Implemented Interfaces:
IRequest.Builder<String,
StartResumeUsersPlaybackRequest.Builder>
- Enclosing class:
StartResumeUsersPlaybackRequest
public static final class StartResumeUsersPlaybackRequest.Builder
extends AbstractDataRequest.Builder<String,StartResumeUsersPlaybackRequest.Builder>
Builder class for building a
StartResumeUsersPlaybackRequest
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
The request build method.context_uri
(String context_uri) The context URI setter.The device ID setter.offset
(com.google.gson.JsonObject offset) The offset setter.position_ms
(Integer position_ms) The position setter.protected StartResumeUsersPlaybackRequest.Builder
self()
Return this instance to simulate a self-type.uris
(com.google.gson.JsonArray uris) The URI 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 newStartResumeUsersPlaybackRequest.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_id
The device ID setter.- Parameters:
device_id
- Optional. The ID of the device this command is targeting. If not supplied, the user's currently active device is the target.- Returns:
- A
StartResumeUsersPlaybackRequest.Builder
. - See Also:
-
context_uri
The context URI setter.- Parameters:
context_uri
- Optional. Spotify URI of the context to play. Valid contexts are albums, artists and playlists.- Returns:
- A
StartResumeUsersPlaybackRequest.Builder
. - See Also:
-
uris
The URI setter.- Parameters:
uris
- Optional. A JSON array of the Spotify track URIs to play.- Returns:
- A
StartResumeUsersPlaybackRequest.Builder
. - See Also:
-
offset
The offset setter.Note: If
context_uri(String)
has been set and corresponds to an album or playlist object, an offset can be specified either by trackuri
ORposition
. If both are present the request will return an error. If incorrect values are provided forposition
oruri
, the request may be accepted but with an unpredictable resulting action on playback.- Parameters:
offset
- Optional. Indicates from where in the context playback should start. Only available whencontext_uri(String)
corresponds to an album or playlist object, or when theuris(JsonArray)
parameter is used.
Theposition
parameter in theoffset
object is zero based and can’t be negative.
Theuri
parameter in theoffset
object is a string representing the URI of the item to start at.- Returns:
- A
StartResumeUsersPlaybackRequest.Builder
.
-
position_ms
The position setter.- Parameters:
position_ms
- Optional. Indicates from what position to start playback. Must be a positive number. Passing in a position that is greater than the length of the track will cause the player to start playing the next song.- Returns:
- A
StartResumeUsersPlaybackRequest.Builder
.
-
build
The request build method.- Returns:
- A custom
StartResumeUsersPlaybackRequest
.
-
self
Description copied from class:AbstractRequest.Builder
Return this instance to simulate a self-type.- Specified by:
self
in classAbstractRequest.Builder<String,
StartResumeUsersPlaybackRequest.Builder> - Returns:
- This instance.
-